kopia lustrzana https://github.com/Michael-K-Stein/SpotiFile
Remove unused settings
rodzic
d54485d025
commit
e0241a9662
|
@ -50,7 +50,7 @@ class Console:
|
|||
console = Console()
|
||||
|
||||
|
||||
def download_track_list(download_dir: str, track_list: Generator[SpotifyTrack, None, None], recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False, recursive_limit=1024):
|
||||
def download_track_list(download_dir: str, track_list: Generator[SpotifyTrack, None, None], recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False):
|
||||
global g_downloaded_songs, g_downloaded_artist_covers
|
||||
my_thread_id = str(get_ident()).zfill(6)
|
||||
artist_images_download_dir = f'{download_dir}/{settings.ARTIST_IMAGES_SUB_DIR}'
|
||||
|
@ -117,7 +117,7 @@ def save_globals_save_file():
|
|||
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):
|
||||
def full_download(download_dir: str, identifier: str, recursive_artist: bool=False, recursive_album: bool=False, recursive: bool=False):
|
||||
global g_downloaded_songs, g_downloaded_artist_covers, g_keep_saving
|
||||
try:
|
||||
artist_images_download_dir = f'{download_dir}/{settings.ARTIST_IMAGES_SUB_DIR}'
|
||||
|
@ -127,8 +127,8 @@ def full_download(download_dir: str, identifier: str, recursive_artist: bool=Fal
|
|||
g_keep_saving += 1
|
||||
|
||||
client.refresh_tokens()
|
||||
console.log(f'Recieved scrape command on identifier: {identifier}, {recursive=}, {recursive_artist=}, {recursive_album=}, {recursive_limit=}, {thread_count=}')
|
||||
download_track_list(download_dir=download_dir, track_list=scraper.scrape_tracks(identifier, console=console), recursive=recursive, recursive_album=recursive_album, recursive_artist=recursive_artist, recursive_limit=recursive_limit)
|
||||
console.log(f'Recieved scrape command on identifier: {identifier}, {recursive=}, {recursive_artist=}, {recursive_album=}')
|
||||
download_track_list(download_dir=download_dir, track_list=scraper.scrape_tracks(identifier, console=console), recursive=recursive, recursive_album=recursive_album, recursive_artist=recursive_artist)
|
||||
|
||||
console.log(f'Comletely done scraping identifier: {identifier}!')
|
||||
|
||||
|
|
|
@ -50,8 +50,6 @@
|
|||
<div class="single-line"><label>Recursive: </label><input type="checkbox" name="recursive"></div>
|
||||
<div class="single-line"><label>Recusive Album: </label><input type="checkbox" name="recursive-album"></div>
|
||||
<div class="single-line"><label>Recusive Artist: </label><input type="checkbox" name="recursive-artist"></div>
|
||||
<div class="single-line"><label>Recursive Limit: </label><input type="number" name="recursive-limit" value="1024"></div>
|
||||
<div class="single-line"><label>Thread Limit: </label><input type="number" name="thread-count" value="5"></div>
|
||||
</div></div>
|
||||
</form>
|
||||
<form id="category-download-form" action="/actions/download/categories" method="POST" target="dummy-frame">
|
||||
|
|
|
@ -19,12 +19,10 @@ def actions_download():
|
|||
recursive = request.form.get('recursive') or False
|
||||
recursive_artist = request.form.get('recursive-artist') or False
|
||||
recursive_album = request.form.get('recursive-album') or False
|
||||
recursive_limit = min(int(request.form.get('recursive-limit')) or 1024, settings.FULL_DOWNLOAD_RECURISVE_LIMIT)
|
||||
thread_count = min(int(request.form.get('thread-count')) or 5, settings.FULL_DOWNLOAD_THREAD_LIMIT)
|
||||
recursive = True if recursive == 'on' else False
|
||||
recursive_album = True if recursive_album == 'on' else False
|
||||
recursive_artist = True if recursive_artist == 'on' else False
|
||||
full_download(settings.DEFAULT_DOWNLOAD_DIRECTORY, spotify_url, recursive=recursive, recursive_artist=recursive_artist, recursive_album=recursive_album, recursive_limit=recursive_limit, thread_count=thread_count)
|
||||
full_download(settings.DEFAULT_DOWNLOAD_DIRECTORY, spotify_url, recursive=recursive, recursive_artist=recursive_artist, recursive_album=recursive_album)
|
||||
return 'success'
|
||||
except Exception as ex:
|
||||
return str(ex)
|
||||
|
|
Ładowanie…
Reference in New Issue