ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.8k stars 9.99k forks source link

Adding Year format name for RAI #30451

Open AlexZigante opened 2 years ago

AlexZigante commented 2 years ago

Checklist

Description

Hello, could we add a year format name at least for Rai. To use "%(title)s (%(year)s).%(ext)s" to get out filename in format MovieTitle (year).mp4. After quickly scrolling through rai.py we could use the same json links to extract also year data and then use it to format files by it. It would be really useful for "Arrs" (Radarr, Sonarr) and other applications.

dirkf commented 2 years ago

Use (eg) %(upload_date).4s, so "%(title)s (%(upload_date).4s).%(ext)s".

For the next 7977 years, anyway.

AlexZigante commented 2 years ago

the result for (%(upload_date).4s) is (NA). Didn't dive deep in the rai.py yet since im not really a master of python. I've seen tho that the links .json file on RaiPlays end does have a movie release year info in it. And I would assume theres also one for series. Thanks for the tip tho it's a good start I assume, maybe something is missing in rai.py to get that info from the .json link

dirkf commented 2 years ago
$ youtube-dl --get-filename -o '%(upload_date).4s' 'http://www.raisport.rai.it/dl/raiSport/media/rassegna-stampa-04a9f4bd-b563-40cf-82a6-aad3529cb4a9.html'
2014
$

Plainly if the site provides no date string (upload_date, release_date, not sure about any others), it can't be left-truncated to .4s.

You can generate the JSON with -j and inspect with a JSON viewer or jq to see what is actually delivered for a particular video page.