From aab690a82294aba855dc6f4e1290095f66afdc2c Mon Sep 17 00:00:00 2001 From: arabcoders Date: Wed, 3 Sep 2025 19:25:08 +0300 Subject: [PATCH] reflect preset options in tasks page. --- FAQ.md | 84 +++++++++++++++---------------- ui/app/components/NewDownload.vue | 20 -------- ui/app/components/TaskForm.vue | 70 ++++++++++++++------------ ui/app/pages/index.vue | 3 +- ui/app/pages/tasks.vue | 10 ++-- 5 files changed, 89 insertions(+), 98 deletions(-) diff --git a/FAQ.md b/FAQ.md index a5bbf97f..a5f5456f 100644 --- a/FAQ.md +++ b/FAQ.md @@ -3,48 +3,48 @@ Certain configuration values can be set via environment variables, using the `-e` parameter on the docker command line, or the `environment:` section in `compose.yaml` file. -| Environment Variable | Description | Default | -| ------------------------------ | ------------------------------------------------------------------ | ---------------------------------- | -| YTP_OUTPUT_TEMPLATE | The template for the filenames of the downloaded videos | `%(title)s.%(ext)s` | -| YTP_DEFAULT_PRESET | The default preset to use for the download | `default` | -| YTP_INSTANCE_TITLE | The title of the instance | `empty string` | -| YTP_FILE_LOGGING | Whether to log to file | `false` | -| YTP_DOWNLOAD_PATH | Path to where the downloads will be saved | `/downloads` | -| YTP_MAX_WORKERS | How many works to use for downloads | `1` | -| YTP_AUTH_USERNAME | Username for basic authentication | `empty string` | -| YTP_AUTH_PASSWORD | Password for basic authentication | `empty string` | -| YTP_CONSOLE_ENABLED | Whether to enable the console | `false` | -| YTP_REMOVE_FILES | Remove the actual file when clicking the remove button | `false` | -| YTP_CONFIG_PATH | Path to where the config files will be stored. | `/config` | -| YTP_TEMP_PATH | Path to where tmp files are stored. | `/tmp` | -| YTP_TEMP_KEEP | Whether to keep the Individual video temp directory or remove it | `false` | -| YTP_HOST | Which IP address to bind to | `0.0.0.0` | -| YTP_PORT | Which port to bind to | `8081` | -| YTP_LOG_LEVEL | Log level | `info` | -| YTP_STREAMER_VCODEC | The video codec to use for in-browser streaming | `libx264` | -| YTP_STREAMER_ACODEC | The audio codec to use for in-browser streaming | `aac` | -| YTP_ACCESS_LOG | Whether to log access to the web server | `true` | -| YTP_DEBUG | Whether to turn on debug mode | `false` | -| YTP_DEBUGPY_PORT | The port to use for the debugpy debugger | `5678` | -| YTP_EXTRACT_INFO_TIMEOUT | The timeout for extracting video information | `70` | -| YTP_DB_FILE | The path to the SQLite database file | `{config_path}/ytptube.db` | -| YTP_UI_UPDATE_TITLE | Whether to update the title of the page with the current stats | `true` | -| YTP_PIP_PACKAGES | A space separated list of pip packages to install | `empty string` | -| YTP_PIP_IGNORE_UPDATES | Do not update the custom pip packages | `false` | -| YTP_BASIC_MODE | Whether to run WebUI in basic mode | `false` | -| YTP_PICTURES_BACKENDS | A comma separated list of pictures urls to use | `empty string` | -| YTP_BROWSER_ENABLED | Whether to enable the file browser | `false` | -| YTP_BROWSER_CONTROL_ENABLED | Whether to enable the file browser actions | `false` | -| YTP_YTDLP_AUTO_UPDATE | Whether to enable the auto update for yt-dlp | `true` | -| YTP_YTDLP_DEBUG | Whether to turn debug logging for the internal `yt-dlp` package | `false` | -| YTP_YTDLP_VERSION | The version of yt-dlp to use. Defaults to latest version | `empty string` | -| YTP_BASE_PATH | Set this if you are serving YTPTube from sub-folder | `/` | -| YTP_PREVENT_LIVE_PREMIERE | Prevents the initial youtube premiere stream from being downloaded | `false` | -| YTP_TASKS_HANDLER_TIMER | The cron expression for the tasks handler timer | `15 */1 * * *` | -| YTP_PLAYLIST_ITEMS_CONCURRENCY | The number of playlist items be to processed at same time | `1` | -| YTP_TEMP_DISABLED | Disable temp files handling. | `false` | -| YTP_DOWNLOAD_PATH_DEPTH | How many subdirectories to show in auto complete. | `1` | - +| Environment Variable | Description | Default | +| ------------------------------ | ------------------------------------------------------------------ | -------------------------- | +| TZ | The timezone to use for the application | `(not_set)` | +| YTP_OUTPUT_TEMPLATE | The template for the filenames of the downloaded videos | `%(title)s.%(ext)s` | +| YTP_DEFAULT_PRESET | The default preset to use for the download | `default` | +| YTP_INSTANCE_TITLE | The title of the instance | `empty string` | +| YTP_FILE_LOGGING | Whether to log to file | `false` | +| YTP_DOWNLOAD_PATH | Path to where the downloads will be saved | `/downloads` | +| YTP_MAX_WORKERS | How many works to use for downloads | `1` | +| YTP_AUTH_USERNAME | Username for basic authentication | `empty string` | +| YTP_AUTH_PASSWORD | Password for basic authentication | `empty string` | +| YTP_CONSOLE_ENABLED | Whether to enable the console | `false` | +| YTP_REMOVE_FILES | Remove the actual file when clicking the remove button | `false` | +| YTP_CONFIG_PATH | Path to where the config files will be stored. | `/config` | +| YTP_TEMP_PATH | Path to where tmp files are stored. | `/tmp` | +| YTP_TEMP_KEEP | Whether to keep the Individual video temp directory or remove it | `false` | +| YTP_HOST | Which IP address to bind to | `0.0.0.0` | +| YTP_PORT | Which port to bind to | `8081` | +| YTP_LOG_LEVEL | Log level | `info` | +| YTP_STREAMER_VCODEC | The video codec to use for in-browser streaming | `libx264` | +| YTP_STREAMER_ACODEC | The audio codec to use for in-browser streaming | `aac` | +| YTP_ACCESS_LOG | Whether to log access to the web server | `true` | +| YTP_DEBUG | Whether to turn on debug mode | `false` | +| YTP_DEBUGPY_PORT | The port to use for the debugpy debugger | `5678` | +| YTP_EXTRACT_INFO_TIMEOUT | The timeout for extracting video information | `70` | +| YTP_DB_FILE | The path to the SQLite database file | `{config_path}/ytptube.db` | +| YTP_UI_UPDATE_TITLE | Whether to update the title of the page with the current stats | `true` | +| YTP_PIP_PACKAGES | A space separated list of pip packages to install | `empty string` | +| YTP_PIP_IGNORE_UPDATES | Do not update the custom pip packages | `false` | +| YTP_BASIC_MODE | Whether to run WebUI in basic mode | `false` | +| YTP_PICTURES_BACKENDS | A comma separated list of pictures urls to use | `empty string` | +| YTP_BROWSER_ENABLED | Whether to enable the file browser | `false` | +| YTP_BROWSER_CONTROL_ENABLED | Whether to enable the file browser actions | `false` | +| YTP_YTDLP_AUTO_UPDATE | Whether to enable the auto update for yt-dlp | `true` | +| YTP_YTDLP_DEBUG | Whether to turn debug logging for the internal `yt-dlp` package | `false` | +| YTP_YTDLP_VERSION | The version of yt-dlp to use. Defaults to latest version | `empty string` | +| YTP_BASE_PATH | Set this if you are serving YTPTube from sub-folder | `/` | +| YTP_PREVENT_LIVE_PREMIERE | Prevents the initial youtube premiere stream from being downloaded | `false` | +| YTP_TASKS_HANDLER_TIMER | The cron expression for the tasks handler timer | `15 */1 * * *` | +| YTP_PLAYLIST_ITEMS_CONCURRENCY | The number of playlist items be to processed at same time | `1` | +| YTP_TEMP_DISABLED | Disable temp files handling. | `false` | +| YTP_DOWNLOAD_PATH_DEPTH | How many subdirectories to show in auto complete. | `1` | # Browser extensions & bookmarklets diff --git a/ui/app/components/NewDownload.vue b/ui/app/components/NewDownload.vue index e9d5d019..d15be8ca 100644 --- a/ui/app/components/NewDownload.vue +++ b/ui/app/components/NewDownload.vue @@ -484,26 +484,6 @@ const filter_presets = (flag: boolean = true) => config.presets.filter(item => i const get_preset = (name: string | undefined) => config.presets.find(item => item.name === name) const expand_description = (e: Event) => toggleClass(e.target as HTMLElement, ['is-ellipsis', 'is-pre-wrap']) -const get_output_template = () => { - if (form.value.preset && !hasFormatInConfig.value) { - const preset = config.presets.find(p => p.name === form.value.preset) - if (preset && preset.template) { - return preset.template - } - } - return config.app.output_template || '%(title)s.%(ext)s' -} - -const get_download_folder = (): string => { - if (form.value.preset && false === hasFormatInConfig.value) { - const preset = config.presets.find(p => p.name === form.value.preset) - if (preset?.folder) { - return preset.folder.replace(config.app.download_path, '') - } - } - return '/' -} - const getDefault = (type: 'cookies' | 'cli' | 'template' | 'folder', ret: string = '') => { if (false !== hasFormatInConfig.value || !form.value.preset) { return ret diff --git a/ui/app/components/TaskForm.vue b/ui/app/components/TaskForm.vue index 96308e3b..7911753f 100644 --- a/ui/app/components/TaskForm.vue +++ b/ui/app/components/TaskForm.vue @@ -160,13 +160,13 @@ Save in
-
- Current download folder: {{ get_download_folder() }}. All folders - are sub-folders of {{ config.app.download_path }}. + All folders are sub-folders of + {{ config.app.download_path }}. @@ -179,11 +179,12 @@
+ :placeholder="getDefault('template', config.app.output_template || '%(title)s.%(ext)s')" + v-model="form.template">
- Current output format: {{ get_output_template() }}. + The template to use for the output file name. @@ -237,7 +238,7 @@ Command options for yt-dlp + :placeholder="getDefault('cli', '')" :disabled="addInProgress" /> @@ -282,10 +283,8 @@
  • RSS monitoring runs every hour alongside the actual task execution. Regardless if the task has timer set or not. To opt out of RSS monitoring for a specific task, simply disable the Enable Handler option. To have the task only monitor RSS feed, do not set timer.
  • -
  • RSS Feed monitoring will only work if you have --download-archive set in command options - for ytdlp.cli, preset or task. If you don't have --download-archive set but - YTP_KEEP_ARCHIVE environment option is set to true which is the default, It will - also work. +
  • RSS Feed monitoring will only work if you have --download-archive set in Command options + for yt-dlp via the task itself, or preset. command options
  • @@ -463,26 +462,6 @@ const hasFormatInConfig = computed(() => !!form.cli && /(? config.presets.filter(item => item.default === flag) -const get_download_folder = (): string => { - if (form.preset && false === hasFormatInConfig.value) { - const preset = config.presets.find(p => p.name === form.preset) - if (preset?.folder) { - return preset.folder.replace(config.app.download_path, '') - } - } - return '/' -} - -const get_output_template = (): string => { - if (form.preset && false === hasFormatInConfig.value) { - const preset = config.presets.find(p => p.name === form.preset) - if (preset?.template) { - return preset.template - } - } - return config.app.output_template || '%(title)s.%(ext)s' -} - const is_yt_handle = (url: string): boolean => { if (!url || '' === url) { return false @@ -513,7 +492,6 @@ const convert_url = async (url: string): Promise => { const resp = await request('/api/yt-dlp/url/info?' + params.toString()) const body = await resp.json() const channel_id = ag(body, 'channel_id', null) - console.log('convert_url', { url, channel_id, body }) if (channel_id) { return url.replace(`/@${m.groups.handle}`, `/channel/${channel_id}`) @@ -528,4 +506,34 @@ const convert_url = async (url: string): Promise => { return url } +const getDefault = (type: 'cookies' | 'cli' | 'template' | 'folder', ret: string = '') => { + if (false !== hasFormatInConfig.value || !form.preset) { + return ret + } + + const preset = config.presets.find(p => p.name === form.preset) + + if (!preset) { + return ret + } + + if (type === 'cookies' && preset.cookies) { + return preset.cookies + } + + if (type === 'cli' && preset.cli) { + return preset.cli + } + + if (type === 'template' && preset.template) { + return preset.template + } + + if (type === 'folder' && preset.folder) { + return preset.folder.replace(config.app.download_path, '') || ret + } + + return ret +} + diff --git a/ui/app/pages/index.vue b/ui/app/pages/index.vue index dea27146..5b796796 100644 --- a/ui/app/pages/index.vue +++ b/ui/app/pages/index.vue @@ -67,7 +67,8 @@

    - The following environment variables and features are deprecated and will be removed in future releases: + The following environment variables and features are deprecated and will be removed in + v0.10.x

    • diff --git a/ui/app/pages/tasks.vue b/ui/app/pages/tasks.vue index bcc4bdf6..879d51e7 100644 --- a/ui/app/pages/tasks.vue +++ b/ui/app/pages/tasks.vue @@ -55,7 +55,8 @@
      - The task runner is simple queue system that allows you to schedule downloads to run at the specific time. + The task runner is simple queue system that allows you to poll channels or playlists for new content at + specified intervals.
      @@ -361,9 +362,10 @@
        -
      • If you are adding a big channel or playlist and you want to skip all old videos, please click on - Actions > Archive All button to mark all videos as downloaded. otherwise, it will try to - download all videos. +
      • + If you don't wish to download ALL content from a channel or playlist, click on + Actions > Archive All to archive all existing content.