1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-09 10:40:02 +08:00

[dump-video-list-only] Add option to dump video list only

This commit is contained in:
Peter Uhrig 2019-04-26 18:27:02 +02:00
parent e6664d3bc6
commit dbd292c621
3 changed files with 10 additions and 0 deletions

View File

@ -925,6 +925,11 @@ class YoutubeDL(object):
ie_entries = ie_result['entries']
if self.params.get("dump_video_list_only", False):
# ie_entries is a generator, so it depletes when we iterate through it and no videos remain for download
for entry in ie_entries:
print(entry)
def make_playlistitems_entries(list_ie_entries):
num_entries = len(list_ie_entries)
return [

View File

@ -335,6 +335,7 @@ def _real_main(argv=None):
'forceformat': opts.getformat,
'forcejson': opts.dumpjson or opts.print_json,
'dump_single_json': opts.dump_single_json,
'dump_video_list_only': opts.dump_video_list_only,
'simulate': opts.simulate or any_getting,
'skip_download': opts.skip_download,
'format': opts.format,

View File

@ -602,6 +602,10 @@ def parseOpts(overrideArguments=None):
'--get-id',
action='store_true', dest='getid', default=False,
help='Simulate, quiet but print id')
verbosity.add_option(
'--dump-video-list-only',
action='store_true', dest='dump_video_list_only', default=False,
help='Just dump the list of videos in a channel/playlist and do not perform other requests. Use together with -i and -q to obtain parseable JSON Lines format.')
verbosity.add_option(
'--get-thumbnail',
action='store_true', dest='getthumbnail', default=False,