Commit graph

95 commits

Author SHA1 Message Date
Jesse Bannon
1156e0070a
[DEV] Make inspect resolution more human readable (#1451)
Removes a lot of the boilerplate output around `concat` and `sanitize`.
2026-03-13 16:27:56 -07:00
Jesse Bannon
c163f9766a
[BACKEND] Configurable resolution level when validating variables (#1415)
Expands variable validation to also include support for partial resolution.

In short, this will partially execute script code until it hits unresolved runtime variables, and store that as the new script representation. This functionality will allow for the upcoming `inspect` command, which will show users their script code in action without having to dry-run.
2026-02-02 09:50:52 -08:00
Jesse Bannon
d6eda27371
[BACKEND] Less string casting behind the scenes (#1425)
Simplifies internal scripts by not casting things to String when unnecessary.
2026-01-27 10:15:32 -08:00
Jesse Bannon
97df4dac1d
[BACKEND] Preserve dict formatter value (#1416)
Do not modify the original definition of dict validators.
2026-01-16 13:51:33 -08:00
Jesse Bannon
942c983f60
[BACKEND] Sorted video tags (#1417)
For reproducibility in tests.
2026-01-16 13:42:22 -08:00
Jesse Bannon
530d2f7666
[BACKEND] Partial resolve support for Scripts (#1410)
Adds the mechanism to partially resolve an entire script (aka every underlying variable in ytdl-sub). This will be used in the upcoming `inspect` sub-command where it will dump a subscription's raw contents at multiple levels of resolution.

Potentially useful to optimize script execution as well.
2026-01-12 17:34:34 -08:00
Jesse Bannon
00e9ceaf3d
[FEATURE] Filter Duration prebuilt preset (#1259)
Adds the prebuilt preset ``Filter Duration``, which can include/exclude media based on its duration.

Supports the following override variables:

* ``filter_duration_min_s``
* ``filter_duration_max_s``

Usage:

```
      Plex TV Show by Date | Filter Duration:

        = Documentaries:
          "~NOVA PBS":
            url: "https://www.youtube.com/@novapbs"
            filter_duration_min_s: 120  # Only download videos at least 2m long

        = Sports:
          "~Maple Leafs Highlights":
            url: "https://www.youtube.com/@NHL"
            filter_duration_max_s: 180  # Only get highlight videos less than 3m long
```
2025-07-04 13:41:54 -07:00
Jesse Bannon
fc2da4d525
[FEATURE] square_thumbnail plugin (#1244)
Adds the ability to make thumbnails square, both file and embedded. Usage:

```
my_preset:
  square_thumbnail: True
```

Will soon enable this by default for all music-based presets with a toggle to disable.
Huge thanks to @Kentaro1043 for crafting the ffmpeg command for this!

Closes https://github.com/jmbannon/ytdl-sub/issues/383
2025-06-18 22:37:06 -07:00
Jesse Bannon
a68d5e4539
[FEATURE] Emby prebuilt presets (#1232)
Gives Emby first class support by creating prebuilt presets for each variant, including
- `Emby TV Show by Date`
- `Emby TV Show Collection`
- `Emby Music Videos`

Emby is identical to Jellyfin except in TV Show Collection, where it requires a `season.nfo`. A new plugin `StaticNfoTags` has been created to create those.

Huge thanks to @Kamaroth92 for the initial code for this feature!
2025-06-01 09:56:48 -07:00
Jesse Bannon
36e23839f3
[FEATURE] Ability to change season and episode ordering via variables, support for release_date (#1220)
Adds the ability to change season and episode ordering using override variables, like so:

```
       "~Kids Toys Play":
          url: "https://www.youtube.com/@KidsToysPlayChannel"
          tv_show_by_date_season_ordering: "upload-year-month"
          tv_show_by_date_episode_ordering: "upload-day"
```

In addition, adds support for release-date based episode ordering (and culling if using Only Recent).
More info here: https://ytdl-sub.readthedocs.io/en/latest/prebuilt_presets/tv_shows.html

Closes https://github.com/jmbannon/ytdl-sub/issues/1182
2025-05-31 10:26:42 -07:00
Jesse Bannon
1264f0c656
[DOCKER] Update Ubuntu-based images (#1185)
- Update Ubuntu-based images to use Python 3.12
- Move hidden files from GUI image's main dir
- Update github workflows to use python 3.12
- Update fixtures
- Minor doc fixes
2025-03-15 21:58:51 -07:00
Jesse Bannon
e5451395e0
[DEV] Helper test to reproduce from user logs easier (#1102) 2024-11-03 20:44:02 -08:00
Jesse Bannon
663fb76132
[FEATURE] Multi-url support for YouTube music presets (#1113)
Adds support to specify multiple URLs for the YouTube-based music presets. More info here: https://ytdl-sub.readthedocs.io/en/latest/prebuilt_presets/music.html
2024-10-30 17:46:42 -07:00
Jesse Bannon
0006c0ea94
[DEV] Disable YouTube tests in GH CLI (#1090) 2024-10-07 23:46:27 -07:00
Jesse Bannon
28c29683cb
[FEATURE] Filter Keywords prebuilt preset (#1086)
Adds ``Filter Keywords``, a preset that can include or exclude media with any of the listed keywords. Both keywords and title/description are lower-cased before filtering.

Supports the following override variables:

* ``title_include_keywords``
* ``title_exclude_keywords``
* ``description_include_keywords``
* ``description_exclude_keywords``

For best usage, use the `~` tilda subscription mode to set a subscription's list override variables.
Tilda mode allows override variables to be set directly underneath it.

```
Plex TV Show by Date | Filter Keywords:
  
  = Documentaries:
    "~NOVA PBS":
       url: "https://www.youtube.com/@novapbs"
       title_exclude_keywords:
         - "preview"
         - "trailer"  

    "~To Catch a Smuggler":
       url: "https://www.youtube.com/@NatGeo"
       title_include_keywords:
         - "To Catch a Smuggler"
```
2024-10-05 01:03:52 -07:00
Jesse Bannon
084761fc61
[DEV] Unit test chapters (#1083) 2024-10-03 21:42:19 -07:00
Jesse Bannon
c0ba30b220
[DEV] More OutputOption unit tests (#1082) 2024-10-02 21:37:54 -07:00
Jesse Bannon
ed4a2814b9
[DEV] Remove old prebuilt fixtures (#1081) 2024-10-01 08:21:27 -07:00
Jesse Bannon
648201ed9c
[DEV] OutputOptions unit tests (#1078) 2024-09-30 23:18:33 -07:00
Jesse Bannon
481ced34c5
[DEV] Custom ffmpeg unit test (#1076) 2024-09-30 22:04:52 -07:00
Jesse Bannon
fd5882051a
[DEV] Unit test filter plugin (#1066) 2024-09-26 11:54:15 -07:00
Jesse Bannon
f963125398
[DEV] Unit test NFO tags (#1064) 2024-09-25 23:23:16 -07:00
Jesse Bannon
5e9472986a
[FEATURE] Enhance music video presets using specialized map syntax (#808)
Enhances the music video presets by supporting the following syntax:

`subscriptions.yaml`
```
__preset__:
  overrides:
    music_video_directory: "/music_videos"

# Choose between Jellyfin/Kodi/Plex Music Videos preset:
#   - Plex Music Videos:
#   - Jellyfin Music Videos:
#   - Kodi Music Videos:
#
"Plex Music Videos":

  = Pop:  # Sets genre tag to "Pop"
    "Rick Astley": "https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"
    "Michael Jackson": "https://www.youtube.com/playlist?list=OLAK5uy_mnY03zP6abNWH929q2XhGzWD_2uKJ_n8E"

  = Rock:
    # Prefixing with '+' puts the subscription into 'map-mode'.
    # Music video presets in map-mode support grouping videos into different
    # categories, which get set on the album field.
    #
    # URLs can either be strings, or maps that can overload title, year, date
    "+ Guns N' Roses":
      Music Videos:
        - "https://www.youtube.com/playlist?list=PLOTK54q5K4INNXaHKtmXYr6J7CajWjqeJ"
      Concerts:
        - title: "Live at The Ritz - New York City"
          year: "1988"
          url: "https://www.youtube.com/watch?v=OldpIhHPsbs"
        - title: "Live at The Hollywood Bowl"
          date: "2023-01-11"
          url: "https://www.youtube.com/watch?v=Z7hutGlvq9I"
```
The 'map-mode' (denoted by `+`) lets you specify a map of music video categories. Under each category, a URL can be specified as-is or with additional metadata (title, year/date, url).

Music videos and concerts, especially older ones, are typically uploaded by random users with inconsistencies in their titles. This syntax aims to make it easy to specify individual URLs with the ability to overwrite their title and year, and group them by category.
2024-06-06 11:50:33 -07:00
Jesse Bannon
6e31ad3600
[BACKEND] Include .info.json files for Music video presets (#996)
Music video presets now include .info.json files by default
2024-06-02 10:57:32 -07:00
Jesse Bannon
74625c293d
[DEV] Update fixtures (#995)
* [DEV] Update fixtures

* thumbs fixed, longer timeout

* ugh

* fanart
2024-06-02 00:05:44 -07:00
Jesse Bannon
5b34df4588
[DEV] Update fixtures (#970)
* [DEV] Update fixtures

* update yt-dlp

* fanart
2024-04-27 09:20:30 -07:00
Jesse Bannon
017db953bf
[FEATURE] Automatically handle playlists ordered in reverse (#948)
Playlists have always been a pain-point with ytdl-sub. If an author adds new videos to the end of a playlist, as opposed to the front, it breaks ytdl-sub's intuition of incremental scraping by breaking on the first (oldest) video. This update now makes it possible to handle this in the prebuilt TV Show presets:
- Add each URL variable (`url`, `url2`, ...) into the `download` portion of the subscription twice
- First definition is what we all know and use, simply scrapes first-to-last, then downloads last-to-first
- Second definition does the following:
  - Check to see if a URL is a YouTube playlist URL, if so...
    - Set the field to download, but with modifications to scrape last-to-first, then download first-to-last
  - Otherwise...
    - Set the field to an empty string, which means ytdl-sub will skip it
2024-04-01 04:24:41 -07:00
Jesse Bannon
083db0d9dc
[FEATURE] Simplify TV Show Collection Preset (#953)
Simplifies TV Show Collection presets, drastically. Old version:
```
  rick_a_tv_show_collection:
    preset:
      - "jellyfin_tv_show_collection"
      - "season_by_collection__episode_by_year_month_day_reversed"
      - "collection_season_1"
      - "collection_season_2"
    overrides:
      tv_show_name: "Rick A"
      collection_season_1_url: "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
      collection_season_1_name: "All Videos"
      collection_season_2_url: "https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"
      collection_season_2_name: "Official Music Videos"
```

New version:
```
  Jellyfin TV Show Collection:
    "~Rick A":
      s01_name: "All Videos"
      s01_url: "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
      s02_name: "Official Music Videos"
      s02_url: "https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc"
```
2024-03-30 22:04:45 -07:00
Jesse Bannon
82c503c515
[DEV] Update fixtures (#947)
* [DEV] Update fixtures

* bandcamp
2024-03-25 00:25:28 -07:00
Jesse Bannon
0beeeb464d
[FEATURE] Music tag dates (#938)
Adds proper support for setting `date` and `original_date` fields via `music_tag` plugin using a standardized date format.
2024-02-28 13:48:42 -08:00
Jesse Bannon
d2e733f2e7
[BACKEND] Only download audio when using audio_extract plugin (#902)
This addition optimizes the `audio_extract` plugin by preemptively telling yt-dlp to discard the video and only download the audio stream
2024-01-18 15:00:17 -08:00
Jesse Bannon
c0ca3c3945
[BACKEND] Remove old format for video_tags, music_tags, download_strategy (#899)
Now that sufficient time has passed, we can formally deprecate the following:
- https://ytdl-sub.readthedocs.io/en/latest/deprecation_notices.html#video-tags
- https://ytdl-sub.readthedocs.io/en/latest/deprecation_notices.html#music-tags
- usage of `download_strategy` (simply remove it if you're getting an error about it)
2024-01-15 00:04:32 -08:00
Jesse Bannon
3b36ffd050
[BUGFIX] Fix source metadata getting fetched when yt-dlp breaks (#889)
Prior PR only got channel metadata for a playlist if it never 'broke' (i.e. MaxDownloads, BreakOnExisting). Will now fetch it regardless.
2024-01-09 19:25:09 -08:00
Jesse Bannon
c29cca2b3d
[FEATURE] YouTube playlists to fetch playlist uploader's poster + fanart (#887)
Implements https://github.com/jmbannon/ytdl-sub/issues/756

TV Show presets whose URL is a playlist will try to get the playlist uploader's poster and fanart.
2024-01-08 22:51:42 -08:00
Jesse Bannon
731d4e444c
[DOCS] Tooling to auto-generate custom sphinx docs (#849)
Tooling + updating docs
2023-12-28 22:39:59 -08:00
Jesse Bannon
4d9a30779c
[BUGFIX] Use proper extractor key for download archive (#840)
For less popular sites, ytdl-sub's custom download archive was not working. This was because we weren't using the right extraction key (though it still worked for YouTube, Bandcamp, Soundcloud, and others). This bugfix should now exactly match yt-dlp's and never be a problem again.

Huge thanks to @Svagtlys for root-causing this 🤝
2023-12-14 17:04:03 -08:00
Jesse Bannon
544af2207b
[FEATURE] Add output_options.keep_max_files to limit number of downloads per subscription (#820)
Adds a new mechanism to limit subscriptions' number of videos to an explicit number (only supported date ranges prior to this).

Example usage:
```
output_options:
  keep_max_files: 10
```
will only keep 10 videos at max.

In addition:
- `keep_max_files` is bundled into the `Only Recent` preset and can be used via setting the `only_recent_max_files` override variable (see examples or README for usage).
- Changed the `date_range` variable name to `only_recent_date_range` for more clarity.  Usage of `date_range` will continue to work.
2023-11-17 09:01:21 -08:00
Jesse Bannon
6123e35c64
[DEV] Test-case for subscription with existing download archive (#819) 2023-11-16 23:37:24 -08:00
Jesse Bannon
9b8aa827ba
[BACKEND] Upgrade yt-dlp to 2023.11.14 (#815) 2023-11-14 19:23:35 -08:00
Jesse Bannon
f1a2187a17
[FEATURE] Add throttle_protection plugin (#799)
Provides options to make ytdl-sub look more 'human-like' to protect from throttling. For range-based values, a random number will be chosen within the range to avoid sleeps looking scripted.

Usage:
```
    throttle_protection:
      sleep_per_download_s:
        min: 2.2
        max: 10.8
      sleep_per_subscription_s:
        min: 9.0
        max: 14.1
      max_downloads_per_subscription:
        min: 10
        max: 36
      subscription_download_probability: 1.0
```
2023-11-05 08:23:12 -08:00
Jesse Bannon
5fb5a18abc
[FEATURE] TV Show prebuilt presets that require no config (#788)
Introduces 3 new presets + 1 helper preset to download TV show-based subscriptions without the need of a config

```
Plex TV Show by Date
Jellyfin TV Show by Date
Kodi TV Show by Date
```
and
```
Only Recent
```

Example usage can be found in https://github.com/jmbannon/ytdl-sub/blob/master/examples/tv_show_subscriptions.yaml
2023-11-01 22:39:32 -07:00
Jesse Bannon
056b111be6
[FEATURE] Prebuilt Music Videos (#787)
Creates standardized prebuilt presets for music videos. Preset names are:

```
"Kodi Music Videos"
"Jellyfin Music Videos"
"Plex Music Videos"
```

Usage can be found in the `examples/` directory
2023-10-28 00:12:22 -07:00
Jesse Bannon
4789035821
[BACKEND] Default overrides for indent variables (#785)
For music presets, adds `track_genre_default` as an override variable (defaults to Unset)

For TV show presets, adds `tv_show_genre_default` and `tv_show_content_rating_default`, which default to 'ytdl-sub' and 'TV-14'
2023-10-25 12:37:49 -07:00
Jesse Bannon
d810291e7c
[BUGFIX] Write music multi-tags correctly (#782)
Music multi-tags (artists, albumartists, etc) were not writing correctly. Fix it by explicitly checking to see if the tag is multi or not in the codebase.
2023-10-25 10:37:24 -07:00
Jesse Bannon
ff857c84af
[FEATURE] Prebuilt music presets (#780)
Adds the following prebuilt presets:
```
"Single"
"SoundCloud Discography"
"YouTube Releases"
"YouTube Full Albums"
"Bandcamp"
```

which require no config.yaml to use. Usage examples can be found in the `/examples` directory
2023-10-24 09:23:05 -07:00
Jesse Bannon
545f186c46
[FEATURE][BUGFIX] Beautiful subscriptions syntax update + fix (#758)
A follow-up to the prior commit which fixes some bugs in the 'beautiful subscriptions' implementation. A proper migration guide will be written in the wiki once it's ready
2023-10-17 16:30:50 -07:00
Jesse Bannon
309f259464
[FEATURE] Ability to migrate download archive files (#751)
With the recent push to 'beautify subscriptions' (see https://github.com/jmbannon/ytdl-sub/releases/tag/2023.10.02), we need the ability to change subscription names from their legacy form:
```
rick_a:
  preset:
    - "tv_show"
  overrides:
    tv_show_name: "Rick A"
    url: "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
```
into:
```
tv_show:
  "Rick A": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
```

This however has implications from ytdl-sub's legacy download archive naming. By default, we write archives to `.ytdl-sub-{subscription_name}-download-archive.json`. If we change the subscription name, the archive will not be found, causing a complete redownload. This new feature gives us the ability to migrate download archives to a new naming schema.

# Migrating to Beautified Subscriptions
## Step 0
BACK UP ALL CONFIG + SUBSCRIPTION FILES!!!!! If something goes wrong, restore your backup and try again and/or ask for help.

## Step 1
Since we know we'll be changing our `subscripion_name` to the value of `tv_show_name`, we can use that in our newly migrated download archive name by setting this within the `tv_show` preset (or whatever your 'base' preset is).
```
presets:
  tv_show:
    output_options:
      migrated_download_archive_name: ".{tv_show_name_sanitized}-download-archive.json" 
```

## Step 2
Perform a download as usual, via `ytdl-sub sub ...`. This will load the old archive, and save it into the new archive. You should see `MIGRATION DETECTED` within the logs. Ensure it completes successfully.

Perform another download invocation and ensure you see the `MIGRATION SUCCESSFUL` within the logs.

## Step 3
Now we can set:
```
presets:
  tv_show:
    output_options:
      # rename migrated_download_archive_name to just download_archive_name
      download_archive_name: ".{tv_show_name_sanitized}-download-archive.json" 

  overrides:
    tv_show_name: "{subscription_name}"
    url: "{subscription_value}"
```
Our download archives now default to our new format, and we set `tv_show_name` + `url` to use subscription values by default.

## Step 4
We can now beautify our subscription.yaml file to:
```
tv_show:
  "Rick A": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw"
```
2023-10-03 16:08:14 -07:00
Jesse Bannon
ae3739cdd3
[DEV] Do not hash .info.json files in expected download summaries (#752) 2023-10-03 13:22:19 -07:00
Jesse Bannon
792da1ba86
[BACKEND] Set merge_output_format to file_convert file type (#699)
Adds a small optimization to potentially avoid an additional remux by setting yt-dlp's merge output format to the desired format in the `file_convert` plugin (https://ytdl-sub.readthedocs.io/en/latest/config.html#file-convert)
2023-09-02 11:18:04 -07:00
Jesse Bannon
da70c725fc
[FEATURE] Support best codec type in audio_extract (#700)
Adds support to the `audio_extract` plugin (https://ytdl-sub.readthedocs.io/en/latest/config.html#audio-extract) to the following to grab the best audio format available:

```
audio_extract:
  codec: "best"
```
2023-09-02 00:50:26 -07:00