Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give example of subscription config for shows with series #1160

Open
markalex2209 opened this issue Jan 15, 2025 · 1 comment
Open

Give example of subscription config for shows with series #1160

markalex2209 opened this issue Jan 15, 2025 · 1 comment
Labels
question Further information is requested

Comments

@markalex2209
Copy link

Some shows on youtube still use conventional season format. For example TaskMaster and Last Week Tonight have names of video which include series.
I would like to preserve this info in the metadata. But all examples I found are writing year of the upload into series.

I've tried following subscriptions.yaml:

__preset__:
  overrides:
    tv_show_directory: "/tv_shows"

Jellyfin TV Show by Date:
  = Taskmaster:
    "~Taskmaster": 
      url: "https://www.youtube.com/playlist?list=PLRWvNQVqAeWIH8s4IZfWLylrMoIO379df"
      ytdl_options:
        output: "/tv_shows/Taskmaster/Season %(series_number)s/Taskmaster - S%(series_number)sE%(episode_number)s - %(title)s.%(ext)s"
        parse_metadata:
          - "title:Series (?P<series_number>[0-9]+), Episode (?P<episode_number>[0-9]+).*"
        postprocessor_args:
          - "ffmpeg:-metadata series=Taskmaster"
          - "ffmpeg:-metadata season_number=%(series_number)s"
          - "ffmpeg:-metadata episode_number=%(episode_number)s"
        match_title: "Series- ([0-9]+), Episode ([0-9]+)"

But on run of ytdl-sub --dry-run sub subscriptions.yaml -o '--ytdl_options.max_downloads 1' I get following error:

[ytdl-sub] Validating subscriptions...
[ytdl-sub] Beginning subscription dry run for Taskmaster
[ytdl-sub:downloader] Downloading metadata for Taskmaster UK - Full Episodes
[ytdl-sub:downloader] Downloading metadata for Series 1, Episode 6 -  'The last supper' | Full Episode | Taskmaster
[ytdl-sub:yt-dlp-downloader] MaxDownloadsReached, stopping additional downloads.
[ytdl-sub:downloader] Beginning downloads for https://www.youtube.com/playlist?list=PLRWvNQVqAeWIH8s4IZfWLylrMoIO379df
[ytdl-sub:downloader] Downloading entry 1/1: Series 1, Episode 6 -  'The last supper' | Full Episode | Taskmaster
[ytdl-sub] The following error occurred for the subscription Taskmaster:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/subscriptions/subscription_download.py", line 388, in exception_handling
    yield
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/cli/entrypoint.py", line 126, in _download_subscriptions_from_yaml_files
    subscription.download(dry_run=dry_run)
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/subscriptions/subscription_download.py", line 375, in download
    return self._process_subscription(
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/subscriptions/subscription_download.py", line 315, in _process_subscription
    entry = downloader.download(entry)
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/downloaders/url/downloader.py", line 532, in download
    download_entry = self._extract_entry_info_with_retry(entry=entry)
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/downloaders/url/downloader.py", line 352, in _extract_entry_info_with_retry
    download_entry_dict = YTDLP.extract_info_with_retry(
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/downloaders/ytdlp.py", line 95, in extract_info_with_retry
    entry_dict = cls.extract_info(
  File "/usr/local/lib/python3.10/dist-packages/ytdl_sub/downloaders/ytdlp.py", line 55, in extract_info
    return ytdlp.extract_info(**kwargs)
  File "/usr/local/lib/python3.10/dist-packages/yt_dlp/YoutubeDL.py", line 1623, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
  File "/usr/local/lib/python3.10/dist-packages/yt_dlp/YoutubeDL.py", line 1634, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/yt_dlp/YoutubeDL.py", line 1790, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/lib/python3.10/dist-packages/yt_dlp/YoutubeDL.py", line 1849, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/usr/local/lib/python3.10/dist-packages/yt_dlp/YoutubeDL.py", line 3040, in process_video_result
    raise MaxDownloadsReached
yt_dlp.utils.MaxDownloadsReached: Maximum number of downloads reached, stopping due to --max-downloads
[ytdl-sub]
No files changed for Taskmaster
[ytdl-sub] Download Summary:
Taskmaster     0 0 0     0 MaxDownloadsReached
Total: 1       0 0 0     0 Error

See `/tmp/ytdl-sub.errorswrkpsmjt` for details on errors.
Consider making a GitHub issue including the uploaded log file.

And mentioned log file contains just the last 8 lines of the same message.

As I understand problem comes from my ytdl_options.parse_metadata, but I can wrap my head around how to correctly set that up.

Also, I think that actual proper series number in the name of the video is still reasonably often occurring. Can you please consider adding example of having it parsed into default or example configurations?

@jmbannon
Copy link
Owner

Use ytdl-sub's parsing capabilities instead of yt-dlp's. You will want to perform

  1. regex on the title: https://ytdl-sub.readthedocs.io/en/latest/config_reference/scripting/scripting_functions.html#regex-capture-many
  2. override the captured values for the season and episode numbers: https://ytdl-sub.readthedocs.io/en/latest/config_reference/prebuilt_presets/tv_show.html

The variables found in (2) get used to write all the metadata (file names, video tags, NFO files, etc)

@jmbannon jmbannon added the question Further information is requested label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants