mirror of
https://github.com/Emersont1/itchio.git
synced 2026-03-11 08:54:39 +00:00
parent
9370bbfe46
commit
0bebcddcc4
2 changed files with 11 additions and 1 deletions
|
|
@ -53,7 +53,8 @@ class Game:
|
|||
continue
|
||||
|
||||
file = d['filename'] or d['display_name'] or d['id']
|
||||
path = f"{self.publisher_slug}/{self.game_slug}"
|
||||
path = itchiodl.utils.clean_path(
|
||||
f"{self.publisher_slug}/{self.game_slug}")
|
||||
if os.path.exists(f"{path}/{file}"):
|
||||
print(f"Skipping {path}/{file}")
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import requests
|
||||
import re
|
||||
import os
|
||||
import sys
|
||||
|
||||
from clint.textui import progress
|
||||
|
||||
|
|
@ -54,3 +55,11 @@ def download(url, path, name, file):
|
|||
|
||||
print(f"Downloaded {filename}")
|
||||
return f"{path}/{filename}", True
|
||||
|
||||
|
||||
def clean_path(path):
|
||||
"""Cleans a path on windows"""
|
||||
if sys.platform in ["win32", "cygwin", "msys"]:
|
||||
path_clean = re.replace(r'[\<\>\:\"\/\\\|\?\*]', "-", path)
|
||||
return path_clean
|
||||
return path
|
||||
|
|
|
|||
Loading…
Reference in a new issue