mirror of
https://github.com/xtream1101/humblebundle-downloader.git
synced 2024-11-20 08:49:17 +01:00
Fixed a windows filename bug. Fixed bug where item does not have a web url
This commit is contained in:
parent
1d3ae04a60
commit
b0a06d8bc0
@ -1,5 +1,11 @@
|
|||||||
# Change log
|
# Change log
|
||||||
|
|
||||||
|
|
||||||
|
### 0.0.7
|
||||||
|
- Replace `:` with ` -` in filenames
|
||||||
|
- Ignore items that do not have a web url
|
||||||
|
|
||||||
|
|
||||||
### 0.0.6
|
### 0.0.6
|
||||||
- Started change log
|
- Started change log
|
||||||
- Added more detail to readme
|
- Added more detail to readme
|
||||||
|
@ -1 +1 @@
|
|||||||
__version__ = '0.0.6'
|
__version__ = '0.0.7'
|
||||||
|
@ -8,9 +8,9 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
def _clean_name(dirty_str):
|
def _clean_name(dirty_str):
|
||||||
allowed_chars = (' ', '_', '.', '-', ':', '[', ']')
|
allowed_chars = (' ', '_', '.', '-', '[', ']')
|
||||||
clean = []
|
clean = []
|
||||||
for c in dirty_str.replace('+', '_'):
|
for c in dirty_str.replace('+', '_').replace(':', ' -'):
|
||||||
if c.isalpha() or c.isdigit() or c in allowed_chars:
|
if c.isalpha() or c.isdigit() or c in allowed_chars:
|
||||||
clean.append(c)
|
clean.append(c)
|
||||||
|
|
||||||
@ -61,7 +61,11 @@ def download_library(cookie_path, library_path, progress_bar=False):
|
|||||||
|
|
||||||
# Download each file type of a product
|
# Download each file type of a product
|
||||||
for file_type in download_type['download_struct']:
|
for file_type in download_type['download_struct']:
|
||||||
url = file_type['url']['web']
|
try:
|
||||||
|
url = file_type['url']['web']
|
||||||
|
except KeyError:
|
||||||
|
logger.info("No url found for " + item_title)
|
||||||
|
continue
|
||||||
ext = url.split('?')[0].split('.')[-1]
|
ext = url.split('?')[0].split('.')[-1]
|
||||||
file_title = item_title + "." + ext
|
file_title = item_title + "." + ext
|
||||||
filename = os.path.join(item_folder, file_title)
|
filename = os.path.join(item_folder, file_title)
|
||||||
|
Loading…
Reference in New Issue
Block a user