From 815bd3c0cf692b8764a25dd66e99f5adbf87c648 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Wed, 7 May 2025 19:56:28 +0300 Subject: [PATCH] improved menubar --- README.md | 1 + app/library/HttpAPI.py | 1 + app/library/conditions.py | 3 + ui/components/ConditionForm.vue | 245 ++++++ ui/layouts/default.vue | 156 ++-- ui/package.json | 4 +- ui/pages/conditions.vue | 289 +++++++ ui/pages/index.vue | 21 +- ui/pages/presets.vue | 2 +- ui/yarn.lock | 1381 ++++++++++++++++--------------- 10 files changed, 1328 insertions(+), 775 deletions(-) create mode 100644 ui/components/ConditionForm.vue create mode 100644 ui/pages/conditions.vue diff --git a/README.md b/README.md index 4feb0a37..1f9fad2f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Web GUI for [yt-dlp](https://github.com/yt-dlp/yt-dlp) with playlist & channel s * Support for both advanced and basic mode for WebUI. * Bundled tools in container: curl-cffi, ffmpeg, ffprobe, aria2, rtmpdump, mkvtoolsnix, mp4box. * Automatic upcoming live stream re-queue. +* Apply `yt-dlp` options per custom defined conditions. # Run using docker command diff --git a/app/library/HttpAPI.py b/app/library/HttpAPI.py index 9c412ce6..b7a60fac 100644 --- a/app/library/HttpAPI.py +++ b/app/library/HttpAPI.py @@ -78,6 +78,7 @@ class HttpAPI(Common): "/notifications", "/changelog", "/logs", + "/conditions", "/browser", "/browser/{path:.*}", ] diff --git a/app/library/conditions.py b/app/library/conditions.py index 70cb2de3..b91beba1 100644 --- a/app/library/conditions.py +++ b/app/library/conditions.py @@ -297,6 +297,9 @@ class Conditions(metaclass=Singleton): Condition|None: The condition if found, None otherwise. """ + if len(self._items) < 1 or not info or not isinstance(info, dict) or len(info) < 1: + return None + from yt_dlp.utils import match_str for item in self.get_all(): diff --git a/ui/components/ConditionForm.vue b/ui/components/ConditionForm.vue new file mode 100644 index 00000000..efe4be7e --- /dev/null +++ b/ui/components/ConditionForm.vue @@ -0,0 +1,245 @@ +