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.
Access to info_dict before/after download/post-processing when embedding #10987
Comments
|
Sorry for the late response. In case you're still looking for a solution, here's a hacky version: from __future__ import unicode_literals
import youtube_dl
filename = None
class Logger(object):
def debug(self, message):
global filename
filename = message
ydl_opts = {
'forcefilename': True,
'simulate': True,
'logger': Logger(),
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.extract_info('http://www.youtube.com/watch?v=BaW_jenozKc')
print(filename)It would be great if embedders can access info_dict before/after downloading and post-processing... |
Before submitting an issue make sure you have:
What is the purpose of your issue?
I'm trying to get the exact filename that'll be written(merged) by youtube-dl. It's the same filename sent to debug when setting forcefilename to true on the options.
I want to access this:
https://github.com/rg3/youtube-dl/blob/master/youtube_dl/YoutubeDL.py#L1531
With youtube_dl.prepare_filename(result) I can get the merged filename without extension.. how do I get the extension?