From 42e4bf72eec7d59ea1fc53646de8fb63f91aee50 Mon Sep 17 00:00:00 2001 From: flatt3rn Date: Mon, 2 Jan 2017 23:45:04 +0100 Subject: [PATCH 1/3] Added Option --- youtube_dl/options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/options.py b/youtube_dl/options.py index 53497fbc6..7ed93a8bd 100644 --- a/youtube_dl/options.py +++ b/youtube_dl/options.py @@ -196,6 +196,10 @@ def parseOpts(overrideArguments=None): action='store_true', dest='no_color', default=False, help='Do not emit color codes in output') + general.add_option( + '--read-file', '--read-file', + metavar='FILE', dest='read_file', + help='Read a File containing the links') network = optparse.OptionGroup(parser, 'Network Options') network.add_option( From ac2145ebcd1c8a3e7667cd038051b995b27e027b Mon Sep 17 00:00:00 2001 From: flatt3rn Date: Mon, 2 Jan 2017 23:46:44 +0100 Subject: [PATCH 2/3] Added function to init --- youtube_dl/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 6850d95e1..e498a7cbc 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -123,7 +123,13 @@ def _real_main(argv=None): table = [[mso_id, mso_info['name']] for mso_id, mso_info in MSO_INFO.items()] write_string('Supported TV Providers:\n' + render_table(['mso', 'mso name'], table) + '\n', out=sys.stdout) sys.exit(0) - + + if opts.read_file: + if os.path.isfile(opts.read_file): + all_urls = [line.rstrip('\n') for line in open(opts.read_file)] + else: + sys.exit('ERROR: This file does not exist') + # Conflicting, missing and erroneous options if opts.usenetrc and (opts.username is not None or opts.password is not None): parser.error('using .netrc conflicts with giving username/password') From 1f16d408c52bd5803241931048f8953100ca3f1c Mon Sep 17 00:00:00 2001 From: flatt3rn Date: Tue, 3 Jan 2017 00:05:01 +0100 Subject: [PATCH 3/3] Added try clause For the case multiple videos are passed to youtube-dl and one of them throw an error. This let the program go on --- youtube_dl/YoutubeDL.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 53f20ac2c..2e66d54c7 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1787,8 +1787,11 @@ class YoutubeDL(object): for url in url_list: try: # It also downloads the videos + try: res = self.extract_info( url, force_generic_extractor=self.params.get('force_generic_extractor', False)) + except: + pass except UnavailableVideoError: self.report_error('unable to download video') except MaxDownloadsReached: