From 3743729308e5e890e1d7821c3c509d1e3864348e Mon Sep 17 00:00:00 2001 From: Michael Kuperfish Steinberg <36902556+Michael-K-Stein@users.noreply.github.com> Date: Fri, 20 Jan 2023 14:25:53 +0200 Subject: [PATCH 1/3] Fix minor bugs --- settings.py | 3 ++- spotify_mass_download.py | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/settings.py b/settings.py index 2e30aa8..602347a 100644 --- a/settings.py +++ b/settings.py @@ -1,5 +1,5 @@ class Settings: - DEFAULT_DOWNLOAD_DIRECTORY = 'E:\\Spotify\\' + DEFAULT_DOWNLOAD_DIRECTORY = 'music\\' ARTIST_IMAGES_SUB_DIR = '_Artists' PLAYLIST_METADATA_SUB_DIR = '_Playlists' CATEGORY_METADATA_SUB_DIR = '_Categories' @@ -8,3 +8,4 @@ class Settings: FULL_DOWNLOAD_THREAD_LIMIT = 50 VERBOSE_OUTPUTS = False AUTO_DOWNLOAD_PLAYLIST_METADATA = True + DOWNLOADS_FILE_SAVE_INTERVAL = 15 diff --git a/spotify_mass_download.py b/spotify_mass_download.py index d4f3f06..3983608 100644 --- a/spotify_mass_download.py +++ b/spotify_mass_download.py @@ -119,7 +119,7 @@ def save_globals_save_file(): f.write( json.dumps(data) ) if settings.VERBOSE_OUTPUTS: console.log('Saved globals file!') - sleep(15) + sleep(settings.DOWNLOADS_FILE_SAVE_INTERVAL) def full_download(download_dir: str, identifier: str, recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False, recursive_limit:int=1024, thread_count:int=5): @@ -133,7 +133,6 @@ def full_download(download_dir: str, identifier: str, recursive_artist: bool=Fal client.refresh_tokens() console.log(f'Recieved scrape command on identifier: {identifier}, {recursive=}, {recursive_artist=}, {recursive_album=}, {recursive_limit=}, {thread_count=}') - #console.log(f'Scraping on identifier: {identifier} yielded {len(track_list)} tracks!') download_threads = [] track_list = [] for track in scraper.scrape_tracks(identifier, console=console): @@ -177,12 +176,11 @@ def download_all_categories_playlists(download_meta_data_only=True, query:str='' random.shuffle(categories) for category_index, category in enumerate(categories): console.log(f'Scraping playlists from category {category.name} ({category_index + 1}/{len(categories)})') - #category.download_metadata(scraper=scraper) + category.download_metadata(scraper=scraper) try: thread = Thread(target=download_category_playlists, args=(category.spotify_id, category_index, categories, download_meta_data_only)) thread.start() threads.append(thread) - #download_category_playlists(category_id, category_index=category_index, category_ids=category_ids, download_meta_data_only=download_meta_data_only) except Exception as ex: console.error(f'Scraping categories exception: {ex}') From d4d4c4815098712d2cb4d5f9bae489a7ac11dc76 Mon Sep 17 00:00:00 2001 From: Michael Kuperfish Steinberg <36902556+Michael-K-Stein@users.noreply.github.com> Date: Fri, 20 Jan 2023 14:27:21 +0200 Subject: [PATCH 2/3] Fix typos --- auto_compressor.py | 2 +- templates/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_compressor.py b/auto_compressor.py index c3693fd..7e5906a 100644 --- a/auto_compressor.py +++ b/auto_compressor.py @@ -72,4 +72,4 @@ if __name__ == '__main__': if len(sys.argv) == 1: zip_bunches() else: - zip_bunches(sys.argv[1]) \ No newline at end of file + zip_bunches(sys.argv[1]) diff --git a/templates/index.html b/templates/index.html index 171da3a..bed0de3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,7 +5,7 @@ - Spotifile + SpotiFile