Using the 'NA' string when an item is unavailable would break with format specifiers such as {playlist_index:03} or {upload_date:%Y} since strings don't allow those formatters.
Instead of using 'NA', use a class that always returns 'NA' on str() or format().
(The str() part can probably be removed; it's just in case %s is used somewhere else in the code, now or in a future.)
Also, renamed class _Int_digits to a more meaningful and consistent _Int_formatter.
{autonumber} and {playlist_index} are now integers rather than strings, so {autonumber:02} works and you don't need --autonumber-size.
(Actually, they're "special integers" that get printed to a predefined fixed width if you leave the :02 out; see the _Int_digits class.)
{upload_date} is now a datetime.date, so {upload_date:%b %Y} will format as "Oct 2015" (default is "2015-10-19").
sanitize() gets applied only to string values, not to numeric ones (or dates or lists or...)
{autonumber} and {playlist_index} are now integers rather than strings, so {autonumber:02} works and you don't need --autonumber-size.
(Actually, they're "special integers" that get printed to a predefined fixed width if you leave the :02 out; see the _Int_digits class.)
{upload_date} is now a datetime.date, so {upload_date:%b %Y} will format as "Oct 2015" (default is "2015-10-19").
sanitize() gets applied only to string values, not to numeric ones (or dates or lists or...)
- Edited __init__.py so that it uses the new {NAME} rather than the old %(NAME)s --output format
- Moved the backwards compatibility code from YoutubeDL.py to __init__.py
- Display a warning if the old format is used
- Edited __init__.py so that it uses the new {NAME} rather than the old %(NAME)s --output format
- Moved the backwards compatibility code from YoutubeDL.py to __init__.py
- Display a warning if the old format is used (using sys.stderr.write(); this is probably not the way to go...)
This is according to how youtube handles multiple v= values in one URL.
Before this, it was possible to make a single URL show up differently
on youtube itself, and if you downloaded/viewed it with youtube-dl/mpv