jmbannon / ytdl-sub

Lightweight tool to automate downloading and metadata generation with yt-dlp
https://ytdl-sub.readthedocs.io
GNU General Public License v3.0
1.74k stars 70 forks source link

Getting FileNotDownloadedException("Failed to find the input file") when trying to download a YouTube channel as MP3s #409

Closed jcreek closed 1 year ago

jcreek commented 1 year ago

Exactly as the title says.

config.yaml

configuration:
  working_directory: '/tmp/ytdl-sub-downloads'

presets:

  yt_video:
    preset:
      # Choose a player type:
      - "plex_tv_show_by_date"

      # Choose a season/episode format:
      - "season_by_year__episode_by_month_day"

      # Include any of the presets listed below in your 'main preset' if you want
      # it applied to every TV show. Or, use them on the individual subscriptions.
      - "add_subtitles"
      - "include_info_json"

      # Add ability to only download within a specified date range
      - "only_videos_within_date_range"

    download:
      download_strategy: "url"
      playlist_thumbnails:
      - name: "poster.jpg"
        uid: "avatar_uncropped"
      - name: "banner.jpg"
        uid: "banner_uncropped"

    output_options:
      output_directory: "/tv_shows/{tv_show_name_sanitized}"
      file_name: "{episode_path}.{ext}"
      thumbnail_name: "{episode_path}-thumb.{thumbnail_ext}"

    overrides:
      tv_show_name: "OVERRIDE IN SUBSCRIPTION"
      season: "{upload_year}"
      episode: "{upload_month}{upload_day_padded}{epoch}"
      episode_padded: "{upload_month_padded}{upload_day_padded}{epoch}"
      episode_file_name: "s{season}e{episode_padded}.{title_sanitized}"
      episode_path: "Season {season}/{episode_file_name}"
      override_filter_not1: ""
      override_filter_not2: ""

    match_filters:
      filters:
        - "original_url!*=/shorts/" # No YT shorts
        - "!is_live" # No livestreams
        - "title!*={override_filter_not1}"
        - "title!*={override_filter_not2}"
        - "description!*={override_filter_not1}"
        - "description!*={override_filter_not2}"
        - "info_json_ext!*={override_filter_not1}"
        - "info_json_ext!*={override_filter_not2}"

  yt_playlist:
    preset:
      - "yt_video"
    download:
      download_strategy: "url"
      # playlist_thumbnails:
      # - name: "poster.jpg"
      #   uid: "avatar_uncropped"
      # - name: "banner.jpg"
      #   uid: "banner_uncropped"
    output_options:
      maintain_download_archive: True
    ytdl_options:
      break_on_existing: True

  yt_channel:
    preset:
      - "yt_playlist"
    download:
      download_strategy: "url"
      playlist_thumbnails:
      - name: "poster.jpg"
        uid: "avatar_uncropped"
      - name: "banner.jpg"
        uid: "banner_uncropped"

####################################################################################################

  # Preset to download subtitles (either by file or embedded)
  add_subtitles:
    subtitles:
      # Embed subtitles into the video
      embed_subtitles: True
      # And/or download them as a file. Uncomment to download as file:
      # subtitles_name: "{episode_file_path}.{lang}.{subtitles_ext}"
      # subtitles_type: "srt"

      languages: "en"  # supports list of multiple languages
      allow_auto_generated_subtitles: True  # allow auto subtitles

####################################################################################################

  # Preset for the hoarders who want to also save the info.json file
  include_info_json:
    output_options:
      info_json_name: "{episode_file_path}.{info_json_ext}"

####################################################################################################

  # Preset to save within a date range - see docs at https://github.com/jmbannon/ytdl-sub/wiki/5.-Optimizing-Your-First-Config#using-the-date_range-plugin
  # A string in the format YYYYMMDD or
  # (now|today|yesterday|date)[+-][0-9](microsecond|second|minute|hour|day|week|month|year)(s)
  # Valid examples are now-2weeks or 20200101. Can use override variables in this.
  only_videos_within_date_range:
    # Only download videos within the download_range
    date_range:
      before: "{override_before}"
      after: "{override_after}" # "today-{download_range}"

    # Stops fetching metadata if the video is out of range (saves time + bandwidth)
    # ytdl_options:
    #   break_on_reject: True

    # # Deletes any videos older than download_range. WARNING: do not use
    # # "season_by_year__episode_by_download_index" if you plan to delete older videos
    # output_options:
    #   keep_files_after: "today-{download_range}"

    # Set the duration of download_range, defaults to 2 months
    overrides:
      override_before: "now"
      override_after: "20000101"
      download_range: "100years" #"2months"

####################################################################################################

  # Preset to download videos as MP3s
  yt_song:
    preset:
      - "yt_channel"

    download:
      download_strategy: "url"

    output_options:
      output_directory: "{music_directory}"
      file_name: "{custom_track_name_sanitized}.{ext}"

    audio_extract:
      codec: "mp3"
      quality: 128

    music_tags:
      embed_thumbnail: True  # Set to True to embed album art
      tags:
        artist: "{custom_artist_name}"
        artists: "{custom_artist_name}"
        albumartist: "{custom_artist_name}"
        albumartists: "{custom_artist_name}"
        title: "{custom_track_name}"
        album: "{custom_album_name}"
        track: "{custom_track_number}"
        year: "{upload_year}"
        genre: "Unset"

    overrides:
      music_directory: "/yt_music/{custom_artist_name_sanitized}"
      custom_track_name: "{title}"
      custom_album_name: "{upload_year}"
      custom_artist_name: "OVERRIDE IN SUBSCRIPTION"
      custom_track_number: "{upload_year}{upload_month_padded}{upload_day_padded}{epoch}"

subscriptions.yaml

    ortopilot_vods_channel:
      preset: "yt_song"
      download:
        url: "https://www.youtube.com/channel/UCNk2lp2-qsn8lo1Nn3X8qyg"
      overrides:
          custom_artist_name: "OrtoPilot"

The full log can be found at https://www.dropbox.com/s/oo5j3zubl19fwbs/ytdl-sub.hqcn3wgu?dl=0

jmbannon commented 1 year ago

Looks like yt_song inherits both audio_extract to mp3 and file_convert to mp4, which is why things are getting messed up. For yt_song, I would not inherit from yt_channel and instead build the preset to be completely separate. file_convert gets inherited from the prebuilt preset plex_tv_show_by_date

jmbannon commented 1 year ago

And impressive config btw! Glad you were able to get this far with the current documentation

jmbannon commented 1 year ago

Closing this issue in favor of https://github.com/jmbannon/ytdl-sub/issues/421 Feel free to reopen if the problem still persists after fixing audio_extract + file_convert

jcreek commented 1 year ago

Thank you very much for your reply, sorry for the delay with mine! This has solved the issue :)

EvanCarroll commented 1 year ago

@jcreek !is_live is now a default.