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.
Make parsed metadata variables available to output template #11747
Comments
Yep that's the correct way. |
I've verified and I assure that I'm running youtube-dl 2017.01.16
At least skimmed through README and most notably FAQ and BUGS sections
Searched the bugtracker for similar issues including closed ones
What is the purpose of your issue?
Log
Make parsed metadata variables (
--metadata-from-title) available to output template (-o)Presently, it appears as if the only metadata available to the output template engine is that returned by the
_real_extract()function in the site-specific extractor.So, in my example, PBS, the only real element available at the time the output template is processed is the title, id, and a few others. Indeed, if you look in the logs I pasted above it seems that the metadata extraction from title happens quite late, after files have been written.
To be general, this is not specific to the PBS extractor.
Desired behaviour: Make metadata variables extracted from the title also available to the file output template.
Proposed fix: Move the processing of
--metadata-from-titleearlier (during initial extraction, before writing (m)any files).While writing this report I noticed issue #11108 which is another manifestation of this same problem. Note at the end someone correctly identifies that the metadata-from-title is not available as a variable to the output template. In my view it would be more sensible to move this parsing earlier and make these variables available, instead of adding a whole 'nother parameter,
--variables-from-titleas suggested in #11108I haven't digested enough of the codebase yet to make the change myself. Thanks for your consideration.