diff --git a/README.md b/README.md index 26dbd2a0..becf113f 100644 --- a/README.md +++ b/README.md @@ -43,13 +43,12 @@ Your `yt-dlp` config should include the following options for optimal working co ## Run using Docker ```bash -docker run -d --name ytptube -p 8081:8081 -v ./config:/config:rw -v ./downloads:/downloads:rw ghcr.io/arabcoders/ytptube +docker run -d --rm --name ytptube -p 8081:8081 -v ./config:/config:rw -v ./downloads:/downloads:rw ghcr.io/arabcoders/ytptube ``` -## Run using docker-compose +## Run using compose file. ```yaml -version: "3.9" services: ytptube: user: "1000:1000" @@ -67,7 +66,7 @@ services: ## Configuration via environment variables -Certain values can be set via environment variables, using the `-e` parameter on the docker command line, or the `environment:` section in docker-compose. +Certain values can be set via environment variables, using the `-e` parameter on the docker command line, or the `environment:` section in `compose.yaml` file. * __YTP_CONFIG_PATH__: path to where the queue persistence files will be saved. Defaults to `/config` in the docker image, and `./var/config` otherwise. * __YTP_DOWNLOAD_PATH__: path to where the downloads will be saved. Defaults to `/downloads` in the docker image, and `./var/downloads` otherwise. @@ -99,7 +98,8 @@ Certain values can be set via environment variables, using the `-e` parameter on * __YTP_PIP_IGNORE_UPDATES__: Do not update the custom pip packages. Defaults to `false`. * __YTP_BASIC_MODE__: Whether to run WebUI in basic mode. Defaults to `false`. In basic mode, A minimal UI will be shown, the majority of the features will be disabled. * __YTP_DEFAULT_PRESET__: The default preset to use for the download. Defaults to `default`. - +* __YTP_INSTANCE_TITLE__: The title of the instance. Defaults to empty string. + ## Running behind a reverse proxy It's advisable to run YTPTube behind a reverse proxy, if authentication and/or HTTPS support are required. @@ -237,6 +237,11 @@ The `config/ytdlp.json`, is a json file which can be used to alter the default ` ] } ``` +The options can be fount at [yt-dlp YoutubeDL.py](https://github.com/yt-dlp/yt-dlp/blob/master/yt_dlp/YoutubeDL.py#L214) file. +And for the postprocessors at [yt-dlp postprocessor](https://github.com/yt-dlp/yt-dlp/tree/master/yt_dlp/postprocessor). + +> [!NOTE] +> You can use the `yt-dlp json config` box in the new Download page to convert your cli options to json format. ### presets.json File diff --git a/app/library/config.py b/app/library/config.py index 45e8b6e7..914f6ff9 100644 --- a/app/library/config.py +++ b/app/library/config.py @@ -136,6 +136,9 @@ class Config: default_preset: str = "default" "The default preset to use when no preset is specified." + instance_title: str | None = None + "The title of the instance." + _manual_vars: tuple = ( "temp_path", "config_path", @@ -191,6 +194,7 @@ class Config: "max_workers", "basic_mode", "default_preset", + "instance_title", ) "The variables that are relevant to the frontend." diff --git a/ui/components/NewDownload.vue b/ui/components/NewDownload.vue index 95716969..eb99257b 100644 --- a/ui/components/NewDownload.vue +++ b/ui/components/NewDownload.vue @@ -70,8 +70,9 @@ placeholder="Uses default output template naming if empty."> - All output template naming options can be found at this page. + + All output template naming options can be found at this page. @@ -80,33 +81,36 @@
- Some config fields are ignored like format cookiefile, paths, - and outtmpl etc. Available option can be found at - this page. Warning: Use with caution some of those options can break yt-dlp or the - frontend. + + Extends current global yt-dlp config with given options. Some fields are ignored like + format cookiefile, paths, and outtmpl etc. + Warning: Use with caution some of those options can break yt-dlp or the frontend.
- Use - flagCookies to extract cookies as JSON string. + + Use + flagCookies to extract cookies as JSON string.
@@ -157,25 +161,12 @@ const downloadPath = useStorage('downloadPath', null) const url = useStorage('downloadUrl', null) const showAdvanced = useStorage('show_advanced', false) const addInProgress = ref(false) +const convertInProgress = ref(false) const addDownload = async () => { // -- send request to convert cli options to JSON if (ytdlpConfig.value && !ytdlpConfig.value.trim().startsWith('{')) { - const response = await request('/api/yt-dlp/convert', { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ args: ytdlpConfig.value }), - }); - - const data = await response.json() - if (200 !== response.status) { - toast.error(`Error: (${response.status}): ${data.error}`) - return - } - - ytdlpConfig.value = JSON.stringify(data, null, 2) + await convertOptions() } if (ytdlpConfig.value) { @@ -242,6 +233,21 @@ const unlockDownload = async stream => { } } +const convertOptions = async () => { + if (convertInProgress.value) { + return + } + + try { + convertInProgress.value = true + ytdlpConfig.value = await convertCliOptions(ytdlpConfig.value) + } catch (e) { + toast.error(e.message) + } finally { + convertInProgress.value = false + } +} + onMounted(() => { socket.on('status', statusHandler) socket.on('error', unlockDownload) diff --git a/ui/components/TaskForm.vue b/ui/components/TaskForm.vue index 2395122e..dc70f794 100644 --- a/ui/components/TaskForm.vue +++ b/ui/components/TaskForm.vue @@ -127,7 +127,8 @@