Skip to content

Commit

Permalink
[BACKEND] More media quality presets + docs (#1127)
Browse files Browse the repository at this point in the history
Adds common media quality prebuilt presets and documentation on how to use them
  • Loading branch information
jmbannon authored Nov 24, 2024
1 parent a634197 commit 8c3f852
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 35 deletions.
31 changes: 1 addition & 30 deletions docs/source/prebuilt_presets/helpers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 </prebuilt_presets/index>`

Only Recent
-----------
Expand All @@ -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
---------------

Expand Down
29 changes: 25 additions & 4 deletions docs/source/prebuilt_presets/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 </config_reference/prebuilt_presets/index>`.

.. toctree::
:titlesonly:

helpers

tv_shows
music
music_videos
music_videos
media_quality
helpers
29 changes: 29 additions & 0 deletions docs/source/prebuilt_presets/media_quality.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
======================
Media Quality Presets
======================

.. hint::

See how to apply media quality presets :doc:`here </prebuilt_presets/index>`

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``
34 changes: 33 additions & 1 deletion src/ytdl_sub/prebuilt_presets/helpers/media_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ presets:
preset:
- best_video_quality

"Max Video Quality":
preset:
- best_video_quality

#############################################################################
# Max 2160p

Expand Down Expand Up @@ -55,4 +59,32 @@ presets:
"Max 480p":
format: "(bv*[height<=480]+bestaudio/best[height<=480])"
ytdl_options:
merge_output_format: "mp4"
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

0 comments on commit 8c3f852

Please sign in to comment.