Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
--metadata-from-title regex optional capture groups #13408
Comments
|
I think just skipping the empty match will do the trick (so the attribute is omitted from the metadata dict). I'll whip up a PR right quick unless anybody disagrees. |
Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2017.06.12. 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?
If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add
-vflag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):Description of your issue, suggested solution and other information
I'm downloading a playlist and using a regex with
--metadata-from-title. Some of the titles omit some metadata items so I made the respective capture groups optional. However, when youtube-dl gets to such a title where a capture group result is empty, thematchobject's value isNone, which trips up later code expecting a string.The verbose output above demonstrates two items in the playlist, the first matches all captures groups and succeeds; the second fails as described.
I did verify the regex matches titles in the playlist as expected.