From 04efb1c2121264763fde3fe2b95cff9aa6f965f1 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Fri, 7 Mar 2025 20:10:35 +0300 Subject: [PATCH 1/5] when video info fail to load raise error and close the modal --- ui/components/VideoPlayer.vue | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/ui/components/VideoPlayer.vue b/ui/components/VideoPlayer.vue index 4c668630..21e57b72 100644 --- a/ui/components/VideoPlayer.vue +++ b/ui/components/VideoPlayer.vue @@ -6,17 +6,23 @@ height: 100%; width: 100%; } + diff --git a/ui/pages/tasks.vue b/ui/pages/tasks.vue index 535e1a5f..e39507b7 100644 --- a/ui/pages/tasks.vue +++ b/ui/pages/tasks.vue @@ -71,21 +71,19 @@ div.is-centered {
-

+

- - {{ tryParse(item.timer) }} - {{ item.timer }} - + {{ tryParse(item.timer) }} - {{ item.timer }}

-

+

- {{ item.folder ? calcPath(item.folder) : config.app.download_path }} + {{ calcPath(item.folder) }}

-

+

- {{ item.template ? item.template : config.app.output_template }} + {{ item.template }}

-

+

{{ item.preset ?? config.app.default_preset }}

@@ -286,7 +284,7 @@ const calcPath = path => { } onMounted(async () => { - if (!socket.isConnected){ + if (!socket.isConnected) { return; } socket.on('status', statusHandler) diff --git a/ui/stores/ConfigStore.js b/ui/stores/ConfigStore.js index 2fde0e1d..6fe9523e 100644 --- a/ui/stores/ConfigStore.js +++ b/ui/stores/ConfigStore.js @@ -16,6 +16,7 @@ const CONFIG_KEYS = { default_preset: 'default', instance_title: null, sentry_dsn: null, + console_enabled: false, }, presets: [ { From 89684ac494677a09441b6c07830d7e45c515bde0 Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Fri, 7 Mar 2025 20:13:39 +0300 Subject: [PATCH 3/5] add the new variable to enable yt-dlp console access to README --- README.md | 1 + app/library/config.py | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 2ae6bd7d..1b48a99d 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Certain configuration values can be set via environment variables, using the `-e | 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 queue persistence files will be saved | `/config` | | YTP_TEMP_PATH | Path where intermediary download files will be saved | `/tmp` | diff --git a/app/library/config.py b/app/library/config.py index bea45fc9..b1a9c2b0 100644 --- a/app/library/config.py +++ b/app/library/config.py @@ -186,6 +186,7 @@ class Config: "pip_ignore_updates", "basic_mode", "file_logging", + "console_enabled", ) "The variables that are booleans." From f89e72666b7964c22073ecc5a2f57b2ad9089fcb Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Fri, 7 Mar 2025 20:16:19 +0300 Subject: [PATCH 4/5] make to possible to specify the preset when adding via /api/history/add --- app/library/HttpAPI.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/library/HttpAPI.py b/app/library/HttpAPI.py index fb77f979..67535b8c 100644 --- a/app/library/HttpAPI.py +++ b/app/library/HttpAPI.py @@ -608,8 +608,21 @@ class HttpAPI(Common): if not url: return web.json_response(data={"error": "url param is required."}, status=web.HTTPBadRequest.status_code) + data = { + "url": url, + } + + preset = request.query.get("preset") + if preset: + exists = Presets.get_instance().get(preset) + if not exists: + return web.json_response( + data={"error": f"Preset '{preset}' does not exist."}, status=web.HTTPBadRequest.status_code + ) + data["preset"] = preset + try: - status = await self.add(**self.format_item({"url": url})) + status = await self.add(**self.format_item(data)) except ValueError as e: return web.json_response(data={"error": str(e)}, status=web.HTTPBadRequest.status_code) From 64c84e5c3a3db4a2b0bb716bb62107f3e5f5d31e Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Fri, 7 Mar 2025 20:40:31 +0300 Subject: [PATCH 5/5] Make it possible to embed content if the content is being downloaded or yet to complete. --- ui/components/EmbedPlayer.vue | 30 +++++++++++++++ ui/components/History.vue | 16 ++++++++ ui/components/Queue.vue | 27 +++++++++++--- ui/utils/embedable.js | 69 +++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 5 deletions(-) create mode 100644 ui/components/EmbedPlayer.vue create mode 100644 ui/utils/embedable.js diff --git a/ui/components/EmbedPlayer.vue b/ui/components/EmbedPlayer.vue new file mode 100644 index 00000000..0b692a4e --- /dev/null +++ b/ui/components/EmbedPlayer.vue @@ -0,0 +1,30 @@ +