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.
use --get-title while not simulating? #24654
Comments
|
|
|
The first one outputs something like this:
The latter outputs no progress, only one big information json. It would be great if something like this could be outputted:
|
|
@dstftw since you immediately closed this issue; I'm not sure if you get these updates, but please check my previous comment on |
|
No such feature exists. |
|
@dstftw that I know; hence the reason for a feature request |
|
I don't think this deserves an option. |
|
@dstftw you already have the option --get-title. The only thing that is missing is to display that in one go. I don't understand why it would take two runs to get something as trivial as a video title. |
|
|
|
@dstftw by changing the def __forced_printings(self, info_dict, filename, incomplete):
def print_title():
if (not incomplete or info_dict.get(field) is not None):
if (self.params.get('forcetitle', False)):
self.to_stdout(info_dict["title"])
else:
self.to_stdout("[videotitle] %s" % info_dict["title"])
def print_mandatory(field):
if (self.params.get('force%s' % field, False)
and (not incomplete or info_dict.get(field) is not None)):
self.to_stdout(info_dict[field])
def print_optional(field):
if (self.params.get('force%s' % field, False)
and info_dict.get(field) is not None):
self.to_stdout(info_dict[field])
print_title()
print_mandatory('id')
if self.params.get('forceurl', False) and not incomplete:
if info_dict.get('requested_formats') is not None:
for f in info_dict['requested_formats']:
self.to_stdout(f['url'] + f.get('play_path', ''))
else:
# For RTMP URLs, also include the playpath
self.to_stdout(info_dict['url'] + info_dict.get('play_path', ''))
print_optional('thumbnail')
print_optional('description')
if self.params.get('forcefilename', False) and filename is not None:
self.to_stdout(filename)
if self.params.get('forceduration', False) and info_dict.get('duration') is not None:
self.to_stdout(formatSeconds(info_dict['duration']))
print_mandatory('format')
if self.params.get('forcejson', False):
self.to_stdout(json.dumps(info_dict)) |
Checklist
Description
I'm trying to download a video AND get title information displayed in the console log as well. When invoking
I see a lot of information, but neither of it contains the video title. I also tried
-vfor extra information, but here too: no video title.There is a way to obtain that using --get-title, but when supplying that, no actual download takes place. It merely simulates.
To get this information, I then have to call the tool twice, which is a lot slower, since there seems to be a significant startup time.
Is there a way to get the video title in the output in the same pass as downloading it?