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

Leading zero in OUTPUT TEMPLATE #15552

Closed
Sopor opened this issue Feb 10, 2018 · 4 comments
Closed

Leading zero in OUTPUT TEMPLATE #15552

Sopor opened this issue Feb 10, 2018 · 4 comments

Comments

@Sopor
Copy link

@Sopor Sopor commented Feb 10, 2018

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

  • I've verified and I assure that I'm running youtube-dl 2018.02.08

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

When i download i want the season and episode have a leading zero instead of only a single number. I use the template s%(season_number)se%(episode_number)s and i can't find anything that will make it use two numbers 01, 02, 03 and i don't want to add it manually because that will make it hard to check for every download if there should be a leading 0 or not.
I'm new to youtube-dl so maybe i have missed something?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Feb 10, 2018

Read FAQ?

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

@dstftw dstftw closed this Feb 10, 2018
@Sopor
Copy link
Author

@Sopor Sopor commented Feb 10, 2018

I have no idea how that works, but thanks for your help @dstftw...

@Hrxn
Copy link

@Hrxn Hrxn commented Feb 11, 2018

S%(season_number)05d vs. S%(season_number)s for example...

@w7guru
Copy link

@w7guru w7guru commented May 1, 2019

Thanks, I don't have to rename my files anymore after download.
-o '%(series)s - S0%(season_number)sE0%(episode_number)s - %(title)s.%(ext)s"
With above I was getting S0E01,SE02 (OK) but S01E010, S01E011 (NOK)
'%(series)s - S%(season_number)**02d**E%(episode_number)**02d** - %(episode)s.%(ext)s'
I get "ShowName - S01E01 - BlaBlaBla.mp4"

also tried 03d,04d

Tested:

>>> print '%(language)s has %(number)02d quote types.' % \
... {"language": "Python", "number": 2}
Python has 02 quote types.
>>> print '%(language)s has %(number)03d quote types.' % \
... {"language": "Python", "number": 2}
Python has 002 quote types.
>>> print '%(language)s has %(number)05d quote types.' % \
... {"language": "Python", "number": 2}
Python has 00002 quote types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.