diff --git a/README.md b/README.md index de5bbd6..edc49a3 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,15 @@ Certain values can be set via environment variables, using the `-e` parameter on * __YTDL_OPTIONS__: Additional options to pass to youtube-dl, in JSON format. [See available options here](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L183). They roughly correspond to command-line options, though some do not have exact equivalents here, for example `--recode-video` has to be specified via `postprocessors`. Also note that dashes are replaced with underscores. * __YTDL_OPTIONS_FILE__: A path to a JSON file that will be loaded and used for populating `YTDL_OPTIONS` above. Please note that if both `YTDL_OPTIONS_FILE` and `YTDL_OPTIONS` are specified, the options in `YTDL_OPTIONS` take precedence. * __ROBOTS_TXT__: A path to a `robots.txt` file mounted in the container -* __DOWNLOAD_MODE__ :This flag controls how downloads are scheduled and executed. There are three possible values: - * **sequential**: Downloads are processed one at a time. A new download won’t start until the previous one has finished. This mode is useful for conserving system resources or ensuring downloads occur in a strict order. - * **concurrent**: Downloads are started immediately as they are added, with no built-in limit on how many run simultaneously. This mode may overwhelm your system if too many downloads start at once. - * **limited**: Downloads are started concurrently but are capped by a concurrency limit. In this mode, a semaphore is used so that at most a fixed number of downloads run at any given time. -* **MAX\_CONCURRENT\_DOWNLOADS** - This flag is used only when **DOWNLOAD\_MODE** is set to **limited**. It specifies the maximum number of simultaneous downloads allowed. For example, if set to `3`, then at most three downloads will run concurrently, and any additional downloads will wait until one of the active downloads completes. +* __DOWNLOAD_MODE__ :This flag controls how downloads are scheduled and executed. Options are `sequential`, `concurrent`, and `limited`. Defaults to `limited`: + * `sequential`: Downloads are processed one at a time. A new download won’t start until the previous one has finished. This mode is useful for conserving system resources or ensuring downloads occur in a strict order. + * `concurrent`: Downloads are started immediately as they are added, with no built-in limit on how many run simultaneously. This mode may overwhelm your system if too many downloads start at once. + * `limited`: Downloads are started concurrently but are capped by a concurrency limit. In this mode, a semaphore is used so that at most a fixed number of downloads run at any given time. +* **MAX\_CONCURRENT\_DOWNLOADS** This flag is used only when **DOWNLOAD\_MODE** is set to **limited**. + It specifies the maximum number of simultaneous downloads allowed. For example, if set to `5`, then at most five downloads will run concurrently, and any additional downloads will wait until one of the active downloads completes. Defaults to `3`. + + +The following example value for `YTDL_OPTIONS` embeds English subtitles and chapter markers (for videos that have them), and also changes the permissions on the downloaded video and sets the file modification timestamp to the date of when it was downloaded: ```yaml environment: diff --git a/app/main.py b/app/main.py index 0b7554a..8fe463a 100644 --- a/app/main.py +++ b/app/main.py @@ -43,8 +43,8 @@ class Config: 'KEYFILE': '', 'BASE_DIR': '', 'DEFAULT_THEME': 'auto', - 'DOWNLOAD_MODE': 'limited', # Can be 'sequential', 'concurrent', or 'limited' - 'MAX_CONCURRENT_DOWNLOADS': 3, # Used if DOWNLOAD_MODE is 'limited' + 'DOWNLOAD_MODE': 'limited', + 'MAX_CONCURRENT_DOWNLOADS': 3, } _BOOLEAN = ('DOWNLOAD_DIRS_INDEXABLE', 'CUSTOM_DIRS', 'CREATE_CUSTOM_DIRS', 'DELETE_FILE_ON_TRASHCAN', 'DEFAULT_OPTION_PLAYLIST_STRICT_MODE', 'HTTPS') @@ -184,7 +184,7 @@ async def history(request): history['queue'].append(v) for _, v in dqueue.done.saved_items(): history['done'].append(v) - for _ ,v in dqueue.pending.saved_items(): + for _, v in dqueue.pending.saved_items(): history['pending'].append(v) log.info("Sending download history") diff --git a/app/ytdl.py b/app/ytdl.py index 0000455..b8fd72e 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -380,10 +380,7 @@ class DownloadQueue: if auto_start is True: download = Download(dldirectory, self.config.TEMP_DIR, output, output_chapter, quality, format, ytdl_options, dl) self.queue.put(download) - if self.config.DOWNLOAD_MODE == 'sequential': - asyncio.create_task(self.__start_download(download)) - else: - asyncio.create_task(self.__start_download(download)) + asyncio.create_task(self.__start_download(download)) else: self.pending.put(Download(dldirectory, self.config.TEMP_DIR, output, output_chapter, quality, format, ytdl_options, dl)) await self.notifier.added(dl) diff --git a/ui/src/app/app.component.html b/ui/src/app/app.component.html index 7762a70..de2c750 100644 --- a/ui/src/app/app.component.html +++ b/ui/src/app/app.component.html @@ -75,7 +75,7 @@ -
+
+
+ + + +
-
- - - - - - -