From 8c3f8528ad87d196f4d5cde8fb99f63e4dc78abd Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sun, 24 Nov 2024 15:28:36 -0800 Subject: [PATCH] [BACKEND] More media quality presets + docs (#1127) Adds common media quality prebuilt presets and documentation on how to use them --- docs/source/prebuilt_presets/helpers.rst | 31 +---------------- docs/source/prebuilt_presets/index.rst | 29 +++++++++++++--- .../source/prebuilt_presets/media_quality.rst | 29 ++++++++++++++++ .../helpers/media_quality.yaml | 34 ++++++++++++++++++- 4 files changed, 88 insertions(+), 35 deletions(-) create mode 100644 docs/source/prebuilt_presets/media_quality.rst diff --git a/docs/source/prebuilt_presets/helpers.rst b/docs/source/prebuilt_presets/helpers.rst index a4b141c6e..7f70c243f 100644 --- a/docs/source/prebuilt_presets/helpers.rst +++ b/docs/source/prebuilt_presets/helpers.rst @@ -4,21 +4,7 @@ Helper Presets .. hint:: - Apply presets to your subscriptions using pipes: - - .. code-block:: yaml - :caption: Pipes can separate presets and values to apply them to all subscriptions below them. - - Plex TV Show by Date | best_video_quality: - - = Documentaries | chunk_initial_download: - "NOVA PBS": "https://www.youtube.com/@novapbs" - "National Geographic": "https://www.youtube.com/@NatGeo" - - = Documentaries: - "Cosmos - What If": "https://www.youtube.com/playlist?list=PLZdXRHYAVxTJno6oFF9nLGuwXNGYHmE8U" - -Common presets are not usable by themselves- setting one of these as the sole preset of your subscription and attempting to download will not work. But you can add these presets to quickly modify an existing preset to better suit your needs. + See how to apply helper presets :doc:`here ` Only Recent ----------- @@ -42,21 +28,6 @@ upload date is outside of the range, or you hit max files, older videos will be To prevent deletion of files, use the preset ``Only Recent Archive`` instead. -Best A/V Quality ----------------- - -Add the following preset to download the best available video and audio quality, and remux it into an MP4 container: - -``best_video_quality`` - - -Max 1080p Video ---------------- - -Add the following preset to download the best available audio and video quality, with the video not greater than 1080p, and remux it into an MP4 container: - -``max_1080p`` - Filter Keywords --------------- diff --git a/docs/source/prebuilt_presets/index.rst b/docs/source/prebuilt_presets/index.rst index 744428ce7..bb95ac0c9 100644 --- a/docs/source/prebuilt_presets/index.rst +++ b/docs/source/prebuilt_presets/index.rst @@ -3,13 +3,34 @@ Prebuilt Presets ================ ``ytdl-sub`` offers a number of built-in presets using best practices for formatting -media in various players. For advanced users, you can review the prebuilt preset +media in various players. + +.. hint:: + + Apply multiple presets to your subscriptions using pipes. Pipes can define multiple presets and values + on the same line to apply to all subscriptions nested below them. + + .. code-block:: yaml + :caption: Applies Max Video Quality preset to all TV shows, and Chunk Downloads preset to some + + Plex TV Show by Date | Max Video Quality: + + = Documentaries | Chunk Downloads: + "NOVA PBS": "https://www.youtube.com/@novapbs" + "National Geographic": "https://www.youtube.com/@NatGeo" + + = Documentaries: + "Cosmos - What If": "https://www.youtube.com/playlist?list=PLZdXRHYAVxTJno6oFF9nLGuwXNGYHmE8U" + + +For advanced users, you can review the prebuilt preset definitions :doc:`here `. .. toctree:: :titlesonly: - - helpers + tv_shows music - music_videos \ No newline at end of file + music_videos + media_quality + helpers \ No newline at end of file diff --git a/docs/source/prebuilt_presets/media_quality.rst b/docs/source/prebuilt_presets/media_quality.rst new file mode 100644 index 000000000..ceb92479b --- /dev/null +++ b/docs/source/prebuilt_presets/media_quality.rst @@ -0,0 +1,29 @@ +====================== +Media Quality Presets +====================== + +.. hint:: + + See how to apply media quality presets :doc:`here ` + +Video +----- +The following presets set video quality specifications to yt-dlp. + +- ``Max Video Quality`` +- ``Max 2160p`` +- ``Max 1440p`` +- ``Max 1080p`` +- ``Max 720p`` +- ``Max 480p`` + +Audio +----- +The following presets set audio quality specifications to yt-dlp. +These assume you are only extracting audio (no video). + +- ``Max Audio Quality``, format is determined by the source +- ``Max MP3 Quality`` +- ``Max Opus Quality`` +- ``MP3 320k`` +- ``MP3 128k`` diff --git a/src/ytdl_sub/prebuilt_presets/helpers/media_quality.yaml b/src/ytdl_sub/prebuilt_presets/helpers/media_quality.yaml index a4c35dc91..78b99ca4a 100644 --- a/src/ytdl_sub/prebuilt_presets/helpers/media_quality.yaml +++ b/src/ytdl_sub/prebuilt_presets/helpers/media_quality.yaml @@ -13,6 +13,10 @@ presets: preset: - best_video_quality + "Max Video Quality": + preset: + - best_video_quality + ############################################################################# # Max 2160p @@ -55,4 +59,32 @@ presets: "Max 480p": format: "(bv*[height<=480]+bestaudio/best[height<=480])" ytdl_options: - merge_output_format: "mp4" \ No newline at end of file + merge_output_format: "mp4" + + ############################################################################# + # Audio Quality Presets + + "Max Audio Quality": + audio_extract: + codec: "best" + quality: 0 + + "Max MP3 Quality": + audio_extract: + codec: "mp3" + quality: 0 + + "Max Opus Quality": + audio_extract: + codec: "opus" + quality: 0 + + "MP3 320k": + audio_extract: + codec: "mp3" + quality: 320 + + "MP3 128k": + audio_extract: + codec: "mp3" + quality: 128