Requirements:
- access to youtube
- ytcc (optional)
- ffmpeg
- youtube-dl
- emby/yellyfin (optional)
The available metadata dependes on the extractor. I have an additional level of control if I can extract metadata from video titles that might not be captured by the extractor. ll
In fact, every set of videos can be downloaded as a playlist, because all videos form a channel are a playlist themself (names “Uploads from <channel name>”), and youtube-dl can arbitrarily filter this list. So a playlist is not just what that uploader has defined as a playlist, but what you choose to be.
First just download the titles of the playlist:
youtube-dl --get-title PLzH6n4zXuckpfMu_4Ff8E7Z1behQks5ba
Now use this for `–metadata-from-title`
youtube-dl --get-filename https://www.youtube.com/playlist?list=PLzH6n4zXuckpfMu_4Ff8E7Z1behQks5ba -o '/media/chriad/YOUTUBE-dl/YOUTUBE-PLAYLISTS/%(channel)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'
Now use this output for `–exec … {}` to remove unnecessary stuff from filename.
Look at embedded metadata:
ffmpeg -i 'The Privacy Tax - How tracking and hacking affect disabled people, and what we can do about it.mkv' -f ffmetadata - 2> /dev/null
https://www.freedesktop.org/wiki/CommonExtendedAttributes/
Maybe conform to jellyfin naming?
youtube-dl --get-filename https://www.youtube.com/playlist?list=PLzH6n4zXuckpfMu_4Ff8E7Z1behQks5ba -o '/media/chriad/YOUTUBE-dl/YOUTUBE-PLAYLISTS/%(channel)s/%(playlist)s - S01E%(playlist_index)s - %(title)s.%(ext)s'
Case study: using `–metadata-from-title`
What metadata can we extract? youtube-dl -j
To look for metadata in the json file, I can highly recommand jid bla.
youtube-dl –dump-single-json `ytcc -o xsv subscriptions -a name,url | grep ‘Mastering’|cut -f2 -d’,’` | jid
youtube-dl –dump-single-json –sub-lang en `ytcc -o xsv subscriptions -a name,url | grep ‘Mastering’|cut -f2 -d’,’` | jq ‘.entries[].upload_date’
cat *.info.json | json –group | jq ‘.[].upload_date’
- https://github.com/ankenyr/jellyfin-youtube-metadata-plugin.git
- https://stackoverflow.com/a/67144906/2376000 -> another degree of freedem by calling youtube-dl multiple times in one shell script
static playlist: will not be updated: e.g. conference dynamic, will be updated
youtube-dl –no-warnings –get-url https://hpc.guix.info/events/2021/atelier-reproductibilit%C3%A9-environnements/ | wget -i -
cat urls.txt | ./download-series-from-url-file.sh ‘<name der Serie>’
Why not completely in ytcc?
- does not work with playlist name, gives NA
- does not work with e.g. write_info_json and many more ytdl options
`ytcc -o xsv subscriptions -a name,url | grep ‘hanselmann’|cut -f2 -d’,’`
look at the emby log tail -f /var/lib/emby/logs/embyserver.txt
ffprobe -i “/media/chriad/lenovo/emby-test/Scott Hanselman/Computer Stuff They Didn’t Teach You/What’s a Carriage and Who’s Feeding it Lines CRLF - Computer Stuff They Didn’t Teach You #1.mkv” -threads 0 -v info -print_format json -show_streams -show_chapters -show_format -show_data |fx
does not work: –postprocessor-args "-metadata episode_id=%(title)s"
does not work: –metadata-from-title ‘%(playlist)s - (?P<title>.+) by (?P<artist>.+)’ but: –metadata-from-title ‘%(playlist)s - %(title)s by %(artist)s’
systemctl start emby-server.service shutdown with gui service jellyfin start
/snap/core20/1169/usr/bin/rename.ul -nv ‘Il était une fois… la vie -’ ” ./*
Untertitel mit: HTTPS_SQ_2 mp4 1280x720 VOF-STF, Französisch 2200k HTTPS_SQ_3 mp4 1280x720 VOF-STMF, Französisch (Hörgeschädigte) 2200k STFM -> hardgecoded (was ich will zum Sprachenlernen) Bsp: Kadyrow: Video franz mit franz untertitel und deutsch audio #2