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
132.41k stars 10.04k forks source link

Please add possibility to use leading zero in season_number and episode_number parameters #17841

Closed sulark closed 6 years ago

sulark commented 6 years ago

Please follow the guide below


Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.10.05. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

Before submitting an issue make sure you have:

What is the purpose of your issue?


Description of your issue, suggested solution and other information

When using youtube-dl to download tv-shows, and using output templates (-o), it's problematic for sorting purposes that it's not possible to have a leading zero in the numeric numbering of in particular season_number and episode_number parameters. This leads to none standard naming of tv shows for indexing purposes and listing in popular media center applications/backends as plex and kodi.

I have a temp solution to this, as to manually specify a 0 in the output template, but that is just odd, as it saves files with 3 digit numbering in season and episode format if epidoe equals 10 or above, se below for my naming:

/%(series)s/%(series)s.S0%(season_number)sE0%(episode_number)s.720p.WEB-DL.H264-YTDL.%(ext)s"

As of now the parameters starts counting at 1, but I would really like to have the possibility to start naming at 01

Please add the possibility to use leading zero in season_number and episode_number parameters.

If anybody has a solution with existing options/parameters/strings, please let me know

dstftw commented 6 years ago

Have you even read FAQ?

The special sequences may be formatted according to python string formatting operations. For example, %(NAME)s or %(NAME)05d.

For numeric sequences you can use numeric related formatting, for example, %(view_count)05d will result in a string with view count padded with zeros up to 5 characters, like in 00042.