mirror of
https://github.com/nathom/streamrip.git
synced 2025-06-03 00:30:07 -04:00
Add max_connections for concurrent downloads
This commit is contained in:
parent
aac254516f
commit
1e6c138e54
3 changed files with 13 additions and 3 deletions
|
@ -3,10 +3,16 @@
|
|||
folder = ""
|
||||
# Put Qobuz albums in a 'Qobuz' folder, Tidal albums in 'Tidal' etc.
|
||||
source_subdirectories = false
|
||||
|
||||
[downloads.concurrency]
|
||||
# Download (and convert) tracks all at once, instead of sequentially.
|
||||
# If you are converting the tracks, or have fast internet, this will
|
||||
# substantially improve processing speed.
|
||||
concurrent = false
|
||||
enabled = true
|
||||
# The maximum number of tracks to download at once
|
||||
# If you have very fast internet, you will benefit from a higher value,
|
||||
# A value that is too high for your bandwidth may cause slowdowns
|
||||
max_connections = 3
|
||||
|
||||
[qobuz]
|
||||
# 1: 320kbps MP3, 2: 16/44.1, 3: 24/<=96, 4: 24/>=96
|
||||
|
|
|
@ -218,6 +218,7 @@ class RipCore(list):
|
|||
artwork, conversion, filepaths = tuple(
|
||||
session[key] for key in ("artwork", "conversion", "filepaths")
|
||||
)
|
||||
concurrency = session["downloads"]["concurrency"]
|
||||
return {
|
||||
"parent_folder": session["downloads"]["folder"],
|
||||
"folder_format": filepaths["folder_format"],
|
||||
|
@ -228,7 +229,8 @@ class RipCore(list):
|
|||
"set_playlist_to_album": session["metadata"]["set_playlist_to_album"],
|
||||
"stay_temp": conversion["enabled"],
|
||||
"conversion": conversion,
|
||||
"concurrent_downloads": session["downloads"]["concurrent"],
|
||||
"concurrent_downloads": concurrency["enabled"],
|
||||
"max_connections": concurrency["max_connections"],
|
||||
"new_tracknumbers": session["metadata"]["new_playlist_tracknumbers"],
|
||||
"download_videos": session["tidal"]["download_videos"],
|
||||
"download_booklets": session["qobuz"]["download_booklets"],
|
||||
|
|
|
@ -1034,7 +1034,9 @@ class Tracklist(list):
|
|||
# TODO: make this function return the items that have not been downloaded
|
||||
failed_downloads: List[Tuple[str, str, str]] = []
|
||||
if kwargs.get("concurrent_downloads", True):
|
||||
with concurrent.futures.ThreadPoolExecutor(15) as executor:
|
||||
with concurrent.futures.ThreadPoolExecutor(
|
||||
kwargs.get("max_connections", 3)
|
||||
) as executor:
|
||||
future_map = {
|
||||
executor.submit(target, item, **kwargs): item for item in self
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue