diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e1653c..2dc2e07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log + +### 0.0.7 +- Replace `:` with ` -` in filenames +- Ignore items that do not have a web url + + ### 0.0.6 - Started change log - Added more detail to readme diff --git a/humblebundle_downloader/_version.py b/humblebundle_downloader/_version.py index fa9c4ec..2792152 100644 --- a/humblebundle_downloader/_version.py +++ b/humblebundle_downloader/_version.py @@ -1 +1 @@ -__version__ = '0.0.6' +__version__ = '0.0.7' diff --git a/humblebundle_downloader/download_library.py b/humblebundle_downloader/download_library.py index 4ca8f39..a4e5f19 100644 --- a/humblebundle_downloader/download_library.py +++ b/humblebundle_downloader/download_library.py @@ -8,9 +8,9 @@ logger = logging.getLogger(__name__) def _clean_name(dirty_str): - allowed_chars = (' ', '_', '.', '-', ':', '[', ']') + allowed_chars = (' ', '_', '.', '-', '[', ']') 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: clean.append(c) @@ -61,7 +61,11 @@ def download_library(cookie_path, library_path, progress_bar=False): # Download each file type of a product 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] file_title = item_title + "." + ext filename = os.path.join(item_folder, file_title)