From 98b69821e4d94f8be027c7d3a60db701b5c17792 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Mon, 3 Aug 2020 23:54:52 +0300 Subject: [PATCH 001/112] use dl function for subtitles --- youtube_dl/YoutubeDL.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 19370f62b..f9aa91f30 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1805,6 +1805,14 @@ class YoutubeDL(object): self.report_error('Cannot write annotations file: ' + annofn) return + def dl(name, info): + fd = get_suitable_downloader(info, self.params)(self, self.params) + for ph in self._progress_hooks: + fd.add_progress_hook(ph) + if self.params.get('verbose'): + self.to_stdout('[debug] Invoking downloader on %r' % info.get('url')) + return fd.download(name, info) + subtitles_are_requested = any([self.params.get('writesubtitles', False), self.params.get('writeautomaticsub')]) @@ -1819,7 +1827,6 @@ class YoutubeDL(object): if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(sub_filename)): self.to_screen('[info] Video subtitle %s.%s is already present' % (sub_lang, sub_format)) else: - self.to_screen('[info] Writing video subtitles to: ' + sub_filename) if sub_info.get('data') is not None: try: # Use newline='' to prevent conversion of newline characters @@ -1831,10 +1838,9 @@ class YoutubeDL(object): return else: try: - sub_data = ie._request_webpage( - sub_info['url'], info_dict['id'], note=False).read() - with io.open(encodeFilename(sub_filename), 'wb') as subfile: - subfile.write(sub_data) + # TODO does this transfer session...? + # TODO exceptions + dl(sub_filename, sub_info) except (ExtractorError, IOError, OSError, ValueError) as err: self.report_warning('Unable to download subtitle for "%s": %s' % (sub_lang, error_to_compat_str(err))) @@ -1856,14 +1862,6 @@ class YoutubeDL(object): if not self.params.get('skip_download', False): try: - def dl(name, info): - fd = get_suitable_downloader(info, self.params)(self, self.params) - for ph in self._progress_hooks: - fd.add_progress_hook(ph) - if self.params.get('verbose'): - self.to_stdout('[debug] Invoking downloader on %r' % info.get('url')) - return fd.download(name, info) - if info_dict.get('requested_formats') is not None: downloaded = [] success = True From a78e3a57951893a1b885d6c478d09d279101f6a2 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 01:02:23 +0300 Subject: [PATCH 002/112] support youtube live chat replay --- youtube_dl/downloader/__init__.py | 2 + youtube_dl/downloader/youtube_live_chat.py | 88 ++++++++++++++++++++++ youtube_dl/extractor/youtube.py | 8 ++ 3 files changed, 98 insertions(+) create mode 100644 youtube_dl/downloader/youtube_live_chat.py diff --git a/youtube_dl/downloader/__init__.py b/youtube_dl/downloader/__init__.py index 2e485df9d..4ae81f516 100644 --- a/youtube_dl/downloader/__init__.py +++ b/youtube_dl/downloader/__init__.py @@ -8,6 +8,7 @@ from .rtmp import RtmpFD from .dash import DashSegmentsFD from .rtsp import RtspFD from .ism import IsmFD +from .youtube_live_chat import YoutubeLiveChatReplayFD from .external import ( get_external_downloader, FFmpegFD, @@ -26,6 +27,7 @@ PROTOCOL_MAP = { 'f4m': F4mFD, 'http_dash_segments': DashSegmentsFD, 'ism': IsmFD, + 'youtube_live_chat_replay': YoutubeLiveChatReplayFD, } diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py new file mode 100644 index 000000000..64d1d20b2 --- /dev/null +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -0,0 +1,88 @@ +from __future__ import division, unicode_literals + +import re +import json + +from .fragment import FragmentFD + + +class YoutubeLiveChatReplayFD(FragmentFD): + """ Downloads YouTube live chat replays fragment by fragment """ + + FD_NAME = 'youtube_live_chat_replay' + + def real_download(self, filename, info_dict): + video_id = info_dict['video_id'] + self.to_screen('[%s] Downloading live chat' % self.FD_NAME) + + test = self.params.get('test', False) + + ctx = { + 'filename': filename, + 'live': True, + 'total_frags': None, + } + + def dl_fragment(url): + headers = info_dict.get('http_headers', {}) + return self._download_fragment(ctx, url, info_dict, headers) + + def parse_yt_initial_data(data): + raw_json = re.search(b'window\["ytInitialData"\]\s*=\s*(.*);', data).group(1) + return json.loads(raw_json) + + self._prepare_and_start_frag_download(ctx) + + success, raw_fragment = dl_fragment( + 'https://www.youtube.com/watch?v={}'.format(video_id)) + if not success: + return False + data = parse_yt_initial_data(raw_fragment) + continuation_id = data['contents']['twoColumnWatchNextResults']['conversationBar']['liveChatRenderer']['continuations'][0]['reloadContinuationData']['continuation'] + # no data yet but required to call _append_fragment + self._append_fragment(ctx, b'') + + first = True + offset = None + while continuation_id is not None: + data = None + if first: + url = 'https://www.youtube.com/live_chat_replay?continuation={}'.format(continuation_id) + success, raw_fragment = dl_fragment(url) + if not success: + return False + data = parse_yt_initial_data(raw_fragment) + else: + url = ('https://www.youtube.com/live_chat_replay/get_live_chat_replay' + + '?continuation={}'.format(continuation_id) + + '&playerOffsetMs={}'.format(offset - 5000) + + '&hidden=false' + + '&pbj=1') + success, raw_fragment = dl_fragment(url) + if not success: + return False + data = json.loads(raw_fragment)['response'] + + first = False + continuation_id = None + + live_chat_continuation = data['continuationContents']['liveChatContinuation'] + offset = None + processed_fragment = bytearray() + if 'actions' in live_chat_continuation: + for action in live_chat_continuation['actions']: + if 'replayChatItemAction' in action: + replay_chat_item_action = action['replayChatItemAction'] + offset = int(replay_chat_item_action['videoOffsetTimeMsec']) + processed_fragment.extend( + json.dumps(action, ensure_ascii=False).encode('utf-8') + b'\n') + continuation_id = live_chat_continuation['continuations'][0]['liveChatReplayContinuationData']['continuation'] + + self._append_fragment(ctx, processed_fragment) + + if test or offset is None: + break + + self._finish_frag_download(ctx) + + return True diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index b35bf03aa..e554702e7 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1462,6 +1462,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'ext': ext, }) sub_lang_list[lang] = sub_formats + # TODO check that live chat replay actually exists + sub_lang_list['live_chat'] = [ + { + 'video_id': video_id, + 'ext': 'json', + 'protocol': 'youtube_live_chat_replay', + }, + ] if not sub_lang_list: self._downloader.report_warning('video doesn\'t have subtitles') return {} From 321bf820c577f34593ff0462775e43875c8d886d Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 03:30:10 +0300 Subject: [PATCH 003/112] check live chat replay existence --- youtube_dl/YoutubeDL.py | 7 +++--- youtube_dl/extractor/youtube.py | 39 ++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index f9aa91f30..1b8a938e5 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1838,10 +1838,11 @@ class YoutubeDL(object): return else: try: - # TODO does this transfer session...? - # TODO exceptions dl(sub_filename, sub_info) - except (ExtractorError, IOError, OSError, ValueError) as err: + except ( + ExtractorError, IOError, OSError, ValueError, + compat_urllib_error.URLError, + compat_http_client.HTTPException, socket.error) as err: self.report_warning('Unable to download subtitle for "%s": %s' % (sub_lang, error_to_compat_str(err))) continue diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index e554702e7..782aba6ff 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1435,7 +1435,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): raise ExtractorError( 'Signature extraction failed: ' + tb, cause=e) - def _get_subtitles(self, video_id, webpage): + def _get_subtitles(self, video_id, webpage, is_live_content): try: subs_doc = self._download_xml( 'https://video.google.com/timedtext?hl=en&type=list&v=%s' % video_id, @@ -1462,14 +1462,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'ext': ext, }) sub_lang_list[lang] = sub_formats - # TODO check that live chat replay actually exists - sub_lang_list['live_chat'] = [ - { - 'video_id': video_id, - 'ext': 'json', - 'protocol': 'youtube_live_chat_replay', - }, - ] + if is_live_content: + sub_lang_list['live_chat'] = [ + { + 'video_id': video_id, + 'ext': 'json', + 'protocol': 'youtube_live_chat_replay', + }, + ] if not sub_lang_list: self._downloader.report_warning('video doesn\'t have subtitles') return {} @@ -1493,6 +1493,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor): return self._parse_json( uppercase_escape(config), video_id, fatal=False) + def _get_yt_initial_data(self, video_id, webpage): + config = self._search_regex( + r'window\["ytInitialData"\]\s*=\s*(.*);', + webpage, 'ytInitialData', default=None) + if config: + return self._parse_json( + uppercase_escape(config), video_id, fatal=False) + def _get_automatic_captions(self, video_id, webpage): """We need the webpage for getting the captions url, pass it as an argument to speed up the process.""" @@ -1992,6 +2000,16 @@ class YoutubeIE(YoutubeBaseInfoExtractor): if is_live is None: is_live = bool_or_none(video_details.get('isLive')) + has_live_chat_replay = False + is_live_content = bool_or_none(video_details.get('isLiveContent')) + if not is_live and is_live_content: + yt_initial_data = self._get_yt_initial_data(video_id, video_webpage) + try: + yt_initial_data['contents']['twoColumnWatchNextResults']['conversationBar']['liveChatRenderer']['continuations'][0]['reloadContinuationData']['continuation'] + has_live_chat_replay = True + except (KeyError, IndexError): + pass + # Check for "rental" videos if 'ypc_video_rental_bar_text' in video_info and 'author' not in video_info: raise ExtractorError('"rental" videos not supported. See https://github.com/ytdl-org/youtube-dl/issues/359 for more information.', expected=True) @@ -2399,7 +2417,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor): or try_get(video_info, lambda x: float_or_none(x['avg_rating'][0]))) # subtitles - video_subtitles = self.extract_subtitles(video_id, video_webpage) + video_subtitles = self.extract_subtitles( + video_id, video_webpage, has_live_chat_replay) automatic_captions = self.extract_automatic_captions(video_id, video_webpage) video_duration = try_get( From 7627f548e6de828114e4841385c75a73c0911506 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 03:38:07 +0300 Subject: [PATCH 004/112] run flake8 --- youtube_dl/YoutubeDL.py | 9 ++++----- youtube_dl/downloader/youtube_live_chat.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 1b8a938e5..0dc869d56 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1820,7 +1820,6 @@ class YoutubeDL(object): # subtitles download errors are already managed as troubles in relevant IE # that way it will silently go on when used with unsupporting IE subtitles = info_dict['requested_subtitles'] - ie = self.get_info_extractor(info_dict['extractor_key']) for sub_lang, sub_info in subtitles.items(): sub_format = sub_info['ext'] sub_filename = subtitles_filename(filename, sub_lang, sub_format, info_dict.get('ext')) @@ -1839,10 +1838,10 @@ class YoutubeDL(object): else: try: dl(sub_filename, sub_info) - except ( - ExtractorError, IOError, OSError, ValueError, - compat_urllib_error.URLError, - compat_http_client.HTTPException, socket.error) as err: + except (ExtractorError, IOError, OSError, ValueError, + compat_urllib_error.URLError, + compat_http_client.HTTPException, + socket.error) as err: self.report_warning('Unable to download subtitle for "%s": %s' % (sub_lang, error_to_compat_str(err))) continue diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py index 64d1d20b2..214a37203 100644 --- a/youtube_dl/downloader/youtube_live_chat.py +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -28,7 +28,7 @@ class YoutubeLiveChatReplayFD(FragmentFD): return self._download_fragment(ctx, url, info_dict, headers) def parse_yt_initial_data(data): - raw_json = re.search(b'window\["ytInitialData"\]\s*=\s*(.*);', data).group(1) + raw_json = re.search(rb'window\["ytInitialData"\]\s*=\s*(.*);', data).group(1) return json.loads(raw_json) self._prepare_and_start_frag_download(ctx) From f96f5ddad956bca6481280e293ea221410aac56b Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 04:04:36 +0300 Subject: [PATCH 005/112] rename variable --- youtube_dl/extractor/youtube.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 782aba6ff..feb80f7f4 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1435,7 +1435,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): raise ExtractorError( 'Signature extraction failed: ' + tb, cause=e) - def _get_subtitles(self, video_id, webpage, is_live_content): + def _get_subtitles(self, video_id, webpage, has_live_chat_replay): try: subs_doc = self._download_xml( 'https://video.google.com/timedtext?hl=en&type=list&v=%s' % video_id, @@ -1462,7 +1462,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'ext': ext, }) sub_lang_list[lang] = sub_formats - if is_live_content: + if has_live_chat_replay: sub_lang_list['live_chat'] = [ { 'video_id': video_id, From 7cd9e2a05ff71999eb620618366eb1cc53ac48cd Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 04:14:25 +0300 Subject: [PATCH 006/112] attempt to fix syntax error on older python --- youtube_dl/downloader/youtube_live_chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py index 214a37203..e7eb4bbfe 100644 --- a/youtube_dl/downloader/youtube_live_chat.py +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -28,7 +28,7 @@ class YoutubeLiveChatReplayFD(FragmentFD): return self._download_fragment(ctx, url, info_dict, headers) def parse_yt_initial_data(data): - raw_json = re.search(rb'window\["ytInitialData"\]\s*=\s*(.*);', data).group(1) + raw_json = re.search(b'window\\["ytInitialData"\\]\s*=\\s*(.*);', data).group(1) return json.loads(raw_json) self._prepare_and_start_frag_download(ctx) From 88a68db03e616fc8e6d2684ffbfadeb64dd93cfb Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 04:19:44 +0300 Subject: [PATCH 007/112] flake8 --- youtube_dl/downloader/youtube_live_chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py index e7eb4bbfe..f7478c336 100644 --- a/youtube_dl/downloader/youtube_live_chat.py +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -28,7 +28,7 @@ class YoutubeLiveChatReplayFD(FragmentFD): return self._download_fragment(ctx, url, info_dict, headers) def parse_yt_initial_data(data): - raw_json = re.search(b'window\\["ytInitialData"\\]\s*=\\s*(.*);', data).group(1) + raw_json = re.search(b'window\\["ytInitialData"\\]\\s*=\\s*(.*);', data).group(1) return json.loads(raw_json) self._prepare_and_start_frag_download(ctx) From f0f76a33dc0e5a3f495a05293b1db4ceab5c3029 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Wed, 5 Aug 2020 23:29:41 +0300 Subject: [PATCH 008/112] fix premiere live chat They have isLiveContent = false so just check if the live chat renderer continuation exists --- youtube_dl/extractor/youtube.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index feb80f7f4..d6c35fab4 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -2001,13 +2001,12 @@ class YoutubeIE(YoutubeBaseInfoExtractor): is_live = bool_or_none(video_details.get('isLive')) has_live_chat_replay = False - is_live_content = bool_or_none(video_details.get('isLiveContent')) - if not is_live and is_live_content: + if not is_live: yt_initial_data = self._get_yt_initial_data(video_id, video_webpage) try: yt_initial_data['contents']['twoColumnWatchNextResults']['conversationBar']['liveChatRenderer']['continuations'][0]['reloadContinuationData']['continuation'] has_live_chat_replay = True - except (KeyError, IndexError): + except (KeyError, IndexError, TypeError): pass # Check for "rental" videos From eaedbfd97e860214399b0028fc47a487762e8294 Mon Sep 17 00:00:00 2001 From: siikamiika Date: Tue, 11 Aug 2020 00:05:32 +0300 Subject: [PATCH 009/112] fix ytInitialData parsing --- youtube_dl/downloader/youtube_live_chat.py | 10 ++++++++-- youtube_dl/extractor/youtube.py | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py index f7478c336..697e52550 100644 --- a/youtube_dl/downloader/youtube_live_chat.py +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -28,8 +28,14 @@ class YoutubeLiveChatReplayFD(FragmentFD): return self._download_fragment(ctx, url, info_dict, headers) def parse_yt_initial_data(data): - raw_json = re.search(b'window\\["ytInitialData"\\]\\s*=\\s*(.*);', data).group(1) - return json.loads(raw_json) + window_patt = b'window\\["ytInitialData"\\]\\s*=\\s*(.*?);' + var_patt = b'var\\s+ytInitialData\\s*=\\s*(.*?);' + for patt in window_patt, var_patt: + try: + raw_json = re.search(patt, data).group(1) + return json.loads(raw_json) + except AttributeError: + continue self._prepare_and_start_frag_download(ctx) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index d6c35fab4..e143bbee7 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1495,7 +1495,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor): def _get_yt_initial_data(self, video_id, webpage): config = self._search_regex( - r'window\["ytInitialData"\]\s*=\s*(.*);', + (r'window\["ytInitialData"\]\s*=\s*(.*);', + r'var\s+ytInitialData\s*=\s*(.*?);'), webpage, 'ytInitialData', default=None) if config: return self._parse_json( From 15eae44d74c80cca29cd5b24129585ad2d1e535f Mon Sep 17 00:00:00 2001 From: siikamiika Date: Tue, 11 Aug 2020 00:13:43 +0300 Subject: [PATCH 010/112] harden regex with lookbehind --- youtube_dl/downloader/youtube_live_chat.py | 4 ++-- youtube_dl/extractor/youtube.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py index 697e52550..4932dd9c5 100644 --- a/youtube_dl/downloader/youtube_live_chat.py +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -28,8 +28,8 @@ class YoutubeLiveChatReplayFD(FragmentFD): return self._download_fragment(ctx, url, info_dict, headers) def parse_yt_initial_data(data): - window_patt = b'window\\["ytInitialData"\\]\\s*=\\s*(.*?);' - var_patt = b'var\\s+ytInitialData\\s*=\\s*(.*?);' + window_patt = b'window\\["ytInitialData"\\]\\s*=\\s*(.*?)(?<=});' + var_patt = b'var\\s+ytInitialData\\s*=\\s*(.*?)(?<=});' for patt in window_patt, var_patt: try: raw_json = re.search(patt, data).group(1) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index e143bbee7..9fff8bdf4 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1495,8 +1495,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor): def _get_yt_initial_data(self, video_id, webpage): config = self._search_regex( - (r'window\["ytInitialData"\]\s*=\s*(.*);', - r'var\s+ytInitialData\s*=\s*(.*?);'), + (r'window\["ytInitialData"\]\s*=\s*(.*?)(?<=});', + r'var\s+ytInitialData\s*=\s*(.*?)(?<=});'), webpage, 'ytInitialData', default=None) if config: return self._parse_json( From c8598bbe2690a6c5450fca757654b06820fccb35 Mon Sep 17 00:00:00 2001 From: Tom-Oliver Heidel Date: Mon, 31 Aug 2020 18:56:46 +0200 Subject: [PATCH 011/112] change travis ci in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 45326c69e..8c1a50141 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/ytdl-org/youtube-dl.svg?branch=master)](https://travis-ci.org/ytdl-org/youtube-dl) +[![Build Status](https://travis-ci.com/blackjack4494/youtube-dlc.svg?branch=master)](https://travis-ci.com/blackjack4494/youtube-dlc) youtube-dl - download videos from youtube.com or other video platforms From 87570c15073dd1f53604ea5860cac3501d7cdf6b Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 31 Aug 2020 19:06:56 +0200 Subject: [PATCH 012/112] simple bat for win binary --- make_win.bat | 1 + 1 file changed, 1 insertion(+) create mode 100644 make_win.bat diff --git a/make_win.bat b/make_win.bat new file mode 100644 index 000000000..a1f692e17 --- /dev/null +++ b/make_win.bat @@ -0,0 +1 @@ +pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dlc \ No newline at end of file From d59e0e44ad0f89963744d6cba35639dcf6372747 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 31 Aug 2020 19:47:33 +0200 Subject: [PATCH 013/112] [skip travis] change travic build config removed download tests for now. most of them failed anyway resulting in travis running for quite long time. --- .travis.yml | 14 +------------ .travis.yml.original | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 .travis.yml.original diff --git a/.travis.yml b/.travis.yml index 51afd469a..fb499845e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,29 +12,18 @@ python: dist: trusty env: - YTDL_TEST_SET=core - - YTDL_TEST_SET=download jobs: include: - python: 3.7 dist: xenial env: YTDL_TEST_SET=core - - python: 3.7 - dist: xenial - env: YTDL_TEST_SET=download - python: 3.8 dist: xenial env: YTDL_TEST_SET=core - - python: 3.8 - dist: xenial - env: YTDL_TEST_SET=download - - python: 3.8-dev - dist: xenial - env: YTDL_TEST_SET=core - python: 3.8-dev dist: xenial - env: YTDL_TEST_SET=download + env: YTDL_TEST_SET=core - env: JYTHON=true; YTDL_TEST_SET=core - - env: JYTHON=true; YTDL_TEST_SET=download - name: flake8 python: 3.8 dist: xenial @@ -44,7 +33,6 @@ jobs: allow_failures: - env: YTDL_TEST_SET=download - env: JYTHON=true; YTDL_TEST_SET=core - - env: JYTHON=true; YTDL_TEST_SET=download before_install: - if [ "$JYTHON" == "true" ]; then ./devscripts/install_jython.sh; export PATH="$HOME/jython/bin:$PATH"; fi script: ./devscripts/run_tests.sh diff --git a/.travis.yml.original b/.travis.yml.original new file mode 100644 index 000000000..51afd469a --- /dev/null +++ b/.travis.yml.original @@ -0,0 +1,50 @@ +language: python +python: + - "2.6" + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + - "3.6" + - "pypy" + - "pypy3" +dist: trusty +env: + - YTDL_TEST_SET=core + - YTDL_TEST_SET=download +jobs: + include: + - python: 3.7 + dist: xenial + env: YTDL_TEST_SET=core + - python: 3.7 + dist: xenial + env: YTDL_TEST_SET=download + - python: 3.8 + dist: xenial + env: YTDL_TEST_SET=core + - python: 3.8 + dist: xenial + env: YTDL_TEST_SET=download + - python: 3.8-dev + dist: xenial + env: YTDL_TEST_SET=core + - python: 3.8-dev + dist: xenial + env: YTDL_TEST_SET=download + - env: JYTHON=true; YTDL_TEST_SET=core + - env: JYTHON=true; YTDL_TEST_SET=download + - name: flake8 + python: 3.8 + dist: xenial + install: pip install flake8 + script: flake8 . + fast_finish: true + allow_failures: + - env: YTDL_TEST_SET=download + - env: JYTHON=true; YTDL_TEST_SET=core + - env: JYTHON=true; YTDL_TEST_SET=download +before_install: + - if [ "$JYTHON" == "true" ]; then ./devscripts/install_jython.sh; export PATH="$HOME/jython/bin:$PATH"; fi +script: ./devscripts/run_tests.sh From ab8151e95bd6fa14ec6685a2cf3415e89063b5b9 Mon Sep 17 00:00:00 2001 From: Tom-Oliver Heidel Date: Mon, 31 Aug 2020 21:48:54 +0200 Subject: [PATCH 014/112] [skip travis] publish to pypi when pull request got merged into release branch --- .github/workflows/python-publish.yml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 000000000..0fa2d1857 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,33 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + pull_request: + branches: + - release + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + rm -rf dist/* + python setup.py sdist bdist_wheel + twine upload dist/* From 94a538facba6ac4e1cd10f07a4240971352c1c74 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 31 Aug 2020 21:52:23 +0200 Subject: [PATCH 015/112] [skip travis] update setup and version --- setup.py | 127 ++++++++++++------------------------ setup_original.py | 148 ++++++++++++++++++++++++++++++++++++++++++ youtube_dl/version.py | 2 +- 3 files changed, 190 insertions(+), 87 deletions(-) create mode 100644 setup_original.py diff --git a/setup.py b/setup.py index af68b485e..23553b88a 100644 --- a/setup.py +++ b/setup.py @@ -1,62 +1,21 @@ #!/usr/bin/env python # coding: utf-8 -from __future__ import print_function - +from setuptools import setup, Command import os.path import warnings import sys - -try: - from setuptools import setup, Command - setuptools_available = True -except ImportError: - from distutils.core import setup, Command - setuptools_available = False from distutils.spawn import spawn -try: - # This will create an exe that needs Microsoft Visual C++ 2008 - # Redistributable Package - import py2exe -except ImportError: - if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': - print('Cannot import py2exe', file=sys.stderr) - exit(1) - -py2exe_options = { - 'bundle_files': 1, - 'compressed': 1, - 'optimize': 2, - 'dist_dir': '.', - 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'], -} - # Get the version from youtube_dl/version.py without importing the package exec(compile(open('youtube_dl/version.py').read(), 'youtube_dl/version.py', 'exec')) -DESCRIPTION = 'YouTube video downloader' -LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites' - -py2exe_console = [{ - 'script': './youtube_dl/__main__.py', - 'dest_base': 'youtube-dl', - 'version': __version__, - 'description': DESCRIPTION, - 'comments': LONG_DESCRIPTION, - 'product_name': 'youtube-dl', - 'product_version': __version__, -}] - -py2exe_params = { - 'console': py2exe_console, - 'options': {'py2exe': py2exe_options}, - 'zipfile': None -} +DESCRIPTION = 'Media downloader supporting various sites such as youtube' +LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites. Based on a more active community fork.' if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': - params = py2exe_params + print("inv") else: files_spec = [ ('etc/bash_completion.d', ['youtube-dl.bash-completion']), @@ -78,10 +37,10 @@ else: params = { 'data_files': data_files, } - if setuptools_available: - params['entry_points'] = {'console_scripts': ['youtube-dl = youtube_dl:main']} - else: - params['scripts'] = ['bin/youtube-dl'] + #if setuptools_available: + params['entry_points'] = {'console_scripts': ['youtube-dlc = youtube_dl:main']} + #else: + # params['scripts'] = ['bin/youtube-dlc'] class build_lazy_extractors(Command): description = 'Build the extractor lazy loading module' @@ -100,49 +59,45 @@ class build_lazy_extractors(Command): ) setup( - name='youtube_dl', + name="youtube_dlc", version=__version__, + maintainer="Tom-Oliver Heidel", + maintainer_email="theidel@uni-bremen.de", description=DESCRIPTION, long_description=LONG_DESCRIPTION, - url='https://github.com/ytdl-org/youtube-dl', - author='Ricardo Garcia', - author_email='ytdl@yt-dl.org', - maintainer='Sergey M.', - maintainer_email='dstftw@gmail.com', - license='Unlicense', - packages=[ + # long_description_content_type="text/markdown", + url="https://github.com/blackjack4494/youtube-dlc", + # packages=setuptools.find_packages(), + packages=[ 'youtube_dl', 'youtube_dl.extractor', 'youtube_dl.downloader', 'youtube_dl.postprocessor'], - - # Provokes warning on most systems (why?!) - # test_suite = 'nose.collector', - # test_requires = ['nosetest'], - classifiers=[ - 'Topic :: Multimedia :: Video', - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'License :: Public Domain', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: Implementation', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: IronPython', - 'Programming Language :: Python :: Implementation :: Jython', - 'Programming Language :: Python :: Implementation :: PyPy', + "Topic :: Multimedia :: Video", + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.2", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: Implementation", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: IronPython", + "Programming Language :: Python :: Implementation :: Jython", + "Programming Language :: Python :: Implementation :: PyPy", + "License :: Public Domain", + "Operating System :: OS Independent", ], - - cmdclass={'build_lazy_extractors': build_lazy_extractors}, + python_requires='>=2.6', + + cmdclass={'build_lazy_extractors': build_lazy_extractors}, **params -) +) \ No newline at end of file diff --git a/setup_original.py b/setup_original.py new file mode 100644 index 000000000..4138e7924 --- /dev/null +++ b/setup_original.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python +# coding: utf-8 + +from __future__ import print_function + +import os.path +import warnings +import sys + +try: + from setuptools import setup, Command + setuptools_available = True +except ImportError: + from distutils.core import setup, Command + setuptools_available = False +from distutils.spawn import spawn + +try: + # This will create an exe that needs Microsoft Visual C++ 2008 + # Redistributable Package + import py2exe +except ImportError: + if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': + print('Cannot import py2exe', file=sys.stderr) + exit(1) + +py2exe_options = { + 'bundle_files': 1, + 'compressed': 1, + 'optimize': 2, + 'dist_dir': '.', + 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'], +} + +# Get the version from youtube_dl/version.py without importing the package +exec(compile(open('youtube_dl/version.py').read(), + 'youtube_dl/version.py', 'exec')) + +DESCRIPTION = 'Media downloader supporting various sites such as youtube' +LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites. Based on a more active community fork.' + +py2exe_console = [{ + 'script': './youtube_dl/__main__.py', + 'dest_base': 'youtube-dl', + 'version': __version__, + 'description': DESCRIPTION, + 'comments': LONG_DESCRIPTION, + 'product_name': 'youtube-dlc', + 'product_version': __version__, +}] + +py2exe_params = { + 'console': py2exe_console, + 'options': {'py2exe': py2exe_options}, + 'zipfile': None +} + +if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': + params = py2exe_params +else: + files_spec = [ + ('etc/bash_completion.d', ['youtube-dl.bash-completion']), + ('etc/fish/completions', ['youtube-dl.fish']), + ('share/doc/youtube_dl', ['README.txt']), + ('share/man/man1', ['youtube-dl.1']) + ] + root = os.path.dirname(os.path.abspath(__file__)) + data_files = [] + for dirname, files in files_spec: + resfiles = [] + for fn in files: + if not os.path.exists(fn): + warnings.warn('Skipping file %s since it is not present. Type make to build all automatically generated files.' % fn) + else: + resfiles.append(fn) + data_files.append((dirname, resfiles)) + + params = { + 'data_files': data_files, + } + if setuptools_available: + params['entry_points'] = {'console_scripts': ['youtube-dl = youtube_dl:main']} + else: + params['scripts'] = ['bin/youtube-dl'] + +class build_lazy_extractors(Command): + description = 'Build the extractor lazy loading module' + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + spawn( + [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'], + dry_run=self.dry_run, + ) + +setup( + name='youtube_dlc', + version=__version__, + description=DESCRIPTION, + long_description=LONG_DESCRIPTION, + url='https://github.com/blackjack4494/youtube-dlc', + author='', + author_email='theidel@uni-bremen.de', + maintainer='Tom-Oliver Heidel', + maintainer_email='theidel@uni-bremen.de', + license='Unlicense', + packages=[ + 'youtube_dl', + 'youtube_dl.extractor', 'youtube_dl.downloader', + 'youtube_dl.postprocessor'], + + # Provokes warning on most systems (why?!) + # test_suite = 'nose.collector', + # test_requires = ['nosetest'], + + classifiers=[ + 'Topic :: Multimedia :: Video', + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'License :: Public Domain', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.2', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: Implementation', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: IronPython', + 'Programming Language :: Python :: Implementation :: Jython', + 'Programming Language :: Python :: Implementation :: PyPy', + ], + + cmdclass={'build_lazy_extractors': build_lazy_extractors}, + **params +) diff --git a/youtube_dl/version.py b/youtube_dl/version.py index 17101fa47..b50bd2b3b 100644 --- a/youtube_dl/version.py +++ b/youtube_dl/version.py @@ -1,3 +1,3 @@ from __future__ import unicode_literals -__version__ = '2020.07.28' +__version__ = '2020.08.31' From d262d2e02a496ad8bc469548cf5e250778a044bd Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 31 Aug 2020 21:59:03 +0200 Subject: [PATCH 016/112] [skip travis] delete original setup --- setup_original.py | 148 ---------------------------------------------- 1 file changed, 148 deletions(-) delete mode 100644 setup_original.py diff --git a/setup_original.py b/setup_original.py deleted file mode 100644 index 4138e7924..000000000 --- a/setup_original.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 - -from __future__ import print_function - -import os.path -import warnings -import sys - -try: - from setuptools import setup, Command - setuptools_available = True -except ImportError: - from distutils.core import setup, Command - setuptools_available = False -from distutils.spawn import spawn - -try: - # This will create an exe that needs Microsoft Visual C++ 2008 - # Redistributable Package - import py2exe -except ImportError: - if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': - print('Cannot import py2exe', file=sys.stderr) - exit(1) - -py2exe_options = { - 'bundle_files': 1, - 'compressed': 1, - 'optimize': 2, - 'dist_dir': '.', - 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'], -} - -# Get the version from youtube_dl/version.py without importing the package -exec(compile(open('youtube_dl/version.py').read(), - 'youtube_dl/version.py', 'exec')) - -DESCRIPTION = 'Media downloader supporting various sites such as youtube' -LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites. Based on a more active community fork.' - -py2exe_console = [{ - 'script': './youtube_dl/__main__.py', - 'dest_base': 'youtube-dl', - 'version': __version__, - 'description': DESCRIPTION, - 'comments': LONG_DESCRIPTION, - 'product_name': 'youtube-dlc', - 'product_version': __version__, -}] - -py2exe_params = { - 'console': py2exe_console, - 'options': {'py2exe': py2exe_options}, - 'zipfile': None -} - -if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': - params = py2exe_params -else: - files_spec = [ - ('etc/bash_completion.d', ['youtube-dl.bash-completion']), - ('etc/fish/completions', ['youtube-dl.fish']), - ('share/doc/youtube_dl', ['README.txt']), - ('share/man/man1', ['youtube-dl.1']) - ] - root = os.path.dirname(os.path.abspath(__file__)) - data_files = [] - for dirname, files in files_spec: - resfiles = [] - for fn in files: - if not os.path.exists(fn): - warnings.warn('Skipping file %s since it is not present. Type make to build all automatically generated files.' % fn) - else: - resfiles.append(fn) - data_files.append((dirname, resfiles)) - - params = { - 'data_files': data_files, - } - if setuptools_available: - params['entry_points'] = {'console_scripts': ['youtube-dl = youtube_dl:main']} - else: - params['scripts'] = ['bin/youtube-dl'] - -class build_lazy_extractors(Command): - description = 'Build the extractor lazy loading module' - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - spawn( - [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'], - dry_run=self.dry_run, - ) - -setup( - name='youtube_dlc', - version=__version__, - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - url='https://github.com/blackjack4494/youtube-dlc', - author='', - author_email='theidel@uni-bremen.de', - maintainer='Tom-Oliver Heidel', - maintainer_email='theidel@uni-bremen.de', - license='Unlicense', - packages=[ - 'youtube_dl', - 'youtube_dl.extractor', 'youtube_dl.downloader', - 'youtube_dl.postprocessor'], - - # Provokes warning on most systems (why?!) - # test_suite = 'nose.collector', - # test_requires = ['nosetest'], - - classifiers=[ - 'Topic :: Multimedia :: Video', - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'License :: Public Domain', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: Implementation', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: IronPython', - 'Programming Language :: Python :: Implementation :: Jython', - 'Programming Language :: Python :: Implementation :: PyPy', - ], - - cmdclass={'build_lazy_extractors': build_lazy_extractors}, - **params -) From 4f93deaf229be9d3f398faa702e3fba21c664578 Mon Sep 17 00:00:00 2001 From: Tom-Oliver Heidel Date: Mon, 31 Aug 2020 22:23:11 +0200 Subject: [PATCH 017/112] [skip travis] tweak auto publish --- .github/workflows/python-publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 0fa2d1857..224a00230 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -4,9 +4,9 @@ name: Upload Python Package on: - pull_request: + push: branches: - - release + - release jobs: deploy: From a6c7c9c24f906c6ef2ae2d2d0abcdfe2a1a73bbd Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 31 Aug 2020 22:58:24 +0200 Subject: [PATCH 018/112] [skip travis] remove original travis config --- .travis.yml.original | 50 -------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 .travis.yml.original diff --git a/.travis.yml.original b/.travis.yml.original deleted file mode 100644 index 51afd469a..000000000 --- a/.travis.yml.original +++ /dev/null @@ -1,50 +0,0 @@ -language: python -python: - - "2.6" - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "pypy" - - "pypy3" -dist: trusty -env: - - YTDL_TEST_SET=core - - YTDL_TEST_SET=download -jobs: - include: - - python: 3.7 - dist: xenial - env: YTDL_TEST_SET=core - - python: 3.7 - dist: xenial - env: YTDL_TEST_SET=download - - python: 3.8 - dist: xenial - env: YTDL_TEST_SET=core - - python: 3.8 - dist: xenial - env: YTDL_TEST_SET=download - - python: 3.8-dev - dist: xenial - env: YTDL_TEST_SET=core - - python: 3.8-dev - dist: xenial - env: YTDL_TEST_SET=download - - env: JYTHON=true; YTDL_TEST_SET=core - - env: JYTHON=true; YTDL_TEST_SET=download - - name: flake8 - python: 3.8 - dist: xenial - install: pip install flake8 - script: flake8 . - fast_finish: true - allow_failures: - - env: YTDL_TEST_SET=download - - env: JYTHON=true; YTDL_TEST_SET=core - - env: JYTHON=true; YTDL_TEST_SET=download -before_install: - - if [ "$JYTHON" == "true" ]; then ./devscripts/install_jython.sh; export PATH="$HOME/jython/bin:$PATH"; fi -script: ./devscripts/run_tests.sh From 9ab41610b4e65e2f0758ab05247e444abf67fafa Mon Sep 17 00:00:00 2001 From: Tom-Oliver Heidel Date: Mon, 31 Aug 2020 23:12:53 +0200 Subject: [PATCH 019/112] [skip travis] update readme. --- README.md | 1042 +---------------------------------------------------- 1 file changed, 10 insertions(+), 1032 deletions(-) diff --git a/README.md b/README.md index 8c1a50141..5386a086a 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,31 @@ [![Build Status](https://travis-ci.com/blackjack4494/youtube-dlc.svg?branch=master)](https://travis-ci.com/blackjack4494/youtube-dlc) -youtube-dl - download videos from youtube.com or other video platforms +youtube-dlc - download videos from youtube.com or other video platforms - [INSTALLATION](#installation) - [DESCRIPTION](#description) - [OPTIONS](#options) -- [CONFIGURATION](#configuration) -- [OUTPUT TEMPLATE](#output-template) -- [FORMAT SELECTION](#format-selection) -- [VIDEO SELECTION](#video-selection) -- [FAQ](#faq) -- [DEVELOPER INSTRUCTIONS](#developer-instructions) -- [EMBEDDING YOUTUBE-DL](#embedding-youtube-dl) -- [BUGS](#bugs) - [COPYRIGHT](#copyright) # INSTALLATION To install it right away for all UNIX users (Linux, macOS, etc.), type: +You may want to use `python3` instead of `python` - sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl - sudo chmod a+rx /usr/local/bin/youtube-dl + python -m pip install --upgrade youtube-dlc -If you do not have curl, you can alternatively use a recent wget: +To build the Windows executable (a compiled version will be available online soon) - sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl - sudo chmod a+rx /usr/local/bin/youtube-dl - -Windows users can [download an .exe file](https://yt-dl.org/latest/youtube-dl.exe) and place it in any location on their [PATH](https://en.wikipedia.org/wiki/PATH_%28variable%29) except for `%SYSTEMROOT%\System32` (e.g. **do not** put in `C:\Windows\System32`). - -You can also use pip: - - sudo -H pip install --upgrade youtube-dl + python -m pip install --upgrade pyinstaller + pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dlc -This command will update youtube-dl if you have already installed it. See the [pypi page](https://pypi.python.org/pypi/youtube_dl) for more information. - -macOS users can install youtube-dl with [Homebrew](https://brew.sh/): - - brew install youtube-dl - -Or with [MacPorts](https://www.macports.org/): - - sudo port install youtube-dl - -Alternatively, refer to the [developer instructions](#developer-instructions) for how to check out and work with the git repository. For further options, including PGP signatures, see the [youtube-dl Download Page](https://ytdl-org.github.io/youtube-dl/download.html). +Or simply execute the `make_win.bat` if pyinstaller is installed. +There will be a `youtube-dlc.exe` in `/dist` # DESCRIPTION -**youtube-dl** is a command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.6, 2.7, or 3.2+, and it is not platform specific. It should work on your Unix box, on Windows or on macOS. It is released to the public domain, which means you can modify it, redistribute it or use it however you like. +**youtube-dlc** is a command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.6, 2.7, or 3.2+, and it is not platform specific. It should work on your Unix box, on Windows or on macOS. It is released to the public domain, which means you can modify it, redistribute it or use it however you like. - youtube-dl [OPTIONS] URL [URL...] + youtube-dlc [OPTIONS] URL [URL...] # OPTIONS -h, --help Print this help text and exit @@ -440,1005 +417,6 @@ Alternatively, refer to the [developer instructions](#developer-instructions) fo --convert-subs FORMAT Convert the subtitles to other format (currently supported: srt|ass|vtt|lrc) -# CONFIGURATION - -You can configure youtube-dl by placing any supported command line option to a configuration file. On Linux and macOS, the system wide configuration file is located at `/etc/youtube-dl.conf` and the user wide configuration file at `~/.config/youtube-dl/config`. On Windows, the user wide configuration file locations are `%APPDATA%\youtube-dl\config.txt` or `C:\Users\\youtube-dl.conf`. Note that by default configuration file may not exist so you may need to create it yourself. - -For example, with the following configuration file youtube-dl will always extract the audio, not copy the mtime, use a proxy and save all videos under `Movies` directory in your home directory: -``` -# Lines starting with # are comments - -# Always extract audio --x - -# Do not copy the mtime ---no-mtime - -# Use this proxy ---proxy 127.0.0.1:3128 - -# Save all videos under Movies directory in your home directory --o ~/Movies/%(title)s.%(ext)s -``` - -Note that options in configuration file are just the same options aka switches used in regular command line calls thus there **must be no whitespace** after `-` or `--`, e.g. `-o` or `--proxy` but not `- o` or `-- proxy`. - -You can use `--ignore-config` if you want to disable the configuration file for a particular youtube-dl run. - -You can also use `--config-location` if you want to use custom configuration file for a particular youtube-dl run. - -### Authentication with `.netrc` file - -You may also want to configure automatic credentials storage for extractors that support authentication (by providing login and password with `--username` and `--password`) in order not to pass credentials as command line arguments on every youtube-dl execution and prevent tracking plain text passwords in the shell command history. You can achieve this using a [`.netrc` file](https://stackoverflow.com/tags/.netrc/info) on a per extractor basis. For that you will need to create a `.netrc` file in your `$HOME` and restrict permissions to read/write by only you: -``` -touch $HOME/.netrc -chmod a-rwx,u+rw $HOME/.netrc -``` -After that you can add credentials for an extractor in the following format, where *extractor* is the name of the extractor in lowercase: -``` -machine login password -``` -For example: -``` -machine youtube login myaccount@gmail.com password my_youtube_password -machine twitch login my_twitch_account_name password my_twitch_password -``` -To activate authentication with the `.netrc` file you should pass `--netrc` to youtube-dl or place it in the [configuration file](#configuration). - -On Windows you may also need to setup the `%HOME%` environment variable manually. For example: -``` -set HOME=%USERPROFILE% -``` - -# OUTPUT TEMPLATE - -The `-o` option allows users to indicate a template for the output file names. - -**tl;dr:** [navigate me to examples](#output-template-examples). - -The basic usage is not to set any template arguments when downloading a single file, like in `youtube-dl -o funny_video.flv "https://some/video"`. However, it may contain special sequences that will be replaced when downloading each video. The special sequences may be formatted according to [python string formatting operations](https://docs.python.org/2/library/stdtypes.html#string-formatting). For example, `%(NAME)s` or `%(NAME)05d`. To clarify, that is a percent symbol followed by a name in parentheses, followed by formatting operations. Allowed names along with sequence type are: - - - `id` (string): Video identifier - - `title` (string): Video title - - `url` (string): Video URL - - `ext` (string): Video filename extension - - `alt_title` (string): A secondary title of the video - - `display_id` (string): An alternative identifier for the video - - `uploader` (string): Full name of the video uploader - - `license` (string): License name the video is licensed under - - `creator` (string): The creator of the video - - `release_date` (string): The date (YYYYMMDD) when the video was released - - `timestamp` (numeric): UNIX timestamp of the moment the video became available - - `upload_date` (string): Video upload date (YYYYMMDD) - - `uploader_id` (string): Nickname or id of the video uploader - - `channel` (string): Full name of the channel the video is uploaded on - - `channel_id` (string): Id of the channel - - `location` (string): Physical location where the video was filmed - - `duration` (numeric): Length of the video in seconds - - `view_count` (numeric): How many users have watched the video on the platform - - `like_count` (numeric): Number of positive ratings of the video - - `dislike_count` (numeric): Number of negative ratings of the video - - `repost_count` (numeric): Number of reposts of the video - - `average_rating` (numeric): Average rating give by users, the scale used depends on the webpage - - `comment_count` (numeric): Number of comments on the video - - `age_limit` (numeric): Age restriction for the video (years) - - `is_live` (boolean): Whether this video is a live stream or a fixed-length video - - `start_time` (numeric): Time in seconds where the reproduction should start, as specified in the URL - - `end_time` (numeric): Time in seconds where the reproduction should end, as specified in the URL - - `format` (string): A human-readable description of the format - - `format_id` (string): Format code specified by `--format` - - `format_note` (string): Additional info about the format - - `width` (numeric): Width of the video - - `height` (numeric): Height of the video - - `resolution` (string): Textual description of width and height - - `tbr` (numeric): Average bitrate of audio and video in KBit/s - - `abr` (numeric): Average audio bitrate in KBit/s - - `acodec` (string): Name of the audio codec in use - - `asr` (numeric): Audio sampling rate in Hertz - - `vbr` (numeric): Average video bitrate in KBit/s - - `fps` (numeric): Frame rate - - `vcodec` (string): Name of the video codec in use - - `container` (string): Name of the container format - - `filesize` (numeric): The number of bytes, if known in advance - - `filesize_approx` (numeric): An estimate for the number of bytes - - `protocol` (string): The protocol that will be used for the actual download - - `extractor` (string): Name of the extractor - - `extractor_key` (string): Key name of the extractor - - `epoch` (numeric): Unix epoch when creating the file - - `autonumber` (numeric): Five-digit number that will be increased with each download, starting at zero - - `playlist` (string): Name or id of the playlist that contains the video - - `playlist_index` (numeric): Index of the video in the playlist padded with leading zeros according to the total length of the playlist - - `playlist_id` (string): Playlist identifier - - `playlist_title` (string): Playlist title - - `playlist_uploader` (string): Full name of the playlist uploader - - `playlist_uploader_id` (string): Nickname or id of the playlist uploader - -Available for the video that belongs to some logical chapter or section: - - - `chapter` (string): Name or title of the chapter the video belongs to - - `chapter_number` (numeric): Number of the chapter the video belongs to - - `chapter_id` (string): Id of the chapter the video belongs to - -Available for the video that is an episode of some series or programme: - - - `series` (string): Title of the series or programme the video episode belongs to - - `season` (string): Title of the season the video episode belongs to - - `season_number` (numeric): Number of the season the video episode belongs to - - `season_id` (string): Id of the season the video episode belongs to - - `episode` (string): Title of the video episode - - `episode_number` (numeric): Number of the video episode within a season - - `episode_id` (string): Id of the video episode - -Available for the media that is a track or a part of a music album: - - - `track` (string): Title of the track - - `track_number` (numeric): Number of the track within an album or a disc - - `track_id` (string): Id of the track - - `artist` (string): Artist(s) of the track - - `genre` (string): Genre(s) of the track - - `album` (string): Title of the album the track belongs to - - `album_type` (string): Type of the album - - `album_artist` (string): List of all artists appeared on the album - - `disc_number` (numeric): Number of the disc or other physical medium the track belongs to - - `release_year` (numeric): Year (YYYY) when the album was released - -Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. Note that some of the sequences are not guaranteed to be present since they depend on the metadata obtained by a particular extractor. Such sequences will be replaced with `NA`. - -For example for `-o %(title)s-%(id)s.%(ext)s` and an mp4 video with title `youtube-dl test video` and id `BaW_jenozKcj`, this will result in a `youtube-dl test video-BaW_jenozKcj.mp4` file created in the current directory. - -For numeric sequences you can use numeric related formatting, for example, `%(view_count)05d` will result in a string with view count padded with zeros up to 5 characters, like in `00042`. - -Output templates can also contain arbitrary hierarchical path, e.g. `-o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s'` which will result in downloading each video in a directory corresponding to this path template. Any missing directory will be automatically created for you. - -To use percent literals in an output template use `%%`. To output to stdout use `-o -`. - -The current default template is `%(title)s-%(id)s.%(ext)s`. - -In some cases, you don't want special characters such as 中, spaces, or &, such as when transferring the downloaded filename to a Windows system or the filename through an 8bit-unsafe channel. In these cases, add the `--restrict-filenames` flag to get a shorter title: - -#### Output template and Windows batch files - -If you are using an output template inside a Windows batch file then you must escape plain percent characters (`%`) by doubling, so that `-o "%(title)s-%(id)s.%(ext)s"` should become `-o "%%(title)s-%%(id)s.%%(ext)s"`. However you should not touch `%`'s that are not plain characters, e.g. environment variables for expansion should stay intact: `-o "C:\%HOMEPATH%\Desktop\%%(title)s.%%(ext)s"`. - -#### Output template examples - -Note that on Windows you may need to use double quotes instead of single. - -```bash -$ youtube-dl --get-filename -o '%(title)s.%(ext)s' BaW_jenozKc -youtube-dl test video ''_ä↭𝕐.mp4 # All kinds of weird characters - -$ youtube-dl --get-filename -o '%(title)s.%(ext)s' BaW_jenozKc --restrict-filenames -youtube-dl_test_video_.mp4 # A simple file name - -# Download YouTube playlist videos in separate directory indexed by video order in a playlist -$ youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re - -# Download all playlists of YouTube channel/user keeping each playlist in separate directory: -$ youtube-dl -o '%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/user/TheLinuxFoundation/playlists - -# Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home -$ youtube-dl -u user -p password -o '~/MyVideos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/java-tutorial/ - -# Download entire series season keeping each series and each season in separate directory under C:/MyVideos -$ youtube-dl -o "C:/MyVideos/%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" https://videomore.ru/kino_v_detalayah/5_sezon/367617 - -# Stream the video being downloaded to stdout -$ youtube-dl -o - BaW_jenozKc -``` - -# FORMAT SELECTION - -By default youtube-dl tries to download the best available quality, i.e. if you want the best quality you **don't need** to pass any special options, youtube-dl will guess it for you by **default**. - -But sometimes you may want to download in a different format, for example when you are on a slow or intermittent connection. The key mechanism for achieving this is so-called *format selection* based on which you can explicitly specify desired format, select formats based on some criterion or criteria, setup precedence and much more. - -The general syntax for format selection is `--format FORMAT` or shorter `-f FORMAT` where `FORMAT` is a *selector expression*, i.e. an expression that describes format or formats you would like to download. - -**tl;dr:** [navigate me to examples](#format-selection-examples). - -The simplest case is requesting a specific format, for example with `-f 22` you can download the format with format code equal to 22. You can get the list of available format codes for particular video using `--list-formats` or `-F`. Note that these format codes are extractor specific. - -You can also use a file extension (currently `3gp`, `aac`, `flv`, `m4a`, `mp3`, `mp4`, `ogg`, `wav`, `webm` are supported) to download the best quality format of a particular file extension served as a single file, e.g. `-f webm` will download the best quality format with the `webm` extension served as a single file. - -You can also use special names to select particular edge case formats: - - - `best`: Select the best quality format represented by a single file with video and audio. - - `worst`: Select the worst quality format represented by a single file with video and audio. - - `bestvideo`: Select the best quality video-only format (e.g. DASH video). May not be available. - - `worstvideo`: Select the worst quality video-only format. May not be available. - - `bestaudio`: Select the best quality audio only-format. May not be available. - - `worstaudio`: Select the worst quality audio only-format. May not be available. - -For example, to download the worst quality video-only format you can use `-f worstvideo`. - -If you want to download multiple videos and they don't have the same formats available, you can specify the order of preference using slashes. Note that slash is left-associative, i.e. formats on the left hand side are preferred, for example `-f 22/17/18` will download format 22 if it's available, otherwise it will download format 17 if it's available, otherwise it will download format 18 if it's available, otherwise it will complain that no suitable formats are available for download. - -If you want to download several formats of the same video use a comma as a separator, e.g. `-f 22,17,18` will download all these three formats, of course if they are available. Or a more sophisticated example combined with the precedence feature: `-f 136/137/mp4/bestvideo,140/m4a/bestaudio`. - -You can also filter the video formats by putting a condition in brackets, as in `-f "best[height=720]"` (or `-f "[filesize>10M]"`). - -The following numeric meta fields can be used with comparisons `<`, `<=`, `>`, `>=`, `=` (equals), `!=` (not equals): - - - `filesize`: The number of bytes, if known in advance - - `width`: Width of the video, if known - - `height`: Height of the video, if known - - `tbr`: Average bitrate of audio and video in KBit/s - - `abr`: Average audio bitrate in KBit/s - - `vbr`: Average video bitrate in KBit/s - - `asr`: Audio sampling rate in Hertz - - `fps`: Frame rate - -Also filtering work for comparisons `=` (equals), `^=` (starts with), `$=` (ends with), `*=` (contains) and following string meta fields: - - - `ext`: File extension - - `acodec`: Name of the audio codec in use - - `vcodec`: Name of the video codec in use - - `container`: Name of the container format - - `protocol`: The protocol that will be used for the actual download, lower-case (`http`, `https`, `rtsp`, `rtmp`, `rtmpe`, `mms`, `f4m`, `ism`, `http_dash_segments`, `m3u8`, or `m3u8_native`) - - `format_id`: A short description of the format - -Any string comparison may be prefixed with negation `!` in order to produce an opposite comparison, e.g. `!*=` (does not contain). - -Note that none of the aforementioned meta fields are guaranteed to be present since this solely depends on the metadata obtained by particular extractor, i.e. the metadata offered by the video hoster. - -Formats for which the value is not known are excluded unless you put a question mark (`?`) after the operator. You can combine format filters, so `-f "[height <=? 720][tbr>500]"` selects up to 720p videos (or videos where the height is not known) with a bitrate of at least 500 KBit/s. - -You can merge the video and audio of two formats into a single file using `-f +` (requires ffmpeg or avconv installed), for example `-f bestvideo+bestaudio` will download the best video-only format, the best audio-only format and mux them together with ffmpeg/avconv. - -Format selectors can also be grouped using parentheses, for example if you want to download the best mp4 and webm formats with a height lower than 480 you can use `-f '(mp4,webm)[height<480]'`. - -Since the end of April 2015 and version 2015.04.26, youtube-dl uses `-f bestvideo+bestaudio/best` as the default format selection (see [#5447](https://github.com/ytdl-org/youtube-dl/issues/5447), [#5456](https://github.com/ytdl-org/youtube-dl/issues/5456)). If ffmpeg or avconv are installed this results in downloading `bestvideo` and `bestaudio` separately and muxing them together into a single file giving the best overall quality available. Otherwise it falls back to `best` and results in downloading the best available quality served as a single file. `best` is also needed for videos that don't come from YouTube because they don't provide the audio and video in two different files. If you want to only download some DASH formats (for example if you are not interested in getting videos with a resolution higher than 1080p), you can add `-f bestvideo[height<=?1080]+bestaudio/best` to your configuration file. Note that if you use youtube-dl to stream to `stdout` (and most likely to pipe it to your media player then), i.e. you explicitly specify output template as `-o -`, youtube-dl still uses `-f best` format selection in order to start content delivery immediately to your player and not to wait until `bestvideo` and `bestaudio` are downloaded and muxed. - -If you want to preserve the old format selection behavior (prior to youtube-dl 2015.04.26), i.e. you want to download the best available quality media served as a single file, you should explicitly specify your choice with `-f best`. You may want to add it to the [configuration file](#configuration) in order not to type it every time you run youtube-dl. - -#### Format selection examples - -Note that on Windows you may need to use double quotes instead of single. - -```bash -# Download best mp4 format available or any other best if no mp4 available -$ youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' - -# Download best format available but no better than 480p -$ youtube-dl -f 'bestvideo[height<=480]+bestaudio/best[height<=480]' - -# Download best video only format but no bigger than 50 MB -$ youtube-dl -f 'best[filesize<50M]' - -# Download best format available via direct link over HTTP/HTTPS protocol -$ youtube-dl -f '(bestvideo+bestaudio/best)[protocol^=http]' - -# Download the best video format and the best audio format without merging them -$ youtube-dl -f 'bestvideo,bestaudio' -o '%(title)s.f%(format_id)s.%(ext)s' -``` -Note that in the last example, an output template is recommended as bestvideo and bestaudio may have the same file name. - - -# VIDEO SELECTION - -Videos can be filtered by their upload date using the options `--date`, `--datebefore` or `--dateafter`. They accept dates in two formats: - - - Absolute dates: Dates in the format `YYYYMMDD`. - - Relative dates: Dates in the format `(now|today)[+-][0-9](day|week|month|year)(s)?` - -Examples: - -```bash -# Download only the videos uploaded in the last 6 months -$ youtube-dl --dateafter now-6months - -# Download only the videos uploaded on January 1, 1970 -$ youtube-dl --date 19700101 - -$ # Download only the videos uploaded in the 200x decade -$ youtube-dl --dateafter 20000101 --datebefore 20091231 -``` - -# FAQ - -### How do I update youtube-dl? - -If you've followed [our manual installation instructions](https://ytdl-org.github.io/youtube-dl/download.html), you can simply run `youtube-dl -U` (or, on Linux, `sudo youtube-dl -U`). - -If you have used pip, a simple `sudo pip install -U youtube-dl` is sufficient to update. - -If you have installed youtube-dl using a package manager like *apt-get* or *yum*, use the standard system update mechanism to update. Note that distribution packages are often outdated. As a rule of thumb, youtube-dl releases at least once a month, and often weekly or even daily. Simply go to https://yt-dl.org to find out the current version. Unfortunately, there is nothing we youtube-dl developers can do if your distribution serves a really outdated version. You can (and should) complain to your distribution in their bugtracker or support forum. - -As a last resort, you can also uninstall the version installed by your package manager and follow our manual installation instructions. For that, remove the distribution's package, with a line like - - sudo apt-get remove -y youtube-dl - -Afterwards, simply follow [our manual installation instructions](https://ytdl-org.github.io/youtube-dl/download.html): - -``` -sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl -sudo chmod a+rx /usr/local/bin/youtube-dl -hash -r -``` - -Again, from then on you'll be able to update with `sudo youtube-dl -U`. - -### youtube-dl is extremely slow to start on Windows - -Add a file exclusion for `youtube-dl.exe` in Windows Defender settings. - -### I'm getting an error `Unable to extract OpenGraph title` on YouTube playlists - -YouTube changed their playlist format in March 2014 and later on, so you'll need at least youtube-dl 2014.07.25 to download all YouTube videos. - -If you have installed youtube-dl with a package manager, pip, setup.py or a tarball, please use that to update. Note that Ubuntu packages do not seem to get updated anymore. Since we are not affiliated with Ubuntu, there is little we can do. Feel free to [report bugs](https://bugs.launchpad.net/ubuntu/+source/youtube-dl/+filebug) to the [Ubuntu packaging people](mailto:ubuntu-motu@lists.ubuntu.com?subject=outdated%20version%20of%20youtube-dl) - all they have to do is update the package to a somewhat recent version. See above for a way to update. - -### I'm getting an error when trying to use output template: `error: using output template conflicts with using title, video ID or auto number` - -Make sure you are not using `-o` with any of these options `-t`, `--title`, `--id`, `-A` or `--auto-number` set in command line or in a configuration file. Remove the latter if any. - -### Do I always have to pass `-citw`? - -By default, youtube-dl intends to have the best options (incidentally, if you have a convincing case that these should be different, [please file an issue where you explain that](https://yt-dl.org/bug)). Therefore, it is unnecessary and sometimes harmful to copy long option strings from webpages. In particular, the only option out of `-citw` that is regularly useful is `-i`. - -### Can you please put the `-b` option back? - -Most people asking this question are not aware that youtube-dl now defaults to downloading the highest available quality as reported by YouTube, which will be 1080p or 720p in some cases, so you no longer need the `-b` option. For some specific videos, maybe YouTube does not report them to be available in a specific high quality format you're interested in. In that case, simply request it with the `-f` option and youtube-dl will try to download it. - -### I get HTTP error 402 when trying to download a video. What's this? - -Apparently YouTube requires you to pass a CAPTCHA test if you download too much. We're [considering to provide a way to let you solve the CAPTCHA](https://github.com/ytdl-org/youtube-dl/issues/154), but at the moment, your best course of action is pointing a web browser to the youtube URL, solving the CAPTCHA, and restart youtube-dl. - -### Do I need any other programs? - -youtube-dl works fine on its own on most sites. However, if you want to convert video/audio, you'll need [avconv](https://libav.org/) or [ffmpeg](https://www.ffmpeg.org/). On some sites - most notably YouTube - videos can be retrieved in a higher quality format without sound. youtube-dl will detect whether avconv/ffmpeg is present and automatically pick the best option. - -Videos or video formats streamed via RTMP protocol can only be downloaded when [rtmpdump](https://rtmpdump.mplayerhq.hu/) is installed. Downloading MMS and RTSP videos requires either [mplayer](https://mplayerhq.hu/) or [mpv](https://mpv.io/) to be installed. - -### I have downloaded a video but how can I play it? - -Once the video is fully downloaded, use any video player, such as [mpv](https://mpv.io/), [vlc](https://www.videolan.org/) or [mplayer](https://www.mplayerhq.hu/). - -### I extracted a video URL with `-g`, but it does not play on another machine / in my web browser. - -It depends a lot on the service. In many cases, requests for the video (to download/play it) must come from the same IP address and with the same cookies and/or HTTP headers. Use the `--cookies` option to write the required cookies into a file, and advise your downloader to read cookies from that file. Some sites also require a common user agent to be used, use `--dump-user-agent` to see the one in use by youtube-dl. You can also get necessary cookies and HTTP headers from JSON output obtained with `--dump-json`. - -It may be beneficial to use IPv6; in some cases, the restrictions are only applied to IPv4. Some services (sometimes only for a subset of videos) do not restrict the video URL by IP address, cookie, or user-agent, but these are the exception rather than the rule. - -Please bear in mind that some URL protocols are **not** supported by browsers out of the box, including RTMP. If you are using `-g`, your own downloader must support these as well. - -If you want to play the video on a machine that is not running youtube-dl, you can relay the video content from the machine that runs youtube-dl. You can use `-o -` to let youtube-dl stream a video to stdout, or simply allow the player to download the files written by youtube-dl in turn. - -### ERROR: no fmt_url_map or conn information found in video info - -YouTube has switched to a new video info format in July 2011 which is not supported by old versions of youtube-dl. See [above](#how-do-i-update-youtube-dl) for how to update youtube-dl. - -### ERROR: unable to download video - -YouTube requires an additional signature since September 2012 which is not supported by old versions of youtube-dl. See [above](#how-do-i-update-youtube-dl) for how to update youtube-dl. - -### Video URL contains an ampersand and I'm getting some strange output `[1] 2839` or `'v' is not recognized as an internal or external command` - -That's actually the output from your shell. Since ampersand is one of the special shell characters it's interpreted by the shell preventing you from passing the whole URL to youtube-dl. To disable your shell from interpreting the ampersands (or any other special characters) you have to either put the whole URL in quotes or escape them with a backslash (which approach will work depends on your shell). - -For example if your URL is https://www.youtube.com/watch?t=4&v=BaW_jenozKc you should end up with following command: - -```youtube-dl 'https://www.youtube.com/watch?t=4&v=BaW_jenozKc'``` - -or - -```youtube-dl https://www.youtube.com/watch?t=4\&v=BaW_jenozKc``` - -For Windows you have to use the double quotes: - -```youtube-dl "https://www.youtube.com/watch?t=4&v=BaW_jenozKc"``` - -### ExtractorError: Could not find JS function u'OF' - -In February 2015, the new YouTube player contained a character sequence in a string that was misinterpreted by old versions of youtube-dl. See [above](#how-do-i-update-youtube-dl) for how to update youtube-dl. - -### HTTP Error 429: Too Many Requests or 402: Payment Required - -These two error codes indicate that the service is blocking your IP address because of overuse. Usually this is a soft block meaning that you can gain access again after solving CAPTCHA. Just open a browser and solve a CAPTCHA the service suggests you and after that [pass cookies](#how-do-i-pass-cookies-to-youtube-dl) to youtube-dl. Note that if your machine has multiple external IPs then you should also pass exactly the same IP you've used for solving CAPTCHA with [`--source-address`](#network-options). Also you may need to pass a `User-Agent` HTTP header of your browser with [`--user-agent`](#workarounds). - -If this is not the case (no CAPTCHA suggested to solve by the service) then you can contact the service and ask them to unblock your IP address, or - if you have acquired a whitelisted IP address already - use the [`--proxy` or `--source-address` options](#network-options) to select another IP address. - -### SyntaxError: Non-ASCII character - -The error - - File "youtube-dl", line 2 - SyntaxError: Non-ASCII character '\x93' ... - -means you're using an outdated version of Python. Please update to Python 2.6 or 2.7. - -### What is this binary file? Where has the code gone? - -Since June 2012 ([#342](https://github.com/ytdl-org/youtube-dl/issues/342)) youtube-dl is packed as an executable zipfile, simply unzip it (might need renaming to `youtube-dl.zip` first on some systems) or clone the git repository, as laid out above. If you modify the code, you can run it by executing the `__main__.py` file. To recompile the executable, run `make youtube-dl`. - -### The exe throws an error due to missing `MSVCR100.dll` - -To run the exe you need to install first the [Microsoft Visual C++ 2010 Redistributable Package (x86)](https://www.microsoft.com/en-US/download/details.aspx?id=5555). - -### On Windows, how should I set up ffmpeg and youtube-dl? Where should I put the exe files? - -If you put youtube-dl and ffmpeg in the same directory that you're running the command from, it will work, but that's rather cumbersome. - -To make a different directory work - either for ffmpeg, or for youtube-dl, or for both - simply create the directory (say, `C:\bin`, or `C:\Users\\bin`), put all the executables directly in there, and then [set your PATH environment variable](https://www.java.com/en/download/help/path.xml) to include that directory. - -From then on, after restarting your shell, you will be able to access both youtube-dl and ffmpeg (and youtube-dl will be able to find ffmpeg) by simply typing `youtube-dl` or `ffmpeg`, no matter what directory you're in. - -### How do I put downloads into a specific folder? - -Use the `-o` to specify an [output template](#output-template), for example `-o "/home/user/videos/%(title)s-%(id)s.%(ext)s"`. If you want this for all of your downloads, put the option into your [configuration file](#configuration). - -### How do I download a video starting with a `-`? - -Either prepend `https://www.youtube.com/watch?v=` or separate the ID from the options with `--`: - - youtube-dl -- -wNyEUrxzFU - youtube-dl "https://www.youtube.com/watch?v=-wNyEUrxzFU" - -### How do I pass cookies to youtube-dl? - -Use the `--cookies` option, for example `--cookies /path/to/cookies/file.txt`. - -In order to extract cookies from browser use any conforming browser extension for exporting cookies. For example, [cookies.txt](https://chrome.google.com/webstore/detail/cookiestxt/njabckikapfpffapmjgojcnbfjonfjfg) (for Chrome) or [cookies.txt](https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/) (for Firefox). - -Note that the cookies file must be in Mozilla/Netscape format and the first line of the cookies file must be either `# HTTP Cookie File` or `# Netscape HTTP Cookie File`. Make sure you have correct [newline format](https://en.wikipedia.org/wiki/Newline) in the cookies file and convert newlines if necessary to correspond with your OS, namely `CRLF` (`\r\n`) for Windows and `LF` (`\n`) for Unix and Unix-like systems (Linux, macOS, etc.). `HTTP Error 400: Bad Request` when using `--cookies` is a good sign of invalid newline format. - -Passing cookies to youtube-dl is a good way to workaround login when a particular extractor does not implement it explicitly. Another use case is working around [CAPTCHA](https://en.wikipedia.org/wiki/CAPTCHA) some websites require you to solve in particular cases in order to get access (e.g. YouTube, CloudFlare). - -### How do I stream directly to media player? - -You will first need to tell youtube-dl to stream media to stdout with `-o -`, and also tell your media player to read from stdin (it must be capable of this for streaming) and then pipe former to latter. For example, streaming to [vlc](https://www.videolan.org/) can be achieved with: - - youtube-dl -o - "https://www.youtube.com/watch?v=BaW_jenozKcj" | vlc - - -### How do I download only new videos from a playlist? - -Use download-archive feature. With this feature you should initially download the complete playlist with `--download-archive /path/to/download/archive/file.txt` that will record identifiers of all the videos in a special file. Each subsequent run with the same `--download-archive` will download only new videos and skip all videos that have been downloaded before. Note that only successful downloads are recorded in the file. - -For example, at first, - - youtube-dl --download-archive archive.txt "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" - -will download the complete `PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re` playlist and create a file `archive.txt`. Each subsequent run will only download new videos if any: - - youtube-dl --download-archive archive.txt "https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re" - -### Should I add `--hls-prefer-native` into my config? - -When youtube-dl detects an HLS video, it can download it either with the built-in downloader or ffmpeg. Since many HLS streams are slightly invalid and ffmpeg/youtube-dl each handle some invalid cases better than the other, there is an option to switch the downloader if needed. - -When youtube-dl knows that one particular downloader works better for a given website, that downloader will be picked. Otherwise, youtube-dl will pick the best downloader for general compatibility, which at the moment happens to be ffmpeg. This choice may change in future versions of youtube-dl, with improvements of the built-in downloader and/or ffmpeg. - -In particular, the generic extractor (used when your website is not in the [list of supported sites by youtube-dl](https://ytdl-org.github.io/youtube-dl/supportedsites.html) cannot mandate one specific downloader. - -If you put either `--hls-prefer-native` or `--hls-prefer-ffmpeg` into your configuration, a different subset of videos will fail to download correctly. Instead, it is much better to [file an issue](https://yt-dl.org/bug) or a pull request which details why the native or the ffmpeg HLS downloader is a better choice for your use case. - -### Can you add support for this anime video site, or site which shows current movies for free? - -As a matter of policy (as well as legality), youtube-dl does not include support for services that specialize in infringing copyright. As a rule of thumb, if you cannot easily find a video that the service is quite obviously allowed to distribute (i.e. that has been uploaded by the creator, the creator's distributor, or is published under a free license), the service is probably unfit for inclusion to youtube-dl. - -A note on the service that they don't host the infringing content, but just link to those who do, is evidence that the service should **not** be included into youtube-dl. The same goes for any DMCA note when the whole front page of the service is filled with videos they are not allowed to distribute. A "fair use" note is equally unconvincing if the service shows copyright-protected videos in full without authorization. - -Support requests for services that **do** purchase the rights to distribute their content are perfectly fine though. If in doubt, you can simply include a source that mentions the legitimate purchase of content. - -### How can I speed up work on my issue? - -(Also known as: Help, my important issue not being solved!) The youtube-dl core developer team is quite small. While we do our best to solve as many issues as possible, sometimes that can take quite a while. To speed up your issue, here's what you can do: - -First of all, please do report the issue [at our issue tracker](https://yt-dl.org/bugs). That allows us to coordinate all efforts by users and developers, and serves as a unified point. Unfortunately, the youtube-dl project has grown too large to use personal email as an effective communication channel. - -Please read the [bug reporting instructions](#bugs) below. A lot of bugs lack all the necessary information. If you can, offer proxy, VPN, or shell access to the youtube-dl developers. If you are able to, test the issue from multiple computers in multiple countries to exclude local censorship or misconfiguration issues. - -If nobody is interested in solving your issue, you are welcome to take matters into your own hands and submit a pull request (or coerce/pay somebody else to do so). - -Feel free to bump the issue from time to time by writing a small comment ("Issue is still present in youtube-dl version ...from France, but fixed from Belgium"), but please not more than once a month. Please do not declare your issue as `important` or `urgent`. - -### How can I detect whether a given URL is supported by youtube-dl? - -For one, have a look at the [list of supported sites](docs/supportedsites.md). Note that it can sometimes happen that the site changes its URL scheme (say, from https://example.com/video/1234567 to https://example.com/v/1234567 ) and youtube-dl reports an URL of a service in that list as unsupported. In that case, simply report a bug. - -It is *not* possible to detect whether a URL is supported or not. That's because youtube-dl contains a generic extractor which matches **all** URLs. You may be tempted to disable, exclude, or remove the generic extractor, but the generic extractor not only allows users to extract videos from lots of websites that embed a video from another service, but may also be used to extract video from a service that it's hosting itself. Therefore, we neither recommend nor support disabling, excluding, or removing the generic extractor. - -If you want to find out whether a given URL is supported, simply call youtube-dl with it. If you get no videos back, chances are the URL is either not referring to a video or unsupported. You can find out which by examining the output (if you run youtube-dl on the console) or catching an `UnsupportedError` exception if you run it from a Python program. - -# Why do I need to go through that much red tape when filing bugs? - -Before we had the issue template, despite our extensive [bug reporting instructions](#bugs), about 80% of the issue reports we got were useless, for instance because people used ancient versions hundreds of releases old, because of simple syntactic errors (not in youtube-dl but in general shell usage), because the problem was already reported multiple times before, because people did not actually read an error message, even if it said "please install ffmpeg", because people did not mention the URL they were trying to download and many more simple, easy-to-avoid problems, many of whom were totally unrelated to youtube-dl. - -youtube-dl is an open-source project manned by too few volunteers, so we'd rather spend time fixing bugs where we are certain none of those simple problems apply, and where we can be reasonably confident to be able to reproduce the issue without asking the reporter repeatedly. As such, the output of `youtube-dl -v YOUR_URL_HERE` is really all that's required to file an issue. The issue template also guides you through some basic steps you can do, such as checking that your version of youtube-dl is current. - -# DEVELOPER INSTRUCTIONS - -Most users do not need to build youtube-dl and can [download the builds](https://ytdl-org.github.io/youtube-dl/download.html) or get them from their distribution. - -To run youtube-dl as a developer, you don't need to build anything either. Simply execute - - python -m youtube_dl - -To run the test, simply invoke your favorite test runner, or execute a test file directly; any of the following work: - - python -m unittest discover - python test/test_download.py - nosetests - -See item 6 of [new extractor tutorial](#adding-support-for-a-new-site) for how to run extractor specific test cases. - -If you want to create a build of youtube-dl yourself, you'll need - -* python -* make (only GNU make is supported) -* pandoc -* zip -* nosetests - -### Adding support for a new site - -If you want to add support for a new site, first of all **make sure** this site is **not dedicated to [copyright infringement](README.md#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. youtube-dl does **not support** such sites thus pull requests adding support for them **will be rejected**. - -After you have ensured this site is distributing its content legally, you can follow this quick list (assuming your service is called `yourextractor`): - -1. [Fork this repository](https://github.com/ytdl-org/youtube-dl/fork) -2. Check out the source code with: - - git clone git@github.com:YOUR_GITHUB_USERNAME/youtube-dl.git - -3. Start a new git branch with - - cd youtube-dl - git checkout -b yourextractor - -4. Start with this simple template and save it to `youtube_dl/extractor/yourextractor.py`: - - ```python - # coding: utf-8 - from __future__ import unicode_literals - - from .common import InfoExtractor - - - class YourExtractorIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?yourextractor\.com/watch/(?P[0-9]+)' - _TEST = { - 'url': 'https://yourextractor.com/watch/42', - 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', - 'info_dict': { - 'id': '42', - 'ext': 'mp4', - 'title': 'Video title goes here', - 'thumbnail': r're:^https?://.*\.jpg$', - # TODO more properties, either as: - # * A value - # * MD5 checksum; start the string with md5: - # * A regular expression; start the string with re: - # * Any Python type (for example int or float) - } - } - - def _real_extract(self, url): - video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) - - # TODO more code goes here, for example ... - title = self._html_search_regex(r'

(.+?)

', webpage, 'title') - - return { - 'id': video_id, - 'title': title, - 'description': self._og_search_description(webpage), - 'uploader': self._search_regex(r']+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), - # TODO more properties (see youtube_dl/extractor/common.py) - } - ``` -5. Add an import in [`youtube_dl/extractor/extractors.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/extractors.py). -6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. Note that tests with `only_matching` key in test's dict are not counted in. -7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303). Add tests and code for as many as you want. -8. Make sure your code follows [youtube-dl coding conventions](#youtube-dl-coding-conventions) and check the code with [flake8](https://flake8.pycqa.org/en/latest/index.html#quickstart): - - $ flake8 youtube_dl/extractor/yourextractor.py - -9. Make sure your code works under all [Python](https://www.python.org/) versions claimed supported by youtube-dl, namely 2.6, 2.7, and 3.2+. -10. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files and [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this: - - $ git add youtube_dl/extractor/extractors.py - $ git add youtube_dl/extractor/yourextractor.py - $ git commit -m '[yourextractor] Add new extractor' - $ git push origin yourextractor - -11. Finally, [create a pull request](https://help.github.com/articles/creating-a-pull-request). We'll then review and merge it. - -In any case, thank you very much for your contributions! - -## youtube-dl coding conventions - -This section introduces a guide lines for writing idiomatic, robust and future-proof extractor code. - -Extractors are very fragile by nature since they depend on the layout of the source data provided by 3rd party media hosters out of your control and this layout tends to change. As an extractor implementer your task is not only to write code that will extract media links and metadata correctly but also to minimize dependency on the source's layout and even to make the code foresee potential future changes and be ready for that. This is important because it will allow the extractor not to break on minor layout changes thus keeping old youtube-dl versions working. Even though this breakage issue is easily fixed by emitting a new version of youtube-dl with a fix incorporated, all the previous versions become broken in all repositories and distros' packages that may not be so prompt in fetching the update from us. Needless to say, some non rolling release distros may never receive an update at all. - -### Mandatory and optional metafields - -For extraction to work youtube-dl relies on metadata your extractor extracts and provides to youtube-dl expressed by an [information dictionary](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L94-L303) or simply *info dict*. Only the following meta fields in the *info dict* are considered mandatory for a successful extraction process by youtube-dl: - - - `id` (media identifier) - - `title` (media title) - - `url` (media download URL) or `formats` - -In fact only the last option is technically mandatory (i.e. if you can't figure out the download location of the media the extraction does not make any sense). But by convention youtube-dl also treats `id` and `title` as mandatory. Thus the aforementioned metafields are the critical data that the extraction does not make any sense without and if any of them fail to be extracted then the extractor is considered completely broken. - -[Any field](https://github.com/ytdl-org/youtube-dl/blob/7f41a598b3fba1bcab2817de64a08941200aa3c8/youtube_dl/extractor/common.py#L188-L303) apart from the aforementioned ones are considered **optional**. That means that extraction should be **tolerant** to situations when sources for these fields can potentially be unavailable (even if they are always available at the moment) and **future-proof** in order not to break the extraction of general purpose mandatory fields. - -#### Example - -Say you have some source dictionary `meta` that you've fetched as JSON with HTTP request and it has a key `summary`: - -```python -meta = self._download_json(url, video_id) -``` - -Assume at this point `meta`'s layout is: - -```python -{ - ... - "summary": "some fancy summary text", - ... -} -``` - -Assume you want to extract `summary` and put it into the resulting info dict as `description`. Since `description` is an optional meta field you should be ready that this key may be missing from the `meta` dict, so that you should extract it like: - -```python -description = meta.get('summary') # correct -``` - -and not like: - -```python -description = meta['summary'] # incorrect -``` - -The latter will break extraction process with `KeyError` if `summary` disappears from `meta` at some later time but with the former approach extraction will just go ahead with `description` set to `None` which is perfectly fine (remember `None` is equivalent to the absence of data). - -Similarly, you should pass `fatal=False` when extracting optional data from a webpage with `_search_regex`, `_html_search_regex` or similar methods, for instance: - -```python -description = self._search_regex( - r']+id="title"[^>]*>([^<]+)<', - webpage, 'description', fatal=False) -``` - -With `fatal` set to `False` if `_search_regex` fails to extract `description` it will emit a warning and continue extraction. - -You can also pass `default=`, for example: - -```python -description = self._search_regex( - r']+id="title"[^>]*>([^<]+)<', - webpage, 'description', default=None) -``` - -On failure this code will silently continue the extraction with `description` set to `None`. That is useful for metafields that may or may not be present. - -### Provide fallbacks - -When extracting metadata try to do so from multiple sources. For example if `title` is present in several places, try extracting from at least some of them. This makes it more future-proof in case some of the sources become unavailable. - -#### Example - -Say `meta` from the previous example has a `title` and you are about to extract it. Since `title` is a mandatory meta field you should end up with something like: - -```python -title = meta['title'] -``` - -If `title` disappears from `meta` in future due to some changes on the hoster's side the extraction would fail since `title` is mandatory. That's expected. - -Assume that you have some another source you can extract `title` from, for example `og:title` HTML meta of a `webpage`. In this case you can provide a fallback scenario: - -```python -title = meta.get('title') or self._og_search_title(webpage) -``` - -This code will try to extract from `meta` first and if it fails it will try extracting `og:title` from a `webpage`. - -### Regular expressions - -#### Don't capture groups you don't use - -Capturing group must be an indication that it's used somewhere in the code. Any group that is not used must be non capturing. - -##### Example - -Don't capture id attribute name here since you can't use it for anything anyway. - -Correct: - -```python -r'(?:id|ID)=(?P\d+)' -``` - -Incorrect: -```python -r'(id|ID)=(?P\d+)' -``` - - -#### Make regular expressions relaxed and flexible - -When using regular expressions try to write them fuzzy, relaxed and flexible, skipping insignificant parts that are more likely to change, allowing both single and double quotes for quoted values and so on. - -##### Example - -Say you need to extract `title` from the following HTML code: - -```html -some fancy title -``` - -The code for that task should look similar to: - -```python -title = self._search_regex( - r']+class="title"[^>]*>([^<]+)', webpage, 'title') -``` - -Or even better: - -```python -title = self._search_regex( - r']+class=(["\'])title\1[^>]*>(?P[^<]+)', - webpage, 'title', group='title') -``` - -Note how you tolerate potential changes in the `style` attribute's value or switch from using double quotes to single for `class` attribute: - -The code definitely should not look like: - -```python -title = self._search_regex( - r'<span style="position: absolute; left: 910px; width: 90px; float: right; z-index: 9999;" class="title">(.*?)</span>', - webpage, 'title', group='title') -``` - -### Long lines policy - -There is a soft limit to keep lines of code under 80 characters long. This means it should be respected if possible and if it does not make readability and code maintenance worse. - -For example, you should **never** split long string literals like URLs or some other often copied entities over multiple lines to fit this limit: - -Correct: - -```python -'https://www.youtube.com/watch?v=FqZTN594JQw&list=PLMYEtVRpaqY00V9W81Cwmzp6N6vZqfUKD4' -``` - -Incorrect: - -```python -'https://www.youtube.com/watch?v=FqZTN594JQw&list=' -'PLMYEtVRpaqY00V9W81Cwmzp6N6vZqfUKD4' -``` - -### Inline values - -Extracting variables is acceptable for reducing code duplication and improving readability of complex expressions. However, you should avoid extracting variables used only once and moving them to opposite parts of the extractor file, which makes reading the linear flow difficult. - -#### Example - -Correct: - -```python -title = self._html_search_regex(r'<title>([^<]+)', webpage, 'title') -``` - -Incorrect: - -```python -TITLE_RE = r'([^<]+)' -# ...some lines of code... -title = self._html_search_regex(TITLE_RE, webpage, 'title') -``` - -### Collapse fallbacks - -Multiple fallback values can quickly become unwieldy. Collapse multiple fallback values into a single expression via a list of patterns. - -#### Example - -Good: - -```python -description = self._html_search_meta( - ['og:description', 'description', 'twitter:description'], - webpage, 'description', default=None) -``` - -Unwieldy: - -```python -description = ( - self._og_search_description(webpage, default=None) - or self._html_search_meta('description', webpage, default=None) - or self._html_search_meta('twitter:description', webpage, default=None)) -``` - -Methods supporting list of patterns are: `_search_regex`, `_html_search_regex`, `_og_search_property`, `_html_search_meta`. - -### Trailing parentheses - -Always move trailing parentheses after the last argument. - -#### Example - -Correct: - -```python - lambda x: x['ResultSet']['Result'][0]['VideoUrlSet']['VideoUrl'], - list) -``` - -Incorrect: - -```python - lambda x: x['ResultSet']['Result'][0]['VideoUrlSet']['VideoUrl'], - list, -) -``` - -### Use convenience conversion and parsing functions - -Wrap all extracted numeric data into safe functions from [`youtube_dl/utils.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/utils.py): `int_or_none`, `float_or_none`. Use them for string to number conversions as well. - -Use `url_or_none` for safe URL processing. - -Use `try_get` for safe metadata extraction from parsed JSON. - -Use `unified_strdate` for uniform `upload_date` or any `YYYYMMDD` meta field extraction, `unified_timestamp` for uniform `timestamp` extraction, `parse_filesize` for `filesize` extraction, `parse_count` for count meta fields extraction, `parse_resolution`, `parse_duration` for `duration` extraction, `parse_age_limit` for `age_limit` extraction. - -Explore [`youtube_dl/utils.py`](https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/utils.py) for more useful convenience functions. - -#### More examples - -##### Safely extract optional description from parsed JSON -```python -description = try_get(response, lambda x: x['result']['video'][0]['summary'], compat_str) -``` - -##### Safely extract more optional metadata -```python -video = try_get(response, lambda x: x['result']['video'][0], dict) or {} -description = video.get('summary') -duration = float_or_none(video.get('durationMs'), scale=1000) -view_count = int_or_none(video.get('views')) -``` - -# EMBEDDING YOUTUBE-DL - -youtube-dl makes the best effort to be a good command-line program, and thus should be callable from any programming language. If you encounter any problems parsing its output, feel free to [create a report](https://github.com/ytdl-org/youtube-dl/issues/new). - -From a Python program, you can embed youtube-dl in a more powerful fashion, like this: - -```python -from __future__ import unicode_literals -import youtube_dl - -ydl_opts = {} -with youtube_dl.YoutubeDL(ydl_opts) as ydl: - ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc']) -``` - -Most likely, you'll want to use various options. For a list of options available, have a look at [`youtube_dl/YoutubeDL.py`](https://github.com/ytdl-org/youtube-dl/blob/3e4cedf9e8cd3157df2457df7274d0c842421945/youtube_dl/YoutubeDL.py#L137-L312). For a start, if you want to intercept youtube-dl's output, set a `logger` object. - -Here's a more complete example of a program that outputs only errors (and a short message after the download is finished), and downloads/converts the video to an mp3 file: - -```python -from __future__ import unicode_literals -import youtube_dl - - -class MyLogger(object): - def debug(self, msg): - pass - - def warning(self, msg): - pass - - def error(self, msg): - print(msg) - - -def my_hook(d): - if d['status'] == 'finished': - print('Done downloading, now converting ...') - - -ydl_opts = { - 'format': 'bestaudio/best', - 'postprocessors': [{ - 'key': 'FFmpegExtractAudio', - 'preferredcodec': 'mp3', - 'preferredquality': '192', - }], - 'logger': MyLogger(), - 'progress_hooks': [my_hook], -} -with youtube_dl.YoutubeDL(ydl_opts) as ydl: - ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc']) -``` - -# BUGS - -Bugs and suggestions should be reported at: . Unless you were prompted to or there is another pertinent reason (e.g. GitHub fails to accept the bug report), please do not send bug reports via personal email. For discussions, join us in the IRC channel [#youtube-dl](irc://chat.freenode.net/#youtube-dl) on freenode ([webchat](https://webchat.freenode.net/?randomnick=1&channels=youtube-dl)). - -**Please include the full output of youtube-dl when run with `-v`**, i.e. **add** `-v` flag to **your command line**, copy the **whole** output and post it in the issue body wrapped in \`\`\` for better formatting. It should look similar to this: -``` -$ youtube-dl -v -[debug] System config: [] -[debug] User config: [] -[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=BaW_jenozKcj'] -[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 -[debug] youtube-dl version 2015.12.06 -[debug] Git HEAD: 135392e -[debug] Python version 2.6.6 - Windows-2003Server-5.2.3790-SP2 -[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 -[debug] Proxy map: {} -... -``` -**Do not post screenshots of verbose logs; only plain text is acceptable.** - -The output (including the first lines) contains important debugging information. Issues without the full output are often not reproducible and therefore do not get solved in short order, if ever. - -Please re-read your issue once again to avoid a couple of common mistakes (you can and should use this as a checklist): - -### Is the description of the issue itself sufficient? - -We often get issue reports that we cannot really decipher. While in most cases we eventually get the required information after asking back multiple times, this poses an unnecessary drain on our resources. Many contributors, including myself, are also not native speakers, so we may misread some parts. - -So please elaborate on what feature you are requesting, or what bug you want to be fixed. Make sure that it's obvious - -- What the problem is -- How it could be fixed -- How your proposed solution would look like - -If your report is shorter than two lines, it is almost certainly missing some of these, which makes it hard for us to respond to it. We're often too polite to close the issue outright, but the missing info makes misinterpretation likely. As a committer myself, I often get frustrated by these issues, since the only possible way for me to move forward on them is to ask for clarification over and over. - -For bug reports, this means that your report should contain the *complete* output of youtube-dl when called with the `-v` flag. The error message you get for (most) bugs even says so, but you would not believe how many of our bug reports do not contain this information. - -If your server has multiple IPs or you suspect censorship, adding `--call-home` may be a good idea to get more diagnostics. If the error is `ERROR: Unable to extract ...` and you cannot reproduce it from multiple countries, add `--dump-pages` (warning: this will yield a rather large output, redirect it to the file `log.txt` by adding `>log.txt 2>&1` to your command-line) or upload the `.dump` files you get when you add `--write-pages` [somewhere](https://gist.github.com/). - -**Site support requests must contain an example URL**. An example URL is a URL you might want to download, like `https://www.youtube.com/watch?v=BaW_jenozKc`. There should be an obvious video present. Except under very special circumstances, the main page of a video service (e.g. `https://www.youtube.com/`) is *not* an example URL. - -### Are you using the latest version? - -Before reporting any issue, type `youtube-dl -U`. This should report that you're up-to-date. About 20% of the reports we receive are already fixed, but people are using outdated versions. This goes for feature requests as well. - -### Is the issue already documented? - -Make sure that someone has not already opened the issue you're trying to open. Search at the top of the window or browse the [GitHub Issues](https://github.com/ytdl-org/youtube-dl/search?type=Issues) of this repository. If there is an issue, feel free to write something along the lines of "This affects me as well, with version 2015.01.01. Here is some more information on the issue: ...". While some issues may be old, a new post into them often spurs rapid activity. - -### Why are existing options not enough? - -Before requesting a new feature, please have a quick peek at [the list of supported options](https://github.com/ytdl-org/youtube-dl/blob/master/README.md#options). Many feature requests are for features that actually exist already! Please, absolutely do show off your work in the issue report and detail how the existing similar options do *not* solve your problem. - -### Is there enough context in your bug report? - -People want to solve problems, and often think they do us a favor by breaking down their larger problems (e.g. wanting to skip already downloaded files) to a specific request (e.g. requesting us to look whether the file exists before downloading the info page). However, what often happens is that they break down the problem into two steps: One simple, and one impossible (or extremely complicated one). - -We are then presented with a very complicated request when the original problem could be solved far easier, e.g. by recording the downloaded video IDs in a separate file. To avoid this, you must include the greater context where it is non-obvious. In particular, every feature request that does not consist of adding support for a new site should contain a use case scenario that explains in what situation the missing feature would be useful. - -### Does the issue involve one problem, and one problem only? - -Some of our users seem to think there is a limit of issues they can or should open. There is no limit of issues they can or should open. While it may seem appealing to be able to dump all your issues into one ticket, that means that someone who solves one of your issues cannot mark the issue as closed. Typically, reporting a bunch of issues leads to the ticket lingering since nobody wants to attack that behemoth, until someone mercifully splits the issue into multiple ones. - -In particular, every site support request issue should only pertain to services at one site (generally under a common domain, but always using the same backend technology). Do not request support for vimeo user videos, White house podcasts, and Google Plus pages in the same issue. Also, make sure that you don't post bug reports alongside feature requests. As a rule of thumb, a feature request does not include outputs of youtube-dl that are not immediately related to the feature at hand. Do not post reports of a network error alongside the request for a new video service. - -### Is anyone going to need the feature? - -Only post features that you (or an incapacitated friend you can personally talk to) require. Do not post features because they seem like a good idea. If they are really useful, they will be requested by someone who requires them. - -### Is your question about youtube-dl? - -It may sound strange, but some bug reports we receive are completely unrelated to youtube-dl and relate to a different, or even the reporter's own, application. Please make sure that you are actually using youtube-dl. If you are using a UI for youtube-dl, report the bug to the maintainer of the actual application providing the UI. On the other hand, if your UI for youtube-dl fails in some way you believe is related to youtube-dl, by all means, go ahead and report the bug. - # COPYRIGHT youtube-dl is released into the public domain by the copyright holders. From 992083bd730d7c5bd5c46dd4909346acc6357cbb Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 1 Sep 2020 00:13:39 +0200 Subject: [PATCH 020/112] [skip travis] version bump new build available - pip install youtube-dlc --- youtube_dl/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/version.py b/youtube_dl/version.py index b50bd2b3b..aea708f45 100644 --- a/youtube_dl/version.py +++ b/youtube_dl/version.py @@ -1,3 +1,3 @@ from __future__ import unicode_literals -__version__ = '2020.08.31' +__version__ = '2020.09.01' From 5f326cf54beef965f14e217ef017c6cd8b583f56 Mon Sep 17 00:00:00 2001 From: Tom-Oliver Heidel Date: Tue, 1 Sep 2020 02:24:22 +0200 Subject: [PATCH 021/112] [skip travis] added win/unix executable to readme --- README.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5386a086a..c0cab52a1 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,42 @@ youtube-dlc - download videos from youtube.com or other video platforms # INSTALLATION -To install it right away for all UNIX users (Linux, macOS, etc.), type: +**All Platforms** +Preferred way using pip: You may want to use `python3` instead of `python` python -m pip install --upgrade youtube-dlc -To build the Windows executable (a compiled version will be available online soon) +**UNIX** (Linux, macOS, etc.) +Using wget: + + sudo wget https://github.com/blackjack4494/youtube-dlc/releases/latest/download/youtube-dlc -O /usr/local/bin/youtube-dlc + sudo chmod a+rx /usr/local/bin/youtube-dlc + +Using curl: + + sudo curl -L https://github.com/blackjack4494/youtube-dlc/releases/latest/download/youtube-dlc -o /usr/local/bin/youtube-dlc + sudo chmod a+rx /usr/local/bin/youtube-dlc + + +**Windows** users can download [youtube-dlc.exe](https://github.com/blackjack4494/youtube-dlc/releases/latest/download/youtube-dlc.exe) (**do not** put in `C:\Windows\System32`!). + +**Compile** +To build the Windows executable yourself python -m pip install --upgrade pyinstaller pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dlc Or simply execute the `make_win.bat` if pyinstaller is installed. -There will be a `youtube-dlc.exe` in `/dist` +There will be a `youtube-dlc.exe` in `/dist` + +For Unix: +You will need the required build tools +python, make (GNU), pandoc, zip, nosetests +Then simply type this + + make + # DESCRIPTION **youtube-dlc** is a command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter, version 2.6, 2.7, or 3.2+, and it is not platform specific. It should work on your Unix box, on Windows or on macOS. It is released to the public domain, which means you can modify it, redistribute it or use it however you like. From a90d4f7e1051908e26a7bbc6d7ebc32339551a6b Mon Sep 17 00:00:00 2001 From: Tom-Oliver Heidel Date: Tue, 1 Sep 2020 18:55:38 +0200 Subject: [PATCH 022/112] [skip travis] added download stats badge for pypi --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c0cab52a1..9854aab92 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Build Status](https://travis-ci.com/blackjack4494/youtube-dlc.svg?branch=master)](https://travis-ci.com/blackjack4494/youtube-dlc) +[![Downloads](https://pepy.tech/badge/youtube-dlc)](https://pepy.tech/project/youtube-dlc) youtube-dlc - download videos from youtube.com or other video platforms From 9688f237163b6aa546fde00bb3fd1e3445dd4c31 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 2 Sep 2020 20:07:31 +0200 Subject: [PATCH 023/112] [skip travis] update gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index c4870a6ba..6beaa3858 100644 --- a/.gitignore +++ b/.gitignore @@ -11,12 +11,19 @@ dist/ MANIFEST README.txt youtube-dl.1 +youtube-dlc.1 youtube-dl.bash-completion +youtube-dlc.bash-completion youtube-dl.fish +youtube-dlc.fish youtube_dl/extractor/lazy_extractors.py +youtube_dlc/extractor/lazy_extractors.py youtube-dl +youtube-dlc youtube-dl.exe +youtube-dlc.exe youtube-dl.tar.gz +youtube-dlc.tar.gz .coverage cover/ updates_key.pem @@ -41,6 +48,7 @@ updates_key.pem test/local_parameters.json .tox youtube-dl.zsh +youtube-dlc.zsh # IntelliJ related files .idea From cefecac12cd3c70f9c7a30992c60b05c2eb5d34e Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 2 Sep 2020 20:25:25 +0200 Subject: [PATCH 024/112] [skip travis] renaming to avoid using same folder when using pip install for example --- MANIFEST.in | 6 +- Makefile | 84 +++---- README.md | 28 +-- devscripts/bash-completion.in | 4 +- devscripts/bash-completion.py | 6 +- devscripts/buildserver.py | 4 +- devscripts/check-porn.py | 4 +- devscripts/create-github-release.py | 6 +- devscripts/fish-completion.in | 2 +- devscripts/fish-completion.py | 10 +- devscripts/generate_aes_testdata.py | 4 +- devscripts/gh-pages/add-version.py | 6 +- devscripts/gh-pages/update-feed.py | 10 +- devscripts/gh-pages/update-sites.py | 6 +- devscripts/make_contributing.py | 2 +- devscripts/make_issue_template.py | 6 +- devscripts/make_lazy_extractors.py | 4 +- devscripts/make_supportedsites.py | 6 +- devscripts/prepare_manpage.py | 6 +- devscripts/release.sh | 22 +- devscripts/show-downloads-statistics.py | 10 +- devscripts/zsh-completion.in | 6 +- devscripts/zsh-completion.py | 6 +- docs/Makefile | 8 +- docs/conf.py | 10 +- docs/index.rst | 6 +- docs/module_guide.rst | 8 +- make_win.bat | 2 +- setup.cfg | 2 +- setup.py | 24 +- test/helper.py | 10 +- test/test_InfoExtractor.py | 8 +- test/test_YoutubeDL.py | 12 +- test/test_YoutubeDLCookieJar.py | 2 +- test/test_aes.py | 4 +- test/test_age_restriction.py | 2 +- test/test_all_urls.py | 4 +- test/test_cache.py | 2 +- test/test_compat.py | 14 +- test/test_download.py | 12 +- test/test_downloader_http.py | 8 +- test/test_execution.py | 10 +- test/test_http.py | 4 +- test/test_iqiyi_sdk_interpreter.py | 2 +- test/test_jsinterp.py | 2 +- test/test_netrc.py | 2 +- test/test_options.py | 2 +- test/test_postprocessors.py | 2 +- test/test_socks.py | 2 +- test/test_subtitles.py | 2 +- test/test_swfinterp.py | 2 +- test/test_update.py | 2 +- test/test_utils.py | 14 +- test/test_verbose_output.py | 8 +- test/test_write_annotations.py | 8 +- test/test_youtube_chapters.py | 2 +- test/test_youtube_lists.py | 2 +- test/test_youtube_signature.py | 4 +- tox.ini | 2 +- youtube-dl.plugin.zsh | 10 +- {youtube_dl => youtube_dlc}/YoutubeDL.py | 12 +- {youtube_dl => youtube_dlc}/__init__.py | 4 +- {youtube_dl => youtube_dlc}/__main__.py | 8 +- {youtube_dl => youtube_dlc}/aes.py | 0 {youtube_dl => youtube_dlc}/cache.py | 2 +- {youtube_dl => youtube_dlc}/compat.py | 2 +- .../downloader/__init__.py | 0 .../downloader/common.py | 2 +- .../downloader/dash.py | 0 .../downloader/external.py | 0 {youtube_dl => youtube_dlc}/downloader/f4m.py | 0 .../downloader/fragment.py | 4 +- {youtube_dl => youtube_dlc}/downloader/hls.py | 0 .../downloader/http.py | 0 {youtube_dl => youtube_dlc}/downloader/ism.py | 0 .../downloader/rtmp.py | 0 .../downloader/rtsp.py | 0 .../downloader/youtube_live_chat.py | 0 .../extractor/__init__.py | 0 {youtube_dl => youtube_dlc}/extractor/abc.py | 0 .../extractor/abcnews.py | 0 .../extractor/abcotvs.py | 0 .../extractor/academicearth.py | 0 .../extractor/acast.py | 0 {youtube_dl => youtube_dlc}/extractor/adn.py | 0 .../extractor/adobeconnect.py | 0 .../extractor/adobepass.py | 0 .../extractor/adobetv.py | 0 .../extractor/adultswim.py | 0 .../extractor/aenetworks.py | 0 .../extractor/afreecatv.py | 0 .../extractor/airmozilla.py | 0 .../extractor/aliexpress.py | 0 .../extractor/aljazeera.py | 0 .../extractor/allocine.py | 0 .../extractor/alphaporno.py | 0 .../extractor/amcnetworks.py | 0 .../extractor/americastestkitchen.py | 0 {youtube_dl => youtube_dlc}/extractor/amp.py | 0 .../extractor/animeondemand.py | 0 .../extractor/anvato.py | 0 {youtube_dl => youtube_dlc}/extractor/aol.py | 0 {youtube_dl => youtube_dlc}/extractor/apa.py | 0 .../extractor/aparat.py | 0 .../extractor/appleconnect.py | 0 .../extractor/appletrailers.py | 2 +- .../extractor/archiveorg.py | 0 {youtube_dl => youtube_dlc}/extractor/ard.py | 0 .../extractor/arkena.py | 0 {youtube_dl => youtube_dlc}/extractor/arte.py | 0 .../extractor/asiancrush.py | 0 .../extractor/atresplayer.py | 0 .../extractor/atttechchannel.py | 0 .../extractor/atvat.py | 0 .../extractor/audimedia.py | 0 .../extractor/audioboom.py | 0 .../extractor/audiomack.py | 0 .../extractor/awaan.py | 0 {youtube_dl => youtube_dlc}/extractor/aws.py | 0 .../extractor/azmedien.py | 0 .../extractor/baidu.py | 0 .../extractor/bandcamp.py | 4 +- {youtube_dl => youtube_dlc}/extractor/bbc.py | 0 .../extractor/beampro.py | 0 .../extractor/beatport.py | 0 {youtube_dl => youtube_dlc}/extractor/beeg.py | 0 .../extractor/behindkink.py | 0 .../extractor/bellmedia.py | 0 {youtube_dl => youtube_dlc}/extractor/bet.py | 0 {youtube_dl => youtube_dlc}/extractor/bfi.py | 0 .../extractor/bigflix.py | 0 {youtube_dl => youtube_dlc}/extractor/bild.py | 0 .../extractor/bilibili.py | 2 +- .../extractor/biobiochiletv.py | 0 .../extractor/biqle.py | 0 .../extractor/bitchute.py | 0 .../extractor/bleacherreport.py | 0 .../extractor/blinkx.py | 0 .../extractor/bloomberg.py | 0 .../extractor/bokecc.py | 0 .../extractor/bostonglobe.py | 0 {youtube_dl => youtube_dlc}/extractor/bpb.py | 0 {youtube_dl => youtube_dlc}/extractor/br.py | 0 .../extractor/bravotv.py | 0 .../extractor/breakcom.py | 0 .../extractor/brightcove.py | 0 .../extractor/businessinsider.py | 0 .../extractor/buzzfeed.py | 0 .../extractor/byutv.py | 0 {youtube_dl => youtube_dlc}/extractor/c56.py | 0 .../extractor/camdemy.py | 0 .../extractor/cammodels.py | 0 .../extractor/camtube.py | 0 .../extractor/camwithher.py | 0 .../extractor/canalc2.py | 0 .../extractor/canalplus.py | 0 .../extractor/canvas.py | 0 .../extractor/carambatv.py | 0 .../extractor/cartoonnetwork.py | 0 {youtube_dl => youtube_dlc}/extractor/cbc.py | 0 {youtube_dl => youtube_dlc}/extractor/cbs.py | 0 .../extractor/cbsinteractive.py | 0 .../extractor/cbslocal.py | 0 .../extractor/cbsnews.py | 0 .../extractor/cbssports.py | 0 {youtube_dl => youtube_dlc}/extractor/ccc.py | 0 {youtube_dl => youtube_dlc}/extractor/ccma.py | 0 {youtube_dl => youtube_dlc}/extractor/cctv.py | 0 {youtube_dl => youtube_dlc}/extractor/cda.py | 0 .../extractor/ceskatelevize.py | 0 .../extractor/channel9.py | 0 .../extractor/charlierose.py | 0 .../extractor/chaturbate.py | 0 .../extractor/chilloutzone.py | 0 .../extractor/chirbit.py | 0 .../extractor/cinchcast.py | 0 .../extractor/cinemax.py | 0 .../extractor/ciscolive.py | 0 {youtube_dl => youtube_dlc}/extractor/cjsw.py | 0 .../extractor/cliphunter.py | 0 .../extractor/clippit.py | 0 .../extractor/cliprs.py | 0 .../extractor/clipsyndicate.py | 0 .../extractor/closertotruth.py | 0 .../extractor/cloudflarestream.py | 0 .../extractor/cloudy.py | 0 .../extractor/clubic.py | 0 {youtube_dl => youtube_dlc}/extractor/clyp.py | 0 {youtube_dl => youtube_dlc}/extractor/cmt.py | 0 {youtube_dl => youtube_dlc}/extractor/cnbc.py | 0 {youtube_dl => youtube_dlc}/extractor/cnn.py | 0 .../extractor/comedycentral.py | 0 .../extractor/common.py | 4 +- .../extractor/commonmistakes.py | 4 +- .../extractor/commonprotocols.py | 0 .../extractor/condenast.py | 0 .../extractor/contv.py | 0 .../extractor/corus.py | 0 {youtube_dl => youtube_dlc}/extractor/coub.py | 0 .../extractor/cracked.py | 0 .../extractor/crackle.py | 0 .../extractor/crooksandliars.py | 0 .../extractor/crunchyroll.py | 0 .../extractor/cspan.py | 0 .../extractor/ctsnews.py | 0 .../extractor/ctvnews.py | 0 .../extractor/cultureunplugged.py | 0 .../extractor/curiositystream.py | 0 {youtube_dl => youtube_dlc}/extractor/cwtv.py | 0 .../extractor/dailymail.py | 0 .../extractor/dailymotion.py | 0 {youtube_dl => youtube_dlc}/extractor/daum.py | 0 {youtube_dl => youtube_dlc}/extractor/dbtv.py | 0 {youtube_dl => youtube_dlc}/extractor/dctp.py | 0 .../extractor/deezer.py | 0 .../extractor/defense.py | 0 .../extractor/democracynow.py | 0 {youtube_dl => youtube_dlc}/extractor/dfb.py | 0 {youtube_dl => youtube_dlc}/extractor/dhm.py | 0 {youtube_dl => youtube_dlc}/extractor/digg.py | 0 .../extractor/digiteka.py | 0 .../extractor/discovery.py | 0 .../extractor/discoverygo.py | 0 .../extractor/discoverynetworks.py | 0 .../extractor/discoveryvr.py | 0 .../extractor/disney.py | 0 .../extractor/dispeak.py | 0 .../extractor/dlive.py | 0 .../extractor/doodstream.py | 0 .../extractor/dotsub.py | 0 .../extractor/douyutv.py | 0 .../extractor/dplay.py | 0 .../extractor/drbonanza.py | 0 .../extractor/dreisat.py | 0 .../extractor/dropbox.py | 4 +- .../extractor/drtuber.py | 0 {youtube_dl => youtube_dlc}/extractor/drtv.py | 0 .../extractor/dtube.py | 0 .../extractor/dumpert.py | 0 {youtube_dl => youtube_dlc}/extractor/dvtv.py | 0 {youtube_dl => youtube_dlc}/extractor/dw.py | 0 .../extractor/eagleplatform.py | 0 .../extractor/ebaumsworld.py | 0 .../extractor/echomsk.py | 0 .../extractor/egghead.py | 0 {youtube_dl => youtube_dlc}/extractor/ehow.py | 0 .../extractor/eighttracks.py | 22 +- .../extractor/einthusan.py | 0 {youtube_dl => youtube_dlc}/extractor/eitb.py | 0 .../extractor/ellentube.py | 0 .../extractor/elpais.py | 0 .../extractor/embedly.py | 0 .../extractor/engadget.py | 0 .../extractor/eporner.py | 0 .../extractor/eroprofile.py | 0 .../extractor/escapist.py | 0 {youtube_dl => youtube_dlc}/extractor/espn.py | 0 {youtube_dl => youtube_dlc}/extractor/esri.py | 0 .../extractor/europa.py | 0 .../extractor/everyonesmixtape.py | 0 .../extractor/expotv.py | 0 .../extractor/expressen.py | 0 .../extractor/extractors.py | 0 .../extractor/extremetube.py | 0 .../extractor/eyedotv.py | 0 .../extractor/facebook.py | 0 {youtube_dl => youtube_dlc}/extractor/faz.py | 0 {youtube_dl => youtube_dlc}/extractor/fc2.py | 0 .../extractor/fczenit.py | 0 .../extractor/filmon.py | 0 .../extractor/filmweb.py | 0 .../extractor/firsttv.py | 0 .../extractor/fivemin.py | 0 .../extractor/fivetv.py | 0 .../extractor/flickr.py | 0 .../extractor/folketinget.py | 0 .../extractor/footyroom.py | 0 .../extractor/formula1.py | 0 .../extractor/fourtube.py | 0 {youtube_dl => youtube_dlc}/extractor/fox.py | 0 {youtube_dl => youtube_dlc}/extractor/fox9.py | 0 .../extractor/foxgay.py | 0 .../extractor/foxnews.py | 0 .../extractor/foxsports.py | 0 .../extractor/franceculture.py | 0 .../extractor/franceinter.py | 0 .../extractor/francetv.py | 0 .../extractor/freesound.py | 0 .../extractor/freespeech.py | 0 .../extractor/freshlive.py | 0 .../extractor/frontendmasters.py | 0 .../extractor/funimation.py | 0 {youtube_dl => youtube_dlc}/extractor/funk.py | 0 .../extractor/fusion.py | 0 .../extractor/fxnetworks.py | 0 {youtube_dl => youtube_dlc}/extractor/gaia.py | 0 .../extractor/gameinformer.py | 0 .../extractor/gamespot.py | 0 .../extractor/gamestar.py | 0 .../extractor/gaskrank.py | 0 .../extractor/gazeta.py | 0 .../extractor/gdcvault.py | 0 .../extractor/generic.py | 10 +- .../extractor/gfycat.py | 0 .../extractor/giantbomb.py | 0 {youtube_dl => youtube_dlc}/extractor/giga.py | 0 .../extractor/gigya.py | 0 .../extractor/glide.py | 0 .../extractor/globo.py | 0 {youtube_dl => youtube_dlc}/extractor/go.py | 0 .../extractor/godtube.py | 0 .../extractor/golem.py | 0 .../extractor/googledrive.py | 0 .../extractor/googleplus.py | 0 .../extractor/googlesearch.py | 0 .../extractor/goshgay.py | 0 .../extractor/gputechconf.py | 0 .../extractor/groupon.py | 0 {youtube_dl => youtube_dlc}/extractor/hbo.py | 0 .../extractor/hearthisat.py | 0 .../extractor/heise.py | 0 .../extractor/hellporno.py | 0 .../extractor/helsinki.py | 0 .../extractor/hentaistigma.py | 0 {youtube_dl => youtube_dlc}/extractor/hgtv.py | 0 .../extractor/hidive.py | 0 .../extractor/historicfilms.py | 0 .../extractor/hitbox.py | 0 .../extractor/hitrecord.py | 0 .../extractor/hketv.py | 0 .../extractor/hornbunny.py | 0 .../extractor/hotnewhiphop.py | 0 .../extractor/hotstar.py | 0 .../extractor/howcast.py | 0 .../extractor/howstuffworks.py | 0 .../extractor/hrfensehen.py | 2 +- {youtube_dl => youtube_dlc}/extractor/hrti.py | 0 .../extractor/huajiao.py | 0 .../extractor/huffpost.py | 0 .../extractor/hungama.py | 0 .../extractor/hypem.py | 0 {youtube_dl => youtube_dlc}/extractor/ign.py | 0 {youtube_dl => youtube_dlc}/extractor/imdb.py | 0 .../extractor/imggaming.py | 0 .../extractor/imgur.py | 4 +- {youtube_dl => youtube_dlc}/extractor/ina.py | 0 {youtube_dl => youtube_dlc}/extractor/inc.py | 0 .../extractor/indavideo.py | 0 .../extractor/infoq.py | 0 .../extractor/instagram.py | 0 .../extractor/internazionale.py | 0 .../extractor/internetvideoarchive.py | 0 .../extractor/iprima.py | 0 .../extractor/iqiyi.py | 0 .../extractor/ir90tv.py | 0 {youtube_dl => youtube_dlc}/extractor/itv.py | 0 {youtube_dl => youtube_dlc}/extractor/ivi.py | 2 +- .../extractor/ivideon.py | 0 .../extractor/iwara.py | 0 .../extractor/izlesene.py | 0 .../extractor/jamendo.py | 0 .../extractor/jeuxvideo.py | 0 {youtube_dl => youtube_dlc}/extractor/joj.py | 216 +++++++++--------- {youtube_dl => youtube_dlc}/extractor/jove.py | 0 .../extractor/jwplatform.py | 0 .../extractor/kakao.py | 0 .../extractor/kaltura.py | 0 .../extractor/kanalplay.py | 0 .../extractor/kankan.py | 0 .../extractor/karaoketv.py | 0 .../extractor/karrierevideos.py | 0 .../extractor/keezmovies.py | 0 .../extractor/ketnet.py | 0 .../extractor/khanacademy.py | 0 .../extractor/kickstarter.py | 0 .../extractor/kinja.py | 0 .../extractor/kinopoisk.py | 0 .../extractor/konserthusetplay.py | 0 .../extractor/krasview.py | 0 {youtube_dl => youtube_dlc}/extractor/ku6.py | 0 {youtube_dl => youtube_dlc}/extractor/kusi.py | 0 {youtube_dl => youtube_dlc}/extractor/kuwo.py | 0 {youtube_dl => youtube_dlc}/extractor/la7.py | 0 .../extractor/laola1tv.py | 0 {youtube_dl => youtube_dlc}/extractor/lci.py | 0 {youtube_dl => youtube_dlc}/extractor/lcp.py | 0 .../extractor/lecture2go.py | 0 .../extractor/lecturio.py | 0 .../extractor/leeco.py | 0 {youtube_dl => youtube_dlc}/extractor/lego.py | 0 .../extractor/lemonde.py | 0 .../extractor/lenta.py | 0 .../extractor/libraryofcongress.py | 0 .../extractor/libsyn.py | 0 .../extractor/lifenews.py | 0 .../extractor/limelight.py | 0 {youtube_dl => youtube_dlc}/extractor/line.py | 0 .../extractor/linkedin.py | 0 .../extractor/linuxacademy.py | 0 {youtube_dl => youtube_dlc}/extractor/litv.py | 0 .../extractor/livejournal.py | 0 .../extractor/liveleak.py | 0 .../extractor/livestream.py | 0 .../extractor/lnkgo.py | 0 .../extractor/localnews8.py | 0 .../extractor/lovehomeporn.py | 0 {youtube_dl => youtube_dlc}/extractor/lrt.py | 0 .../extractor/lynda.py | 0 {youtube_dl => youtube_dlc}/extractor/m6.py | 0 .../extractor/mailru.py | 0 .../extractor/malltv.py | 0 .../extractor/mangomolo.py | 0 .../extractor/manyvids.py | 0 .../extractor/markiza.py | 0 .../extractor/massengeschmacktv.py | 0 .../extractor/matchtv.py | 0 {youtube_dl => youtube_dlc}/extractor/mdr.py | 0 .../extractor/medialaan.py | 0 .../extractor/mediaset.py | 0 .../extractor/mediasite.py | 0 .../extractor/medici.py | 0 .../extractor/megaphone.py | 0 .../extractor/meipai.py | 0 .../extractor/melonvod.py | 0 {youtube_dl => youtube_dlc}/extractor/meta.py | 0 .../extractor/metacafe.py | 0 .../extractor/metacritic.py | 0 .../extractor/mgoon.py | 0 {youtube_dl => youtube_dlc}/extractor/mgtv.py | 0 .../extractor/miaopai.py | 0 .../extractor/microsoftvirtualacademy.py | 0 .../extractor/ministrygrid.py | 0 .../extractor/minoto.py | 0 .../extractor/miomio.py | 0 {youtube_dl => youtube_dlc}/extractor/mit.py | 0 .../extractor/mitele.py | 0 .../extractor/mixcloud.py | 0 {youtube_dl => youtube_dlc}/extractor/mlb.py | 0 {youtube_dl => youtube_dlc}/extractor/mnet.py | 0 .../extractor/moevideo.py | 0 .../extractor/mofosex.py | 0 .../extractor/mojvideo.py | 0 .../extractor/morningstar.py | 0 .../extractor/motherless.py | 0 .../extractor/motorsport.py | 0 .../extractor/movieclips.py | 0 .../extractor/moviezine.py | 0 .../extractor/movingimage.py | 0 {youtube_dl => youtube_dlc}/extractor/msn.py | 0 {youtube_dl => youtube_dlc}/extractor/mtv.py | 0 .../extractor/muenchentv.py | 0 .../extractor/mwave.py | 0 .../extractor/mychannels.py | 0 .../extractor/myspace.py | 0 .../extractor/myspass.py | 0 {youtube_dl => youtube_dlc}/extractor/myvi.py | 0 .../extractor/myvidster.py | 0 .../extractor/nationalgeographic.py | 0 .../extractor/naver.py | 0 {youtube_dl => youtube_dlc}/extractor/nba.py | 0 {youtube_dl => youtube_dlc}/extractor/nbc.py | 0 {youtube_dl => youtube_dlc}/extractor/ndr.py | 0 {youtube_dl => youtube_dlc}/extractor/ndtv.py | 0 .../extractor/nerdcubed.py | 0 .../extractor/neteasemusic.py | 0 .../extractor/netzkino.py | 0 .../extractor/newgrounds.py | 0 .../extractor/newstube.py | 0 .../extractor/nextmedia.py | 0 {youtube_dl => youtube_dlc}/extractor/nexx.py | 0 {youtube_dl => youtube_dlc}/extractor/nfl.py | 0 {youtube_dl => youtube_dlc}/extractor/nhk.py | 0 {youtube_dl => youtube_dlc}/extractor/nhl.py | 0 {youtube_dl => youtube_dlc}/extractor/nick.py | 0 .../extractor/niconico.py | 0 .../extractor/ninecninemedia.py | 0 .../extractor/ninegag.py | 0 .../extractor/ninenow.py | 0 .../extractor/nintendo.py | 0 .../extractor/njpwworld.py | 0 .../extractor/nobelprize.py | 0 {youtube_dl => youtube_dlc}/extractor/noco.py | 0 .../extractor/nonktube.py | 0 .../extractor/noovo.py | 0 .../extractor/normalboots.py | 0 .../extractor/nosvideo.py | 0 {youtube_dl => youtube_dlc}/extractor/nova.py | 0 .../extractor/nowness.py | 2 +- {youtube_dl => youtube_dlc}/extractor/noz.py | 0 {youtube_dl => youtube_dlc}/extractor/npo.py | 0 {youtube_dl => youtube_dlc}/extractor/npr.py | 0 {youtube_dl => youtube_dlc}/extractor/nrk.py | 0 {youtube_dl => youtube_dlc}/extractor/nrl.py | 0 .../extractor/ntvcojp.py | 0 .../extractor/ntvde.py | 0 .../extractor/ntvru.py | 0 .../extractor/nuevo.py | 0 .../extractor/nuvid.py | 0 .../extractor/nytimes.py | 0 {youtube_dl => youtube_dlc}/extractor/nzz.py | 0 .../extractor/odatv.py | 0 .../extractor/odnoklassniki.py | 0 .../extractor/oktoberfesttv.py | 0 {youtube_dl => youtube_dlc}/extractor/once.py | 0 .../extractor/ondemandkorea.py | 0 {youtube_dl => youtube_dlc}/extractor/onet.py | 0 .../extractor/onionstudios.py | 0 .../extractor/ooyala.py | 0 .../extractor/openload.py | 0 {youtube_dl => youtube_dlc}/extractor/ora.py | 0 {youtube_dl => youtube_dlc}/extractor/orf.py | 0 .../extractor/outsidetv.py | 0 .../extractor/packtpub.py | 0 .../extractor/pandoratv.py | 0 .../extractor/parliamentliveuk.py | 0 .../extractor/patreon.py | 0 {youtube_dl => youtube_dlc}/extractor/pbs.py | 0 .../extractor/pearvideo.py | 0 .../extractor/peertube.py | 0 .../extractor/people.py | 0 .../extractor/performgroup.py | 0 .../extractor/periscope.py | 0 .../extractor/philharmoniedeparis.py | 0 .../extractor/phoenix.py | 0 .../extractor/photobucket.py | 0 .../extractor/picarto.py | 0 .../extractor/piksel.py | 0 .../extractor/pinkbike.py | 0 .../extractor/pladform.py | 0 .../extractor/platzi.py | 0 .../extractor/playfm.py | 0 .../extractor/playplustv.py | 0 .../extractor/plays.py | 0 .../extractor/playtvak.py | 0 .../extractor/playvid.py | 0 .../extractor/playwire.py | 0 .../extractor/pluralsight.py | 0 .../extractor/podomatic.py | 0 .../extractor/pokemon.py | 0 .../extractor/polskieradio.py | 0 .../extractor/popcorntimes.py | 0 .../extractor/popcorntv.py | 0 .../extractor/porn91.py | 0 .../extractor/porncom.py | 0 .../extractor/pornhd.py | 0 .../extractor/pornhub.py | 0 .../extractor/pornotube.py | 0 .../extractor/pornovoisines.py | 0 .../extractor/pornoxo.py | 0 .../extractor/presstv.py | 0 .../extractor/prosiebensat1.py | 0 .../extractor/puhutv.py | 0 .../extractor/puls4.py | 0 .../extractor/pyvideo.py | 0 .../extractor/qqmusic.py | 0 {youtube_dl => youtube_dlc}/extractor/r7.py | 0 .../extractor/radiobremen.py | 0 .../extractor/radiocanada.py | 0 .../extractor/radiode.py | 0 .../extractor/radiofrance.py | 0 .../extractor/radiojavan.py | 0 {youtube_dl => youtube_dlc}/extractor/rai.py | 0 .../extractor/raywenderlich.py | 0 .../extractor/rbmaradio.py | 0 {youtube_dl => youtube_dlc}/extractor/rds.py | 0 .../extractor/redbulltv.py | 0 .../extractor/reddit.py | 0 .../extractor/redtube.py | 0 .../extractor/regiotv.py | 0 .../extractor/rentv.py | 0 .../extractor/restudy.py | 0 .../extractor/reuters.py | 0 .../extractor/reverbnation.py | 0 {youtube_dl => youtube_dlc}/extractor/rice.py | 0 .../extractor/rmcdecouverte.py | 0 .../extractor/ro220.py | 0 .../extractor/rockstargames.py | 0 .../extractor/roosterteeth.py | 0 .../extractor/rottentomatoes.py | 0 .../extractor/roxwel.py | 0 .../extractor/rozhlas.py | 0 {youtube_dl => youtube_dlc}/extractor/rtbf.py | 0 {youtube_dl => youtube_dlc}/extractor/rte.py | 0 {youtube_dl => youtube_dlc}/extractor/rtl2.py | 0 .../extractor/rtlnl.py | 0 {youtube_dl => youtube_dlc}/extractor/rtp.py | 0 {youtube_dl => youtube_dlc}/extractor/rts.py | 0 {youtube_dl => youtube_dlc}/extractor/rtve.py | 0 .../extractor/rtvnh.py | 0 {youtube_dl => youtube_dlc}/extractor/rtvs.py | 0 {youtube_dl => youtube_dlc}/extractor/ruhd.py | 0 .../extractor/rutube.py | 0 {youtube_dl => youtube_dlc}/extractor/rutv.py | 0 .../extractor/ruutu.py | 0 {youtube_dl => youtube_dlc}/extractor/ruv.py | 0 .../extractor/safari.py | 0 {youtube_dl => youtube_dlc}/extractor/sapo.py | 0 .../extractor/savefrom.py | 0 {youtube_dl => youtube_dlc}/extractor/sbs.py | 0 .../extractor/screencast.py | 0 .../extractor/screencastomatic.py | 0 .../extractor/scrippsnetworks.py | 0 {youtube_dl => youtube_dlc}/extractor/scte.py | 0 .../extractor/seeker.py | 0 .../extractor/senateisvp.py | 0 .../extractor/sendtonews.py | 0 .../extractor/servus.py | 0 .../extractor/sevenplus.py | 0 {youtube_dl => youtube_dlc}/extractor/sexu.py | 0 .../extractor/seznamzpravy.py | 0 .../extractor/shahid.py | 0 .../extractor/shared.py | 0 .../extractor/showroomlive.py | 0 {youtube_dl => youtube_dlc}/extractor/sina.py | 0 .../extractor/sixplay.py | 0 {youtube_dl => youtube_dlc}/extractor/sky.py | 0 .../extractor/skylinewebcams.py | 0 .../extractor/skynewsarabia.py | 0 .../extractor/slideshare.py | 0 .../extractor/slideslive.py | 0 .../extractor/slutload.py | 0 .../extractor/smotri.py | 0 .../extractor/snotr.py | 0 {youtube_dl => youtube_dlc}/extractor/sohu.py | 2 +- .../extractor/sonyliv.py | 0 .../extractor/soundcloud.py | 2 +- .../extractor/soundgasm.py | 0 .../extractor/southpark.py | 0 .../extractor/spankbang.py | 0 .../extractor/spankwire.py | 0 .../extractor/spiegel.py | 0 .../extractor/spiegeltv.py | 0 .../extractor/spike.py | 0 .../extractor/sport5.py | 0 .../extractor/sportbox.py | 0 .../extractor/sportdeutschland.py | 0 .../extractor/springboardplatform.py | 0 .../extractor/sprout.py | 0 .../extractor/srgssr.py | 0 .../extractor/srmediathek.py | 0 .../extractor/stanfordoc.py | 0 .../extractor/steam.py | 0 .../extractor/stitcher.py | 0 .../extractor/storyfire.py | 0 .../extractor/streamable.py | 0 .../extractor/streamcloud.py | 4 +- .../extractor/streamcz.py | 0 .../extractor/streetvoice.py | 0 .../extractor/stretchinternet.py | 0 {youtube_dl => youtube_dlc}/extractor/stv.py | 0 .../extractor/sunporno.py | 0 .../extractor/sverigesradio.py | 0 {youtube_dl => youtube_dlc}/extractor/svt.py | 0 .../extractor/swrmediathek.py | 0 {youtube_dl => youtube_dlc}/extractor/syfy.py | 0 .../extractor/sztvhu.py | 0 .../extractor/tagesschau.py | 0 {youtube_dl => youtube_dlc}/extractor/tass.py | 0 .../extractor/tastytrade.py | 0 {youtube_dl => youtube_dlc}/extractor/tbs.py | 0 .../extractor/tdslifeway.py | 0 .../extractor/teachable.py | 0 .../extractor/teachertube.py | 0 .../extractor/teachingchannel.py | 0 .../extractor/teamcoco.py | 0 .../extractor/teamtreehouse.py | 0 .../extractor/techtalks.py | 0 {youtube_dl => youtube_dlc}/extractor/ted.py | 0 .../extractor/tele13.py | 0 .../extractor/tele5.py | 0 .../extractor/telebruxelles.py | 0 .../extractor/telecinco.py | 0 .../extractor/telegraaf.py | 0 .../extractor/telemb.py | 0 .../extractor/telequebec.py | 0 .../extractor/teletask.py | 0 .../extractor/telewebion.py | 0 .../extractor/tennistv.py | 0 .../extractor/tenplay.py | 0 .../extractor/testurl.py | 0 {youtube_dl => youtube_dlc}/extractor/tf1.py | 0 {youtube_dl => youtube_dlc}/extractor/tfo.py | 0 .../extractor/theintercept.py | 0 .../extractor/theplatform.py | 0 .../extractor/thescene.py | 0 .../extractor/thestar.py | 0 .../extractor/thesun.py | 0 .../extractor/theweatherchannel.py | 0 .../extractor/thisamericanlife.py | 0 .../extractor/thisav.py | 0 .../extractor/thisoldhouse.py | 0 .../extractor/threeqsdn.py | 0 .../extractor/tiktok.py | 0 .../extractor/tinypic.py | 0 {youtube_dl => youtube_dlc}/extractor/tmz.py | 0 .../extractor/tnaflix.py | 0 .../extractor/toggle.py | 0 .../extractor/tonline.py | 0 .../extractor/toongoggles.py | 0 .../extractor/toutv.py | 0 .../extractor/toypics.py | 0 .../extractor/traileraddict.py | 0 .../extractor/trilulilu.py | 0 .../extractor/trunews.py | 0 .../extractor/trutv.py | 0 .../extractor/tube8.py | 0 .../extractor/tubitv.py | 0 .../extractor/tudou.py | 0 .../extractor/tumblr.py | 0 .../extractor/tunein.py | 0 .../extractor/tunepk.py | 0 .../extractor/turbo.py | 0 .../extractor/turner.py | 0 {youtube_dl => youtube_dlc}/extractor/tv2.py | 0 .../extractor/tv2dk.py | 0 .../extractor/tv2hu.py | 0 {youtube_dl => youtube_dlc}/extractor/tv4.py | 0 .../extractor/tv5mondeplus.py | 0 {youtube_dl => youtube_dlc}/extractor/tva.py | 0 .../extractor/tvanouvelles.py | 0 {youtube_dl => youtube_dlc}/extractor/tvc.py | 0 .../extractor/tvigle.py | 0 .../extractor/tvland.py | 0 .../extractor/tvn24.py | 0 .../extractor/tvnet.py | 0 .../extractor/tvnoe.py | 0 .../extractor/tvnow.py | 0 {youtube_dl => youtube_dlc}/extractor/tvp.py | 0 .../extractor/tvplay.py | 0 .../extractor/tvplayer.py | 0 .../extractor/tweakers.py | 0 .../extractor/twentyfourvideo.py | 0 .../extractor/twentymin.py | 0 .../extractor/twentythreevideo.py | 0 .../extractor/twitcasting.py | 0 .../extractor/twitch.py | 0 .../extractor/twitter.py | 0 .../extractor/udemy.py | 2 +- {youtube_dl => youtube_dlc}/extractor/udn.py | 0 .../extractor/ufctv.py | 0 .../extractor/uktvplay.py | 0 {youtube_dl => youtube_dlc}/extractor/umg.py | 0 .../extractor/unistra.py | 0 .../extractor/unity.py | 0 {youtube_dl => youtube_dlc}/extractor/uol.py | 0 .../extractor/uplynk.py | 0 .../extractor/urort.py | 0 .../extractor/urplay.py | 0 .../extractor/usanetwork.py | 0 .../extractor/usatoday.py | 0 .../extractor/ustream.py | 0 .../extractor/ustudio.py | 0 .../extractor/varzesh3.py | 0 .../extractor/vbox7.py | 0 .../extractor/veehd.py | 0 {youtube_dl => youtube_dlc}/extractor/veoh.py | 0 .../extractor/vesti.py | 0 {youtube_dl => youtube_dlc}/extractor/vevo.py | 0 {youtube_dl => youtube_dlc}/extractor/vgtv.py | 0 {youtube_dl => youtube_dlc}/extractor/vh1.py | 0 {youtube_dl => youtube_dlc}/extractor/vice.py | 0 .../extractor/vidbit.py | 0 .../extractor/viddler.py | 0 .../extractor/videa.py | 0 .../extractor/videodetective.py | 0 .../extractor/videofyme.py | 0 .../extractor/videomore.py | 0 .../extractor/videopress.py | 0 .../extractor/vidio.py | 0 .../extractor/vidlii.py | 0 .../extractor/vidme.py | 0 .../extractor/vidzi.py | 2 +- {youtube_dl => youtube_dlc}/extractor/vier.py | 0 .../extractor/viewlift.py | 0 .../extractor/viidea.py | 0 {youtube_dl => youtube_dlc}/extractor/viki.py | 0 .../extractor/vimeo.py | 14 +- .../extractor/vimple.py | 0 {youtube_dl => youtube_dlc}/extractor/vine.py | 0 .../extractor/viqeo.py | 0 {youtube_dl => youtube_dlc}/extractor/viu.py | 0 {youtube_dl => youtube_dlc}/extractor/vk.py | 0 .../extractor/vlive.py | 0 .../extractor/vodlocker.py | 0 .../extractor/vodpl.py | 0 .../extractor/vodplatform.py | 0 .../extractor/voicerepublic.py | 0 {youtube_dl => youtube_dlc}/extractor/voot.py | 0 .../extractor/voxmedia.py | 0 {youtube_dl => youtube_dlc}/extractor/vrak.py | 0 {youtube_dl => youtube_dlc}/extractor/vrt.py | 0 {youtube_dl => youtube_dlc}/extractor/vrv.py | 0 .../extractor/vshare.py | 0 {youtube_dl => youtube_dlc}/extractor/vube.py | 0 .../extractor/vuclip.py | 0 .../extractor/vvvvid.py | 0 .../extractor/vyborymos.py | 0 .../extractor/vzaar.py | 0 .../extractor/wakanim.py | 0 .../extractor/walla.py | 0 .../extractor/washingtonpost.py | 0 {youtube_dl => youtube_dlc}/extractor/wat.py | 0 .../extractor/watchbox.py | 0 .../extractor/watchindianporn.py | 0 {youtube_dl => youtube_dlc}/extractor/wdr.py | 0 .../extractor/webcaster.py | 0 .../extractor/webofstories.py | 0 .../extractor/weibo.py | 0 .../extractor/weiqitv.py | 0 .../extractor/wistia.py | 0 .../extractor/worldstarhiphop.py | 0 {youtube_dl => youtube_dlc}/extractor/wsj.py | 0 {youtube_dl => youtube_dlc}/extractor/wwe.py | 0 {youtube_dl => youtube_dlc}/extractor/xbef.py | 0 .../extractor/xboxclips.py | 0 .../extractor/xfileshare.py | 0 .../extractor/xhamster.py | 0 .../extractor/xiami.py | 0 .../extractor/ximalaya.py | 0 .../extractor/xminus.py | 0 {youtube_dl => youtube_dlc}/extractor/xnxx.py | 0 .../extractor/xstream.py | 0 .../extractor/xtube.py | 0 .../extractor/xuite.py | 0 .../extractor/xvideos.py | 0 .../extractor/xxxymovies.py | 0 .../extractor/yahoo.py | 0 .../extractor/yandexdisk.py | 0 .../extractor/yandexmusic.py | 4 +- .../extractor/yandexvideo.py | 0 .../extractor/yapfiles.py | 0 .../extractor/yesjapan.py | 0 .../extractor/yinyuetai.py | 0 {youtube_dl => youtube_dlc}/extractor/ynet.py | 0 .../extractor/youjizz.py | 0 .../extractor/youku.py | 0 .../extractor/younow.py | 0 .../extractor/youporn.py | 0 .../extractor/yourporn.py | 0 .../extractor/yourupload.py | 0 .../extractor/youtube.py | 24 +- .../extractor/zapiks.py | 0 {youtube_dl => youtube_dlc}/extractor/zaq1.py | 0 .../extractor/zattoo.py | 0 {youtube_dl => youtube_dlc}/extractor/zdf.py | 0 .../extractor/zingmp3.py | 0 {youtube_dl => youtube_dlc}/extractor/zype.py | 0 {youtube_dl => youtube_dlc}/jsinterp.py | 0 {youtube_dl => youtube_dlc}/options.py | 40 ++-- .../postprocessor/__init__.py | 0 .../postprocessor/common.py | 0 .../postprocessor/embedthumbnail.py | 0 .../postprocessor/execafterdownload.py | 0 .../postprocessor/ffmpeg.py | 2 +- .../postprocessor/metadatafromtitle.py | 0 .../postprocessor/xattrpp.py | 0 {youtube_dl => youtube_dlc}/socks.py | 0 {youtube_dl => youtube_dlc}/swfinterp.py | 0 {youtube_dl => youtube_dlc}/update.py | 12 +- {youtube_dl => youtube_dlc}/utils.py | 16 +- {youtube_dl => youtube_dlc}/version.py | 0 861 files changed, 452 insertions(+), 452 deletions(-) rename {youtube_dl => youtube_dlc}/YoutubeDL.py (99%) mode change 100755 => 100644 rename {youtube_dl => youtube_dlc}/__init__.py (99%) rename {youtube_dl => youtube_dlc}/__main__.py (73%) mode change 100755 => 100644 rename {youtube_dl => youtube_dlc}/aes.py (100%) rename {youtube_dl => youtube_dlc}/cache.py (98%) rename {youtube_dl => youtube_dlc}/compat.py (99%) rename {youtube_dl => youtube_dlc}/downloader/__init__.py (100%) rename {youtube_dl => youtube_dlc}/downloader/common.py (99%) rename {youtube_dl => youtube_dlc}/downloader/dash.py (100%) rename {youtube_dl => youtube_dlc}/downloader/external.py (100%) rename {youtube_dl => youtube_dlc}/downloader/f4m.py (100%) rename {youtube_dl => youtube_dlc}/downloader/fragment.py (98%) rename {youtube_dl => youtube_dlc}/downloader/hls.py (100%) rename {youtube_dl => youtube_dlc}/downloader/http.py (100%) rename {youtube_dl => youtube_dlc}/downloader/ism.py (100%) rename {youtube_dl => youtube_dlc}/downloader/rtmp.py (100%) rename {youtube_dl => youtube_dlc}/downloader/rtsp.py (100%) rename {youtube_dl => youtube_dlc}/downloader/youtube_live_chat.py (100%) rename {youtube_dl => youtube_dlc}/extractor/__init__.py (100%) rename {youtube_dl => youtube_dlc}/extractor/abc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/abcnews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/abcotvs.py (100%) rename {youtube_dl => youtube_dlc}/extractor/academicearth.py (100%) rename {youtube_dl => youtube_dlc}/extractor/acast.py (100%) rename {youtube_dl => youtube_dlc}/extractor/adn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/adobeconnect.py (100%) rename {youtube_dl => youtube_dlc}/extractor/adobepass.py (100%) rename {youtube_dl => youtube_dlc}/extractor/adobetv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/adultswim.py (100%) rename {youtube_dl => youtube_dlc}/extractor/aenetworks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/afreecatv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/airmozilla.py (100%) rename {youtube_dl => youtube_dlc}/extractor/aliexpress.py (100%) rename {youtube_dl => youtube_dlc}/extractor/aljazeera.py (100%) rename {youtube_dl => youtube_dlc}/extractor/allocine.py (100%) rename {youtube_dl => youtube_dlc}/extractor/alphaporno.py (100%) rename {youtube_dl => youtube_dlc}/extractor/amcnetworks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/americastestkitchen.py (100%) rename {youtube_dl => youtube_dlc}/extractor/amp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/animeondemand.py (100%) rename {youtube_dl => youtube_dlc}/extractor/anvato.py (100%) rename {youtube_dl => youtube_dlc}/extractor/aol.py (100%) rename {youtube_dl => youtube_dlc}/extractor/apa.py (100%) rename {youtube_dl => youtube_dlc}/extractor/aparat.py (100%) rename {youtube_dl => youtube_dlc}/extractor/appleconnect.py (100%) rename {youtube_dl => youtube_dlc}/extractor/appletrailers.py (99%) rename {youtube_dl => youtube_dlc}/extractor/archiveorg.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ard.py (100%) rename {youtube_dl => youtube_dlc}/extractor/arkena.py (100%) rename {youtube_dl => youtube_dlc}/extractor/arte.py (100%) rename {youtube_dl => youtube_dlc}/extractor/asiancrush.py (100%) rename {youtube_dl => youtube_dlc}/extractor/atresplayer.py (100%) rename {youtube_dl => youtube_dlc}/extractor/atttechchannel.py (100%) rename {youtube_dl => youtube_dlc}/extractor/atvat.py (100%) rename {youtube_dl => youtube_dlc}/extractor/audimedia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/audioboom.py (100%) rename {youtube_dl => youtube_dlc}/extractor/audiomack.py (100%) rename {youtube_dl => youtube_dlc}/extractor/awaan.py (100%) rename {youtube_dl => youtube_dlc}/extractor/aws.py (100%) rename {youtube_dl => youtube_dlc}/extractor/azmedien.py (100%) rename {youtube_dl => youtube_dlc}/extractor/baidu.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bandcamp.py (98%) rename {youtube_dl => youtube_dlc}/extractor/bbc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/beampro.py (100%) rename {youtube_dl => youtube_dlc}/extractor/beatport.py (100%) rename {youtube_dl => youtube_dlc}/extractor/beeg.py (100%) rename {youtube_dl => youtube_dlc}/extractor/behindkink.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bellmedia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bet.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bfi.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bigflix.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bild.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bilibili.py (99%) rename {youtube_dl => youtube_dlc}/extractor/biobiochiletv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/biqle.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bitchute.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bleacherreport.py (100%) rename {youtube_dl => youtube_dlc}/extractor/blinkx.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bloomberg.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bokecc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bostonglobe.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bpb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/br.py (100%) rename {youtube_dl => youtube_dlc}/extractor/bravotv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/breakcom.py (100%) rename {youtube_dl => youtube_dlc}/extractor/brightcove.py (100%) rename {youtube_dl => youtube_dlc}/extractor/businessinsider.py (100%) rename {youtube_dl => youtube_dlc}/extractor/buzzfeed.py (100%) rename {youtube_dl => youtube_dlc}/extractor/byutv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/c56.py (100%) rename {youtube_dl => youtube_dlc}/extractor/camdemy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cammodels.py (100%) rename {youtube_dl => youtube_dlc}/extractor/camtube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/camwithher.py (100%) rename {youtube_dl => youtube_dlc}/extractor/canalc2.py (100%) rename {youtube_dl => youtube_dlc}/extractor/canalplus.py (100%) rename {youtube_dl => youtube_dlc}/extractor/canvas.py (100%) rename {youtube_dl => youtube_dlc}/extractor/carambatv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cartoonnetwork.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cbc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cbs.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cbsinteractive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cbslocal.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cbsnews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cbssports.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ccc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ccma.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cctv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cda.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ceskatelevize.py (100%) rename {youtube_dl => youtube_dlc}/extractor/channel9.py (100%) rename {youtube_dl => youtube_dlc}/extractor/charlierose.py (100%) rename {youtube_dl => youtube_dlc}/extractor/chaturbate.py (100%) rename {youtube_dl => youtube_dlc}/extractor/chilloutzone.py (100%) rename {youtube_dl => youtube_dlc}/extractor/chirbit.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cinchcast.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cinemax.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ciscolive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cjsw.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cliphunter.py (100%) rename {youtube_dl => youtube_dlc}/extractor/clippit.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cliprs.py (100%) rename {youtube_dl => youtube_dlc}/extractor/clipsyndicate.py (100%) rename {youtube_dl => youtube_dlc}/extractor/closertotruth.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cloudflarestream.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cloudy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/clubic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/clyp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cmt.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cnbc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cnn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/comedycentral.py (100%) rename {youtube_dl => youtube_dlc}/extractor/common.py (99%) rename {youtube_dl => youtube_dlc}/extractor/commonmistakes.py (92%) rename {youtube_dl => youtube_dlc}/extractor/commonprotocols.py (100%) rename {youtube_dl => youtube_dlc}/extractor/condenast.py (100%) rename {youtube_dl => youtube_dlc}/extractor/contv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/corus.py (100%) rename {youtube_dl => youtube_dlc}/extractor/coub.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cracked.py (100%) rename {youtube_dl => youtube_dlc}/extractor/crackle.py (100%) rename {youtube_dl => youtube_dlc}/extractor/crooksandliars.py (100%) rename {youtube_dl => youtube_dlc}/extractor/crunchyroll.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cspan.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ctsnews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ctvnews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cultureunplugged.py (100%) rename {youtube_dl => youtube_dlc}/extractor/curiositystream.py (100%) rename {youtube_dl => youtube_dlc}/extractor/cwtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dailymail.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dailymotion.py (100%) rename {youtube_dl => youtube_dlc}/extractor/daum.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dbtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dctp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/deezer.py (100%) rename {youtube_dl => youtube_dlc}/extractor/defense.py (100%) rename {youtube_dl => youtube_dlc}/extractor/democracynow.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dfb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dhm.py (100%) rename {youtube_dl => youtube_dlc}/extractor/digg.py (100%) rename {youtube_dl => youtube_dlc}/extractor/digiteka.py (100%) rename {youtube_dl => youtube_dlc}/extractor/discovery.py (100%) rename {youtube_dl => youtube_dlc}/extractor/discoverygo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/discoverynetworks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/discoveryvr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/disney.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dispeak.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dlive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/doodstream.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dotsub.py (100%) rename {youtube_dl => youtube_dlc}/extractor/douyutv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/drbonanza.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dreisat.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dropbox.py (90%) rename {youtube_dl => youtube_dlc}/extractor/drtuber.py (100%) rename {youtube_dl => youtube_dlc}/extractor/drtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dtube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dumpert.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dvtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/dw.py (100%) rename {youtube_dl => youtube_dlc}/extractor/eagleplatform.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ebaumsworld.py (100%) rename {youtube_dl => youtube_dlc}/extractor/echomsk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/egghead.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ehow.py (100%) rename {youtube_dl => youtube_dlc}/extractor/eighttracks.py (85%) rename {youtube_dl => youtube_dlc}/extractor/einthusan.py (100%) rename {youtube_dl => youtube_dlc}/extractor/eitb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ellentube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/elpais.py (100%) rename {youtube_dl => youtube_dlc}/extractor/embedly.py (100%) rename {youtube_dl => youtube_dlc}/extractor/engadget.py (100%) rename {youtube_dl => youtube_dlc}/extractor/eporner.py (100%) rename {youtube_dl => youtube_dlc}/extractor/eroprofile.py (100%) rename {youtube_dl => youtube_dlc}/extractor/escapist.py (100%) rename {youtube_dl => youtube_dlc}/extractor/espn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/esri.py (100%) rename {youtube_dl => youtube_dlc}/extractor/europa.py (100%) rename {youtube_dl => youtube_dlc}/extractor/everyonesmixtape.py (100%) rename {youtube_dl => youtube_dlc}/extractor/expotv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/expressen.py (100%) rename {youtube_dl => youtube_dlc}/extractor/extractors.py (100%) rename {youtube_dl => youtube_dlc}/extractor/extremetube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/eyedotv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/facebook.py (100%) rename {youtube_dl => youtube_dlc}/extractor/faz.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fc2.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fczenit.py (100%) rename {youtube_dl => youtube_dlc}/extractor/filmon.py (100%) rename {youtube_dl => youtube_dlc}/extractor/filmweb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/firsttv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fivemin.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fivetv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/flickr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/folketinget.py (100%) rename {youtube_dl => youtube_dlc}/extractor/footyroom.py (100%) rename {youtube_dl => youtube_dlc}/extractor/formula1.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fourtube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fox.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fox9.py (100%) rename {youtube_dl => youtube_dlc}/extractor/foxgay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/foxnews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/foxsports.py (100%) rename {youtube_dl => youtube_dlc}/extractor/franceculture.py (100%) rename {youtube_dl => youtube_dlc}/extractor/franceinter.py (100%) rename {youtube_dl => youtube_dlc}/extractor/francetv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/freesound.py (100%) rename {youtube_dl => youtube_dlc}/extractor/freespeech.py (100%) rename {youtube_dl => youtube_dlc}/extractor/freshlive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/frontendmasters.py (100%) rename {youtube_dl => youtube_dlc}/extractor/funimation.py (100%) rename {youtube_dl => youtube_dlc}/extractor/funk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fusion.py (100%) rename {youtube_dl => youtube_dlc}/extractor/fxnetworks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gaia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gameinformer.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gamespot.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gamestar.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gaskrank.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gazeta.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gdcvault.py (100%) rename {youtube_dl => youtube_dlc}/extractor/generic.py (99%) rename {youtube_dl => youtube_dlc}/extractor/gfycat.py (100%) rename {youtube_dl => youtube_dlc}/extractor/giantbomb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/giga.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gigya.py (100%) rename {youtube_dl => youtube_dlc}/extractor/glide.py (100%) rename {youtube_dl => youtube_dlc}/extractor/globo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/go.py (100%) rename {youtube_dl => youtube_dlc}/extractor/godtube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/golem.py (100%) rename {youtube_dl => youtube_dlc}/extractor/googledrive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/googleplus.py (100%) rename {youtube_dl => youtube_dlc}/extractor/googlesearch.py (100%) rename {youtube_dl => youtube_dlc}/extractor/goshgay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/gputechconf.py (100%) rename {youtube_dl => youtube_dlc}/extractor/groupon.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hbo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hearthisat.py (100%) rename {youtube_dl => youtube_dlc}/extractor/heise.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hellporno.py (100%) rename {youtube_dl => youtube_dlc}/extractor/helsinki.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hentaistigma.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hgtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hidive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/historicfilms.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hitbox.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hitrecord.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hketv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hornbunny.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hotnewhiphop.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hotstar.py (100%) rename {youtube_dl => youtube_dlc}/extractor/howcast.py (100%) rename {youtube_dl => youtube_dlc}/extractor/howstuffworks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hrfensehen.py (98%) rename {youtube_dl => youtube_dlc}/extractor/hrti.py (100%) rename {youtube_dl => youtube_dlc}/extractor/huajiao.py (100%) rename {youtube_dl => youtube_dlc}/extractor/huffpost.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hungama.py (100%) rename {youtube_dl => youtube_dlc}/extractor/hypem.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ign.py (100%) rename {youtube_dl => youtube_dlc}/extractor/imdb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/imggaming.py (100%) rename {youtube_dl => youtube_dlc}/extractor/imgur.py (97%) rename {youtube_dl => youtube_dlc}/extractor/ina.py (100%) rename {youtube_dl => youtube_dlc}/extractor/inc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/indavideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/infoq.py (100%) rename {youtube_dl => youtube_dlc}/extractor/instagram.py (100%) rename {youtube_dl => youtube_dlc}/extractor/internazionale.py (100%) rename {youtube_dl => youtube_dlc}/extractor/internetvideoarchive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/iprima.py (100%) rename {youtube_dl => youtube_dlc}/extractor/iqiyi.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ir90tv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/itv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ivi.py (99%) rename {youtube_dl => youtube_dlc}/extractor/ivideon.py (100%) rename {youtube_dl => youtube_dlc}/extractor/iwara.py (100%) rename {youtube_dl => youtube_dlc}/extractor/izlesene.py (100%) rename {youtube_dl => youtube_dlc}/extractor/jamendo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/jeuxvideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/joj.py (97%) rename {youtube_dl => youtube_dlc}/extractor/jove.py (100%) rename {youtube_dl => youtube_dlc}/extractor/jwplatform.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kakao.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kaltura.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kanalplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kankan.py (100%) rename {youtube_dl => youtube_dlc}/extractor/karaoketv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/karrierevideos.py (100%) rename {youtube_dl => youtube_dlc}/extractor/keezmovies.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ketnet.py (100%) rename {youtube_dl => youtube_dlc}/extractor/khanacademy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kickstarter.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kinja.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kinopoisk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/konserthusetplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/krasview.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ku6.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kusi.py (100%) rename {youtube_dl => youtube_dlc}/extractor/kuwo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/la7.py (100%) rename {youtube_dl => youtube_dlc}/extractor/laola1tv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lci.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lcp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lecture2go.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lecturio.py (100%) rename {youtube_dl => youtube_dlc}/extractor/leeco.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lego.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lemonde.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lenta.py (100%) rename {youtube_dl => youtube_dlc}/extractor/libraryofcongress.py (100%) rename {youtube_dl => youtube_dlc}/extractor/libsyn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lifenews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/limelight.py (100%) rename {youtube_dl => youtube_dlc}/extractor/line.py (100%) rename {youtube_dl => youtube_dlc}/extractor/linkedin.py (100%) rename {youtube_dl => youtube_dlc}/extractor/linuxacademy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/litv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/livejournal.py (100%) rename {youtube_dl => youtube_dlc}/extractor/liveleak.py (100%) rename {youtube_dl => youtube_dlc}/extractor/livestream.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lnkgo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/localnews8.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lovehomeporn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lrt.py (100%) rename {youtube_dl => youtube_dlc}/extractor/lynda.py (100%) rename {youtube_dl => youtube_dlc}/extractor/m6.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mailru.py (100%) rename {youtube_dl => youtube_dlc}/extractor/malltv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mangomolo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/manyvids.py (100%) rename {youtube_dl => youtube_dlc}/extractor/markiza.py (100%) rename {youtube_dl => youtube_dlc}/extractor/massengeschmacktv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/matchtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mdr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/medialaan.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mediaset.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mediasite.py (100%) rename {youtube_dl => youtube_dlc}/extractor/medici.py (100%) rename {youtube_dl => youtube_dlc}/extractor/megaphone.py (100%) rename {youtube_dl => youtube_dlc}/extractor/meipai.py (100%) rename {youtube_dl => youtube_dlc}/extractor/melonvod.py (100%) rename {youtube_dl => youtube_dlc}/extractor/meta.py (100%) rename {youtube_dl => youtube_dlc}/extractor/metacafe.py (100%) rename {youtube_dl => youtube_dlc}/extractor/metacritic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mgoon.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mgtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/miaopai.py (100%) rename {youtube_dl => youtube_dlc}/extractor/microsoftvirtualacademy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ministrygrid.py (100%) rename {youtube_dl => youtube_dlc}/extractor/minoto.py (100%) rename {youtube_dl => youtube_dlc}/extractor/miomio.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mit.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mitele.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mixcloud.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mlb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mnet.py (100%) rename {youtube_dl => youtube_dlc}/extractor/moevideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mofosex.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mojvideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/morningstar.py (100%) rename {youtube_dl => youtube_dlc}/extractor/motherless.py (100%) rename {youtube_dl => youtube_dlc}/extractor/motorsport.py (100%) rename {youtube_dl => youtube_dlc}/extractor/movieclips.py (100%) rename {youtube_dl => youtube_dlc}/extractor/moviezine.py (100%) rename {youtube_dl => youtube_dlc}/extractor/movingimage.py (100%) rename {youtube_dl => youtube_dlc}/extractor/msn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/muenchentv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mwave.py (100%) rename {youtube_dl => youtube_dlc}/extractor/mychannels.py (100%) rename {youtube_dl => youtube_dlc}/extractor/myspace.py (100%) rename {youtube_dl => youtube_dlc}/extractor/myspass.py (100%) rename {youtube_dl => youtube_dlc}/extractor/myvi.py (100%) rename {youtube_dl => youtube_dlc}/extractor/myvidster.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nationalgeographic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/naver.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nba.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nbc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ndr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ndtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nerdcubed.py (100%) rename {youtube_dl => youtube_dlc}/extractor/neteasemusic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/netzkino.py (100%) rename {youtube_dl => youtube_dlc}/extractor/newgrounds.py (100%) rename {youtube_dl => youtube_dlc}/extractor/newstube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nextmedia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nexx.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nfl.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nhk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nhl.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nick.py (100%) rename {youtube_dl => youtube_dlc}/extractor/niconico.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ninecninemedia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ninegag.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ninenow.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nintendo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/njpwworld.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nobelprize.py (100%) rename {youtube_dl => youtube_dlc}/extractor/noco.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nonktube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/noovo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/normalboots.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nosvideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nova.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nowness.py (98%) rename {youtube_dl => youtube_dlc}/extractor/noz.py (100%) rename {youtube_dl => youtube_dlc}/extractor/npo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/npr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nrk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nrl.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ntvcojp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ntvde.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ntvru.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nuevo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nuvid.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nytimes.py (100%) rename {youtube_dl => youtube_dlc}/extractor/nzz.py (100%) rename {youtube_dl => youtube_dlc}/extractor/odatv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/odnoklassniki.py (100%) rename {youtube_dl => youtube_dlc}/extractor/oktoberfesttv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/once.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ondemandkorea.py (100%) rename {youtube_dl => youtube_dlc}/extractor/onet.py (100%) rename {youtube_dl => youtube_dlc}/extractor/onionstudios.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ooyala.py (100%) rename {youtube_dl => youtube_dlc}/extractor/openload.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ora.py (100%) rename {youtube_dl => youtube_dlc}/extractor/orf.py (100%) rename {youtube_dl => youtube_dlc}/extractor/outsidetv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/packtpub.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pandoratv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/parliamentliveuk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/patreon.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pbs.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pearvideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/peertube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/people.py (100%) rename {youtube_dl => youtube_dlc}/extractor/performgroup.py (100%) rename {youtube_dl => youtube_dlc}/extractor/periscope.py (100%) rename {youtube_dl => youtube_dlc}/extractor/philharmoniedeparis.py (100%) rename {youtube_dl => youtube_dlc}/extractor/phoenix.py (100%) rename {youtube_dl => youtube_dlc}/extractor/photobucket.py (100%) rename {youtube_dl => youtube_dlc}/extractor/picarto.py (100%) rename {youtube_dl => youtube_dlc}/extractor/piksel.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pinkbike.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pladform.py (100%) rename {youtube_dl => youtube_dlc}/extractor/platzi.py (100%) rename {youtube_dl => youtube_dlc}/extractor/playfm.py (100%) rename {youtube_dl => youtube_dlc}/extractor/playplustv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/plays.py (100%) rename {youtube_dl => youtube_dlc}/extractor/playtvak.py (100%) rename {youtube_dl => youtube_dlc}/extractor/playvid.py (100%) rename {youtube_dl => youtube_dlc}/extractor/playwire.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pluralsight.py (100%) rename {youtube_dl => youtube_dlc}/extractor/podomatic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pokemon.py (100%) rename {youtube_dl => youtube_dlc}/extractor/polskieradio.py (100%) rename {youtube_dl => youtube_dlc}/extractor/popcorntimes.py (100%) rename {youtube_dl => youtube_dlc}/extractor/popcorntv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/porn91.py (100%) rename {youtube_dl => youtube_dlc}/extractor/porncom.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pornhd.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pornhub.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pornotube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pornovoisines.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pornoxo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/presstv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/prosiebensat1.py (100%) rename {youtube_dl => youtube_dlc}/extractor/puhutv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/puls4.py (100%) rename {youtube_dl => youtube_dlc}/extractor/pyvideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/qqmusic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/r7.py (100%) rename {youtube_dl => youtube_dlc}/extractor/radiobremen.py (100%) rename {youtube_dl => youtube_dlc}/extractor/radiocanada.py (100%) rename {youtube_dl => youtube_dlc}/extractor/radiode.py (100%) rename {youtube_dl => youtube_dlc}/extractor/radiofrance.py (100%) rename {youtube_dl => youtube_dlc}/extractor/radiojavan.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rai.py (100%) rename {youtube_dl => youtube_dlc}/extractor/raywenderlich.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rbmaradio.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rds.py (100%) rename {youtube_dl => youtube_dlc}/extractor/redbulltv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/reddit.py (100%) rename {youtube_dl => youtube_dlc}/extractor/redtube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/regiotv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rentv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/restudy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/reuters.py (100%) rename {youtube_dl => youtube_dlc}/extractor/reverbnation.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rice.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rmcdecouverte.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ro220.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rockstargames.py (100%) rename {youtube_dl => youtube_dlc}/extractor/roosterteeth.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rottentomatoes.py (100%) rename {youtube_dl => youtube_dlc}/extractor/roxwel.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rozhlas.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rtbf.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rte.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rtl2.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rtlnl.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rtp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rts.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rtve.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rtvnh.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rtvs.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ruhd.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rutube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/rutv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ruutu.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ruv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/safari.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sapo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/savefrom.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sbs.py (100%) rename {youtube_dl => youtube_dlc}/extractor/screencast.py (100%) rename {youtube_dl => youtube_dlc}/extractor/screencastomatic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/scrippsnetworks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/scte.py (100%) rename {youtube_dl => youtube_dlc}/extractor/seeker.py (100%) rename {youtube_dl => youtube_dlc}/extractor/senateisvp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sendtonews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/servus.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sevenplus.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sexu.py (100%) rename {youtube_dl => youtube_dlc}/extractor/seznamzpravy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/shahid.py (100%) rename {youtube_dl => youtube_dlc}/extractor/shared.py (100%) rename {youtube_dl => youtube_dlc}/extractor/showroomlive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sina.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sixplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sky.py (100%) rename {youtube_dl => youtube_dlc}/extractor/skylinewebcams.py (100%) rename {youtube_dl => youtube_dlc}/extractor/skynewsarabia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/slideshare.py (100%) rename {youtube_dl => youtube_dlc}/extractor/slideslive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/slutload.py (100%) rename {youtube_dl => youtube_dlc}/extractor/smotri.py (100%) rename {youtube_dl => youtube_dlc}/extractor/snotr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sohu.py (99%) rename {youtube_dl => youtube_dlc}/extractor/sonyliv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/soundcloud.py (99%) rename {youtube_dl => youtube_dlc}/extractor/soundgasm.py (100%) rename {youtube_dl => youtube_dlc}/extractor/southpark.py (100%) rename {youtube_dl => youtube_dlc}/extractor/spankbang.py (100%) rename {youtube_dl => youtube_dlc}/extractor/spankwire.py (100%) rename {youtube_dl => youtube_dlc}/extractor/spiegel.py (100%) rename {youtube_dl => youtube_dlc}/extractor/spiegeltv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/spike.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sport5.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sportbox.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sportdeutschland.py (100%) rename {youtube_dl => youtube_dlc}/extractor/springboardplatform.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sprout.py (100%) rename {youtube_dl => youtube_dlc}/extractor/srgssr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/srmediathek.py (100%) rename {youtube_dl => youtube_dlc}/extractor/stanfordoc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/steam.py (100%) rename {youtube_dl => youtube_dlc}/extractor/stitcher.py (100%) rename {youtube_dl => youtube_dlc}/extractor/storyfire.py (100%) rename {youtube_dl => youtube_dlc}/extractor/streamable.py (100%) rename {youtube_dl => youtube_dlc}/extractor/streamcloud.py (93%) rename {youtube_dl => youtube_dlc}/extractor/streamcz.py (100%) rename {youtube_dl => youtube_dlc}/extractor/streetvoice.py (100%) rename {youtube_dl => youtube_dlc}/extractor/stretchinternet.py (100%) rename {youtube_dl => youtube_dlc}/extractor/stv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sunporno.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sverigesradio.py (100%) rename {youtube_dl => youtube_dlc}/extractor/svt.py (100%) rename {youtube_dl => youtube_dlc}/extractor/swrmediathek.py (100%) rename {youtube_dl => youtube_dlc}/extractor/syfy.py (100%) rename {youtube_dl => youtube_dlc}/extractor/sztvhu.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tagesschau.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tass.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tastytrade.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tbs.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tdslifeway.py (100%) rename {youtube_dl => youtube_dlc}/extractor/teachable.py (100%) rename {youtube_dl => youtube_dlc}/extractor/teachertube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/teachingchannel.py (100%) rename {youtube_dl => youtube_dlc}/extractor/teamcoco.py (100%) rename {youtube_dl => youtube_dlc}/extractor/teamtreehouse.py (100%) rename {youtube_dl => youtube_dlc}/extractor/techtalks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ted.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tele13.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tele5.py (100%) rename {youtube_dl => youtube_dlc}/extractor/telebruxelles.py (100%) rename {youtube_dl => youtube_dlc}/extractor/telecinco.py (100%) rename {youtube_dl => youtube_dlc}/extractor/telegraaf.py (100%) rename {youtube_dl => youtube_dlc}/extractor/telemb.py (100%) rename {youtube_dl => youtube_dlc}/extractor/telequebec.py (100%) rename {youtube_dl => youtube_dlc}/extractor/teletask.py (100%) rename {youtube_dl => youtube_dlc}/extractor/telewebion.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tennistv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tenplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/testurl.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tf1.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tfo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/theintercept.py (100%) rename {youtube_dl => youtube_dlc}/extractor/theplatform.py (100%) rename {youtube_dl => youtube_dlc}/extractor/thescene.py (100%) rename {youtube_dl => youtube_dlc}/extractor/thestar.py (100%) rename {youtube_dl => youtube_dlc}/extractor/thesun.py (100%) rename {youtube_dl => youtube_dlc}/extractor/theweatherchannel.py (100%) rename {youtube_dl => youtube_dlc}/extractor/thisamericanlife.py (100%) rename {youtube_dl => youtube_dlc}/extractor/thisav.py (100%) rename {youtube_dl => youtube_dlc}/extractor/thisoldhouse.py (100%) rename {youtube_dl => youtube_dlc}/extractor/threeqsdn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tiktok.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tinypic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tmz.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tnaflix.py (100%) rename {youtube_dl => youtube_dlc}/extractor/toggle.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tonline.py (100%) rename {youtube_dl => youtube_dlc}/extractor/toongoggles.py (100%) rename {youtube_dl => youtube_dlc}/extractor/toutv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/toypics.py (100%) rename {youtube_dl => youtube_dlc}/extractor/traileraddict.py (100%) rename {youtube_dl => youtube_dlc}/extractor/trilulilu.py (100%) rename {youtube_dl => youtube_dlc}/extractor/trunews.py (100%) rename {youtube_dl => youtube_dlc}/extractor/trutv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tube8.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tubitv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tudou.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tumblr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tunein.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tunepk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/turbo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/turner.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tv2.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tv2dk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tv2hu.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tv4.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tv5mondeplus.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tva.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvanouvelles.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvc.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvigle.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvland.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvn24.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvnet.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvnoe.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvnow.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvp.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tvplayer.py (100%) rename {youtube_dl => youtube_dlc}/extractor/tweakers.py (100%) rename {youtube_dl => youtube_dlc}/extractor/twentyfourvideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/twentymin.py (100%) rename {youtube_dl => youtube_dlc}/extractor/twentythreevideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/twitcasting.py (100%) rename {youtube_dl => youtube_dlc}/extractor/twitch.py (100%) rename {youtube_dl => youtube_dlc}/extractor/twitter.py (100%) rename {youtube_dl => youtube_dlc}/extractor/udemy.py (99%) rename {youtube_dl => youtube_dlc}/extractor/udn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ufctv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/uktvplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/umg.py (100%) rename {youtube_dl => youtube_dlc}/extractor/unistra.py (100%) rename {youtube_dl => youtube_dlc}/extractor/unity.py (100%) rename {youtube_dl => youtube_dlc}/extractor/uol.py (100%) rename {youtube_dl => youtube_dlc}/extractor/uplynk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/urort.py (100%) rename {youtube_dl => youtube_dlc}/extractor/urplay.py (100%) rename {youtube_dl => youtube_dlc}/extractor/usanetwork.py (100%) rename {youtube_dl => youtube_dlc}/extractor/usatoday.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ustream.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ustudio.py (100%) rename {youtube_dl => youtube_dlc}/extractor/varzesh3.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vbox7.py (100%) rename {youtube_dl => youtube_dlc}/extractor/veehd.py (100%) rename {youtube_dl => youtube_dlc}/extractor/veoh.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vesti.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vevo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vgtv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vh1.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vice.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vidbit.py (100%) rename {youtube_dl => youtube_dlc}/extractor/viddler.py (100%) rename {youtube_dl => youtube_dlc}/extractor/videa.py (100%) rename {youtube_dl => youtube_dlc}/extractor/videodetective.py (100%) rename {youtube_dl => youtube_dlc}/extractor/videofyme.py (100%) rename {youtube_dl => youtube_dlc}/extractor/videomore.py (100%) rename {youtube_dl => youtube_dlc}/extractor/videopress.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vidio.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vidlii.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vidme.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vidzi.py (96%) rename {youtube_dl => youtube_dlc}/extractor/vier.py (100%) rename {youtube_dl => youtube_dlc}/extractor/viewlift.py (100%) rename {youtube_dl => youtube_dlc}/extractor/viidea.py (100%) rename {youtube_dl => youtube_dlc}/extractor/viki.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vimeo.py (99%) rename {youtube_dl => youtube_dlc}/extractor/vimple.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vine.py (100%) rename {youtube_dl => youtube_dlc}/extractor/viqeo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/viu.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vlive.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vodlocker.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vodpl.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vodplatform.py (100%) rename {youtube_dl => youtube_dlc}/extractor/voicerepublic.py (100%) rename {youtube_dl => youtube_dlc}/extractor/voot.py (100%) rename {youtube_dl => youtube_dlc}/extractor/voxmedia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vrak.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vrt.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vrv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vshare.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vuclip.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vvvvid.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vyborymos.py (100%) rename {youtube_dl => youtube_dlc}/extractor/vzaar.py (100%) rename {youtube_dl => youtube_dlc}/extractor/wakanim.py (100%) rename {youtube_dl => youtube_dlc}/extractor/walla.py (100%) rename {youtube_dl => youtube_dlc}/extractor/washingtonpost.py (100%) rename {youtube_dl => youtube_dlc}/extractor/wat.py (100%) rename {youtube_dl => youtube_dlc}/extractor/watchbox.py (100%) rename {youtube_dl => youtube_dlc}/extractor/watchindianporn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/wdr.py (100%) rename {youtube_dl => youtube_dlc}/extractor/webcaster.py (100%) rename {youtube_dl => youtube_dlc}/extractor/webofstories.py (100%) rename {youtube_dl => youtube_dlc}/extractor/weibo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/weiqitv.py (100%) rename {youtube_dl => youtube_dlc}/extractor/wistia.py (100%) rename {youtube_dl => youtube_dlc}/extractor/worldstarhiphop.py (100%) rename {youtube_dl => youtube_dlc}/extractor/wsj.py (100%) rename {youtube_dl => youtube_dlc}/extractor/wwe.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xbef.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xboxclips.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xfileshare.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xhamster.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xiami.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ximalaya.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xminus.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xnxx.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xstream.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xtube.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xuite.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xvideos.py (100%) rename {youtube_dl => youtube_dlc}/extractor/xxxymovies.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yahoo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yandexdisk.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yandexmusic.py (99%) rename {youtube_dl => youtube_dlc}/extractor/yandexvideo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yapfiles.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yesjapan.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yinyuetai.py (100%) rename {youtube_dl => youtube_dlc}/extractor/ynet.py (100%) rename {youtube_dl => youtube_dlc}/extractor/youjizz.py (100%) rename {youtube_dl => youtube_dlc}/extractor/youku.py (100%) rename {youtube_dl => youtube_dlc}/extractor/younow.py (100%) rename {youtube_dl => youtube_dlc}/extractor/youporn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yourporn.py (100%) rename {youtube_dl => youtube_dlc}/extractor/yourupload.py (100%) rename {youtube_dl => youtube_dlc}/extractor/youtube.py (99%) rename {youtube_dl => youtube_dlc}/extractor/zapiks.py (100%) rename {youtube_dl => youtube_dlc}/extractor/zaq1.py (100%) rename {youtube_dl => youtube_dlc}/extractor/zattoo.py (100%) rename {youtube_dl => youtube_dlc}/extractor/zdf.py (100%) rename {youtube_dl => youtube_dlc}/extractor/zingmp3.py (100%) rename {youtube_dl => youtube_dlc}/extractor/zype.py (100%) rename {youtube_dl => youtube_dlc}/jsinterp.py (100%) rename {youtube_dl => youtube_dlc}/options.py (96%) rename {youtube_dl => youtube_dlc}/postprocessor/__init__.py (100%) rename {youtube_dl => youtube_dlc}/postprocessor/common.py (100%) rename {youtube_dl => youtube_dlc}/postprocessor/embedthumbnail.py (100%) rename {youtube_dl => youtube_dlc}/postprocessor/execafterdownload.py (100%) rename {youtube_dl => youtube_dlc}/postprocessor/ffmpeg.py (99%) rename {youtube_dl => youtube_dlc}/postprocessor/metadatafromtitle.py (100%) rename {youtube_dl => youtube_dlc}/postprocessor/xattrpp.py (100%) rename {youtube_dl => youtube_dlc}/socks.py (100%) rename {youtube_dl => youtube_dlc}/swfinterp.py (100%) rename {youtube_dl => youtube_dlc}/update.py (93%) rename {youtube_dl => youtube_dlc}/utils.py (99%) rename {youtube_dl => youtube_dlc}/version.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 4e43e99f3..d2cce9a1c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,8 +2,8 @@ include README.md include LICENSE include AUTHORS include ChangeLog -include youtube-dl.bash-completion -include youtube-dl.fish -include youtube-dl.1 +include youtube-dlc.bash-completion +include youtube-dlc.fish +include youtube-dlc.1 recursive-include docs Makefile conf.py *.rst recursive-include test * diff --git a/Makefile b/Makefile index 3e17365b8..9588657c1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -all: youtube-dl README.md CONTRIBUTING.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish supportedsites +all: youtube-dlc README.md CONTRIBUTING.md README.txt youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish supportedsites clean: - rm -rf youtube-dl.1.temp.md youtube-dl.1 youtube-dl.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dl.tar.gz youtube-dl.zsh youtube-dl.fish youtube_dl/extractor/lazy_extractors.py *.dump *.part* *.ytdl *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.3gp *.wav *.ape *.swf *.jpg *.png CONTRIBUTING.md.tmp youtube-dl youtube-dl.exe + rm -rf youtube-dlc.1.temp.md youtube-dlc.1 youtube-dlc.bash-completion README.txt MANIFEST build/ dist/ .coverage cover/ youtube-dlc.tar.gz youtube-dlc.zsh youtube-dlc.fish youtube_dlc/extractor/lazy_extractors.py *.dump *.part* *.ytdl *.info.json *.mp4 *.m4a *.flv *.mp3 *.avi *.mkv *.webm *.3gp *.wav *.ape *.swf *.jpg *.png CONTRIBUTING.md.tmp youtube-dlc youtube-dlc.exe find . -name "*.pyc" -delete find . -name "*.class" -delete @@ -17,23 +17,23 @@ SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then ech # set markdown input format to "markdown-smart" for pandoc version 2 and to "markdown" for pandoc prior to version 2 MARKDOWN = $(shell if [ `pandoc -v | head -n1 | cut -d" " -f2 | head -c1` = "2" ]; then echo markdown-smart; else echo markdown; fi) -install: youtube-dl youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish +install: youtube-dlc youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish install -d $(DESTDIR)$(BINDIR) - install -m 755 youtube-dl $(DESTDIR)$(BINDIR) + install -m 755 youtube-dlc $(DESTDIR)$(BINDIR) install -d $(DESTDIR)$(MANDIR)/man1 - install -m 644 youtube-dl.1 $(DESTDIR)$(MANDIR)/man1 + install -m 644 youtube-dlc.1 $(DESTDIR)$(MANDIR)/man1 install -d $(DESTDIR)$(SYSCONFDIR)/bash_completion.d - install -m 644 youtube-dl.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dl + install -m 644 youtube-dlc.bash-completion $(DESTDIR)$(SYSCONFDIR)/bash_completion.d/youtube-dlc install -d $(DESTDIR)$(SHAREDIR)/zsh/site-functions - install -m 644 youtube-dl.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dl + install -m 644 youtube-dlc.zsh $(DESTDIR)$(SHAREDIR)/zsh/site-functions/_youtube-dlc install -d $(DESTDIR)$(SYSCONFDIR)/fish/completions - install -m 644 youtube-dl.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dl.fish + install -m 644 youtube-dlc.fish $(DESTDIR)$(SYSCONFDIR)/fish/completions/youtube-dlc.fish codetest: flake8 . test: - #nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose --processes 4 test + #nosetests --with-coverage --cover-package=youtube_dlc --cover-html --verbose --processes 4 test nosetests --verbose test $(MAKE) codetest @@ -51,34 +51,34 @@ offlinetest: codetest --exclude test_youtube_lists.py \ --exclude test_youtube_signature.py -tar: youtube-dl.tar.gz +tar: youtube-dlc.tar.gz .PHONY: all clean install test tar bash-completion pypi-files zsh-completion fish-completion ot offlinetest codetest supportedsites -pypi-files: youtube-dl.bash-completion README.txt youtube-dl.1 youtube-dl.fish +pypi-files: youtube-dlc.bash-completion README.txt youtube-dlc.1 youtube-dlc.fish -youtube-dl: youtube_dl/*.py youtube_dl/*/*.py +youtube-dlc: youtube_dlc/*.py youtube_dlc/*/*.py mkdir -p zip - for d in youtube_dl youtube_dl/downloader youtube_dl/extractor youtube_dl/postprocessor ; do \ + for d in youtube_dlc youtube_dlc/downloader youtube_dlc/extractor youtube_dlc/postprocessor ; do \ mkdir -p zip/$$d ;\ cp -pPR $$d/*.py zip/$$d/ ;\ done - touch -t 200001010101 zip/youtube_dl/*.py zip/youtube_dl/*/*.py - mv zip/youtube_dl/__main__.py zip/ - cd zip ; zip -q ../youtube-dl youtube_dl/*.py youtube_dl/*/*.py __main__.py + touch -t 200001010101 zip/youtube_dlc/*.py zip/youtube_dlc/*/*.py + mv zip/youtube_dlc/__main__.py zip/ + cd zip ; zip -q ../youtube-dlc youtube_dlc/*.py youtube_dlc/*/*.py __main__.py rm -rf zip - echo '#!$(PYTHON)' > youtube-dl - cat youtube-dl.zip >> youtube-dl - rm youtube-dl.zip - chmod a+x youtube-dl + echo '#!$(PYTHON)' > youtube-dlc + cat youtube-dlc.zip >> youtube-dlc + rm youtube-dlc.zip + chmod a+x youtube-dlc -README.md: youtube_dl/*.py youtube_dl/*/*.py - COLUMNS=80 $(PYTHON) youtube_dl/__main__.py --help | $(PYTHON) devscripts/make_readme.py +README.md: youtube_dlc/*.py youtube_dlc/*/*.py + COLUMNS=80 $(PYTHON) youtube_dlc/__main__.py --help | $(PYTHON) devscripts/make_readme.py CONTRIBUTING.md: README.md $(PYTHON) devscripts/make_contributing.py README.md CONTRIBUTING.md -issuetemplates: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE_tmpl/4_bug_report.md .github/ISSUE_TEMPLATE_tmpl/5_feature_request.md youtube_dl/version.py +issuetemplates: devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE_tmpl/4_bug_report.md .github/ISSUE_TEMPLATE_tmpl/5_feature_request.md youtube_dlc/version.py $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/1_broken_site.md .github/ISSUE_TEMPLATE/1_broken_site.md $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/2_site_support_request.md .github/ISSUE_TEMPLATE/2_site_support_request.md $(PYTHON) devscripts/make_issue_template.py .github/ISSUE_TEMPLATE_tmpl/3_site_feature_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md @@ -91,34 +91,34 @@ supportedsites: README.txt: README.md pandoc -f $(MARKDOWN) -t plain README.md -o README.txt -youtube-dl.1: README.md - $(PYTHON) devscripts/prepare_manpage.py youtube-dl.1.temp.md - pandoc -s -f $(MARKDOWN) -t man youtube-dl.1.temp.md -o youtube-dl.1 - rm -f youtube-dl.1.temp.md +youtube-dlc.1: README.md + $(PYTHON) devscripts/prepare_manpage.py youtube-dlc.1.temp.md + pandoc -s -f $(MARKDOWN) -t man youtube-dlc.1.temp.md -o youtube-dlc.1 + rm -f youtube-dlc.1.temp.md -youtube-dl.bash-completion: youtube_dl/*.py youtube_dl/*/*.py devscripts/bash-completion.in +youtube-dlc.bash-completion: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/bash-completion.in $(PYTHON) devscripts/bash-completion.py -bash-completion: youtube-dl.bash-completion +bash-completion: youtube-dlc.bash-completion -youtube-dl.zsh: youtube_dl/*.py youtube_dl/*/*.py devscripts/zsh-completion.in +youtube-dlc.zsh: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/zsh-completion.in $(PYTHON) devscripts/zsh-completion.py -zsh-completion: youtube-dl.zsh +zsh-completion: youtube-dlc.zsh -youtube-dl.fish: youtube_dl/*.py youtube_dl/*/*.py devscripts/fish-completion.in +youtube-dlc.fish: youtube_dlc/*.py youtube_dlc/*/*.py devscripts/fish-completion.in $(PYTHON) devscripts/fish-completion.py -fish-completion: youtube-dl.fish +fish-completion: youtube-dlc.fish -lazy-extractors: youtube_dl/extractor/lazy_extractors.py +lazy-extractors: youtube_dlc/extractor/lazy_extractors.py -_EXTRACTOR_FILES = $(shell find youtube_dl/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py') -youtube_dl/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES) +_EXTRACTOR_FILES = $(shell find youtube_dlc/extractor -iname '*.py' -and -not -iname 'lazy_extractors.py') +youtube_dlc/extractor/lazy_extractors.py: devscripts/make_lazy_extractors.py devscripts/lazy_load_template.py $(_EXTRACTOR_FILES) $(PYTHON) devscripts/make_lazy_extractors.py $@ -youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash-completion youtube-dl.zsh youtube-dl.fish ChangeLog AUTHORS - @tar -czf youtube-dl.tar.gz --transform "s|^|youtube-dl/|" --owner 0 --group 0 \ +youtube-dlc.tar.gz: youtube-dlc README.md README.txt youtube-dlc.1 youtube-dlc.bash-completion youtube-dlc.zsh youtube-dlc.fish ChangeLog AUTHORS + @tar -czf youtube-dlc.tar.gz --transform "s|^|youtube-dlc/|" --owner 0 --group 0 \ --exclude '*.DS_Store' \ --exclude '*.kate-swp' \ --exclude '*.pyc' \ @@ -128,8 +128,8 @@ youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash- --exclude '.git' \ --exclude 'docs/_build' \ -- \ - bin devscripts test youtube_dl docs \ + bin devscripts test youtube_dlc docs \ ChangeLog AUTHORS LICENSE README.md README.txt \ - Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion \ - youtube-dl.zsh youtube-dl.fish setup.py setup.cfg \ - youtube-dl + Makefile MANIFEST.in youtube-dlc.1 youtube-dlc.bash-completion \ + youtube-dlc.zsh youtube-dlc.fish setup.py setup.cfg \ + youtube-dlc diff --git a/README.md b/README.md index 9854aab92..5e4cd3a44 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Using curl: To build the Windows executable yourself python -m pip install --upgrade pyinstaller - pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dlc + pyinstaller.exe youtube_dlc\__main__.py --onefile --name youtube-dlc Or simply execute the `make_win.bat` if pyinstaller is installed. There will be a `youtube-dlc.exe` in `/dist` @@ -71,18 +71,18 @@ Then simply type this extractor --default-search PREFIX Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos - from google videos for youtube-dl "large + from google videos for youtube-dlc "large apple". Use the value "auto" to let - youtube-dl guess ("auto_warning" to emit a + youtube-dlc guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching. --ignore-config Do not read configuration files. When given in the global configuration file - /etc/youtube-dl.conf: Do not read the user + /etc/youtube-dlc.conf: Do not read the user configuration in ~/.config/youtube- - dl/config (%APPDATA%/youtube-dl/config.txt + dl/config (%APPDATA%/youtube-dlc/config.txt on Windows) --config-location PATH Location of the configuration file; either the path to the config or its containing @@ -240,7 +240,7 @@ Then simply type this filenames -w, --no-overwrites Do not overwrite files -c, --continue Force resume of partially downloaded files. - By default, youtube-dl will resume + By default, youtube-dlc will resume downloads if possible. --no-continue Do not resume partially downloaded files (restart from beginning) @@ -258,11 +258,11 @@ Then simply type this option) --cookies FILE File to read cookies from and dump cookie jar in - --cache-dir DIR Location in the filesystem where youtube-dl + --cache-dir DIR Location in the filesystem where youtube-dlc can store some downloaded information permanently. By default - $XDG_CACHE_HOME/youtube-dl or - ~/.cache/youtube-dl . At the moment, only + $XDG_CACHE_HOME/youtube-dlc or + ~/.cache/youtube-dlc . At the moment, only YouTube player files (for videos with obfuscated signatures) are cached, but that may change. @@ -308,8 +308,8 @@ Then simply type this files in the current directory to debug problems --print-traffic Display sent and read HTTP traffic - -C, --call-home Contact the youtube-dl server for debugging - --no-call-home Do NOT contact the youtube-dl server for + -C, --call-home Contact the youtube-dlc server for debugging + --no-call-home Do NOT contact the youtube-dlc server for debugging ## Workarounds: @@ -370,7 +370,7 @@ Then simply type this ## Authentication Options: -u, --username USERNAME Login with this account ID -p, --password PASSWORD Account password. If this option is left - out, youtube-dl will ask interactively. + out, youtube-dlc will ask interactively. -2, --twofactor TWOFACTOR Two-factor authentication code -n, --netrc Use .netrc authentication data --video-password PASSWORD Video password (vimeo, smotri, youku) @@ -381,7 +381,7 @@ Then simply type this a list of available MSOs --ap-username USERNAME Multiple-system operator account login --ap-password PASSWORD Multiple-system operator account password. - If this option is left out, youtube-dl will + If this option is left out, youtube-dlc will ask interactively. --ap-list-mso List all supported multiple-system operators @@ -444,6 +444,6 @@ Then simply type this # COPYRIGHT -youtube-dl is released into the public domain by the copyright holders. +youtube-dlc is released into the public domain by the copyright holders. This README file was originally written by [Daniel Bolton](https://github.com/dbbolton) and is likewise released into the public domain. diff --git a/devscripts/bash-completion.in b/devscripts/bash-completion.in index 28bd23727..1bf41f2cc 100644 --- a/devscripts/bash-completion.in +++ b/devscripts/bash-completion.in @@ -1,4 +1,4 @@ -__youtube_dl() +__youtube_dlc() { local cur prev opts fileopts diropts keywords COMPREPLY=() @@ -26,4 +26,4 @@ __youtube_dl() fi } -complete -F __youtube_dl youtube-dl +complete -F __youtube_dlc youtube-dlc diff --git a/devscripts/bash-completion.py b/devscripts/bash-completion.py index 3d1391334..d68c9b1cc 100755 --- a/devscripts/bash-completion.py +++ b/devscripts/bash-completion.py @@ -6,9 +6,9 @@ from os.path import dirname as dirn import sys sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) -import youtube_dl +import youtube_dlc -BASH_COMPLETION_FILE = "youtube-dl.bash-completion" +BASH_COMPLETION_FILE = "youtube-dlc.bash-completion" BASH_COMPLETION_TEMPLATE = "devscripts/bash-completion.in" @@ -26,5 +26,5 @@ def build_completion(opt_parser): f.write(filled_template) -parser = youtube_dl.parseOpts()[0] +parser = youtube_dlc.parseOpts()[0] build_completion(parser) diff --git a/devscripts/buildserver.py b/devscripts/buildserver.py index 4a4295ba9..62dbd2cb1 100644 --- a/devscripts/buildserver.py +++ b/devscripts/buildserver.py @@ -12,7 +12,7 @@ import traceback import os.path sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(__file__))))) -from youtube_dl.compat import ( +from youtube_dlc.compat import ( compat_input, compat_http_server, compat_str, @@ -325,7 +325,7 @@ class YoutubeDLBuilder(object): authorizedUsers = ['fraca7', 'phihag', 'rg3', 'FiloSottile', 'ytdl-org'] def __init__(self, **kwargs): - if self.repoName != 'youtube-dl': + if self.repoName != 'youtube-dlc': raise BuildError('Invalid repository "%s"' % self.repoName) if self.user not in self.authorizedUsers: raise HTTPError('Unauthorized user "%s"' % self.user, 401) diff --git a/devscripts/check-porn.py b/devscripts/check-porn.py index 740f04de0..68a33d823 100644 --- a/devscripts/check-porn.py +++ b/devscripts/check-porn.py @@ -15,8 +15,8 @@ import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import gettestcases -from youtube_dl.utils import compat_urllib_parse_urlparse -from youtube_dl.utils import compat_urllib_request +from youtube_dlc.utils import compat_urllib_parse_urlparse +from youtube_dlc.utils import compat_urllib_request if len(sys.argv) > 1: METHOD = 'LIST' diff --git a/devscripts/create-github-release.py b/devscripts/create-github-release.py index 2ddfa1096..4714d81a6 100644 --- a/devscripts/create-github-release.py +++ b/devscripts/create-github-release.py @@ -12,13 +12,13 @@ import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.compat import ( +from youtube_dlc.compat import ( compat_basestring, compat_getpass, compat_print, compat_urllib_request, ) -from youtube_dl.utils import ( +from youtube_dlc.utils import ( make_HTTPS_handler, sanitized_Request, ) @@ -98,7 +98,7 @@ def main(): releaser = GitHubReleaser() new_release = releaser.create_release( - version, name='youtube-dl %s' % version, body=body) + version, name='youtube-dlc %s' % version, body=body) release_id = new_release['id'] for asset in os.listdir(build_path): diff --git a/devscripts/fish-completion.in b/devscripts/fish-completion.in index eb79765da..4f08b6d4a 100644 --- a/devscripts/fish-completion.in +++ b/devscripts/fish-completion.in @@ -2,4 +2,4 @@ {{commands}} -complete --command youtube-dl --arguments ":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory" +complete --command youtube-dlc --arguments ":ytfavorites :ytrecommended :ytsubscriptions :ytwatchlater :ythistory" diff --git a/devscripts/fish-completion.py b/devscripts/fish-completion.py index 51d19dd33..a27ef44f8 100755 --- a/devscripts/fish-completion.py +++ b/devscripts/fish-completion.py @@ -7,10 +7,10 @@ from os.path import dirname as dirn import sys sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) -import youtube_dl -from youtube_dl.utils import shell_quote +import youtube_dlc +from youtube_dlc.utils import shell_quote -FISH_COMPLETION_FILE = 'youtube-dl.fish' +FISH_COMPLETION_FILE = 'youtube-dlc.fish' FISH_COMPLETION_TEMPLATE = 'devscripts/fish-completion.in' EXTRA_ARGS = { @@ -30,7 +30,7 @@ def build_completion(opt_parser): for group in opt_parser.option_groups: for option in group.option_list: long_option = option.get_opt_string().strip('-') - complete_cmd = ['complete', '--command', 'youtube-dl', '--long-option', long_option] + complete_cmd = ['complete', '--command', 'youtube-dlc', '--long-option', long_option] if option._short_opts: complete_cmd += ['--short-option', option._short_opts[0].strip('-')] if option.help != optparse.SUPPRESS_HELP: @@ -45,5 +45,5 @@ def build_completion(opt_parser): f.write(filled_template) -parser = youtube_dl.parseOpts()[0] +parser = youtube_dlc.parseOpts()[0] build_completion(parser) diff --git a/devscripts/generate_aes_testdata.py b/devscripts/generate_aes_testdata.py index e3df42cc2..c89bb547e 100644 --- a/devscripts/generate_aes_testdata.py +++ b/devscripts/generate_aes_testdata.py @@ -7,8 +7,8 @@ import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.utils import intlist_to_bytes -from youtube_dl.aes import aes_encrypt, key_expansion +from youtube_dlc.utils import intlist_to_bytes +from youtube_dlc.aes import aes_encrypt, key_expansion secret_msg = b'Secret message goes here' diff --git a/devscripts/gh-pages/add-version.py b/devscripts/gh-pages/add-version.py index 867ea0048..04588a5ee 100755 --- a/devscripts/gh-pages/add-version.py +++ b/devscripts/gh-pages/add-version.py @@ -22,9 +22,9 @@ if 'signature' in versions_info: new_version = {} filenames = { - 'bin': 'youtube-dl', - 'exe': 'youtube-dl.exe', - 'tar': 'youtube-dl-%s.tar.gz' % version} + 'bin': 'youtube-dlc', + 'exe': 'youtube-dlc.exe', + 'tar': 'youtube-dlc-%s.tar.gz' % version} build_dir = os.path.join('..', '..', 'build', version) for key, filename in filenames.items(): url = 'https://yt-dl.org/downloads/%s/%s' % (version, filename) diff --git a/devscripts/gh-pages/update-feed.py b/devscripts/gh-pages/update-feed.py index 506a62377..b07f1e830 100755 --- a/devscripts/gh-pages/update-feed.py +++ b/devscripts/gh-pages/update-feed.py @@ -11,24 +11,24 @@ atom_template = textwrap.dedent("""\ - youtube-dl releases - https://yt-dl.org/feed/youtube-dl-updates-feed + youtube-dlc releases + https://yt-dl.org/feed/youtube-dlc-updates-feed @TIMESTAMP@ @ENTRIES@ """) entry_template = textwrap.dedent(""" - https://yt-dl.org/feed/youtube-dl-updates-feed/youtube-dl-@VERSION@ + https://yt-dl.org/feed/youtube-dlc-updates-feed/youtube-dlc-@VERSION@ New version @VERSION@ - + - The youtube-dl maintainers + The youtube-dlc maintainers @TIMESTAMP@ diff --git a/devscripts/gh-pages/update-sites.py b/devscripts/gh-pages/update-sites.py index 531c93c70..38acb5d9a 100755 --- a/devscripts/gh-pages/update-sites.py +++ b/devscripts/gh-pages/update-sites.py @@ -5,10 +5,10 @@ import sys import os import textwrap -# We must be able to import youtube_dl +# We must be able to import youtube_dlc sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) -import youtube_dl +import youtube_dlc def main(): @@ -16,7 +16,7 @@ def main(): template = tmplf.read() ie_htmls = [] - for ie in youtube_dl.list_extractors(age_limit=None): + for ie in youtube_dlc.list_extractors(age_limit=None): ie_html = '{}'.format(ie.IE_NAME) ie_desc = getattr(ie, 'IE_DESC', None) if ie_desc is False: diff --git a/devscripts/make_contributing.py b/devscripts/make_contributing.py index 226d1a5d6..f18de0560 100755 --- a/devscripts/make_contributing.py +++ b/devscripts/make_contributing.py @@ -20,7 +20,7 @@ def main(): bug_text = re.search( r'(?s)#\s*BUGS\s*[^\n]*\s*(.*?)#\s*COPYRIGHT', readme).group(1) dev_text = re.search( - r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING YOUTUBE-DL', + r'(?s)(#\s*DEVELOPER INSTRUCTIONS.*?)#\s*EMBEDDING youtube-dlc', readme).group(1) out = bug_text + dev_text diff --git a/devscripts/make_issue_template.py b/devscripts/make_issue_template.py index b7ad23d83..37cb0d4ee 100644 --- a/devscripts/make_issue_template.py +++ b/devscripts/make_issue_template.py @@ -16,9 +16,9 @@ def main(): with io.open(infile, encoding='utf-8') as inf: issue_template_tmpl = inf.read() - # Get the version from youtube_dl/version.py without importing the package - exec(compile(open('youtube_dl/version.py').read(), - 'youtube_dl/version.py', 'exec')) + # Get the version from youtube_dlc/version.py without importing the package + exec(compile(open('youtube_dlc/version.py').read(), + 'youtube_dlc/version.py', 'exec')) out = issue_template_tmpl % {'version': locals()['__version__']} diff --git a/devscripts/make_lazy_extractors.py b/devscripts/make_lazy_extractors.py index 0a1762dbc..e6de72b33 100644 --- a/devscripts/make_lazy_extractors.py +++ b/devscripts/make_lazy_extractors.py @@ -14,8 +14,8 @@ lazy_extractors_filename = sys.argv[1] if os.path.exists(lazy_extractors_filename): os.remove(lazy_extractors_filename) -from youtube_dl.extractor import _ALL_CLASSES -from youtube_dl.extractor.common import InfoExtractor, SearchInfoExtractor +from youtube_dlc.extractor import _ALL_CLASSES +from youtube_dlc.extractor.common import InfoExtractor, SearchInfoExtractor with open('devscripts/lazy_load_template.py', 'rt') as f: module_template = f.read() diff --git a/devscripts/make_supportedsites.py b/devscripts/make_supportedsites.py index 764795bc5..0ae6f8aa3 100644 --- a/devscripts/make_supportedsites.py +++ b/devscripts/make_supportedsites.py @@ -7,10 +7,10 @@ import os import sys -# Import youtube_dl +# Import youtube_dlc ROOT_DIR = os.path.join(os.path.dirname(__file__), '..') sys.path.insert(0, ROOT_DIR) -import youtube_dl +import youtube_dlc def main(): @@ -33,7 +33,7 @@ def main(): ie_md += ' (Currently broken)' yield ie_md - ies = sorted(youtube_dl.gen_extractors(), key=lambda i: i.IE_NAME.lower()) + ies = sorted(youtube_dlc.gen_extractors(), key=lambda i: i.IE_NAME.lower()) out = '# Supported sites\n' + ''.join( ' - ' + md + '\n' for md in gen_ies_md(ies)) diff --git a/devscripts/prepare_manpage.py b/devscripts/prepare_manpage.py index 76bf873e1..843ade482 100644 --- a/devscripts/prepare_manpage.py +++ b/devscripts/prepare_manpage.py @@ -8,7 +8,7 @@ import re ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) README_FILE = os.path.join(ROOT_DIR, 'README.md') -PREFIX = r'''%YOUTUBE-DL(1) +PREFIX = r'''%youtube-dlc(1) # NAME @@ -16,7 +16,7 @@ youtube\-dl \- download videos from youtube.com or other video platforms # SYNOPSIS -**youtube-dl** \[OPTIONS\] URL [URL...] +**youtube-dlc** \[OPTIONS\] URL [URL...] ''' @@ -33,7 +33,7 @@ def main(): readme = f.read() readme = re.sub(r'(?s)^.*?(?=# DESCRIPTION)', '', readme) - readme = re.sub(r'\s+youtube-dl \[OPTIONS\] URL \[URL\.\.\.\]', '', readme) + readme = re.sub(r'\s+youtube-dlc \[OPTIONS\] URL \[URL\.\.\.\]', '', readme) readme = PREFIX + readme readme = filter_options(readme) diff --git a/devscripts/release.sh b/devscripts/release.sh index f2411c927..04cb7fec1 100755 --- a/devscripts/release.sh +++ b/devscripts/release.sh @@ -53,8 +53,8 @@ fi if [ ! -z "`git tag | grep "$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi if [ ! -z "`git status --porcelain | grep -v CHANGELOG`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi -useless_files=$(find youtube_dl -type f -not -name '*.py') -if [ ! -z "$useless_files" ]; then echo "ERROR: Non-.py files in youtube_dl: $useless_files"; exit 1; fi +useless_files=$(find youtube_dlc -type f -not -name '*.py') +if [ ! -z "$useless_files" ]; then echo "ERROR: Non-.py files in youtube_dlc: $useless_files"; exit 1; fi if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi if ! type pandoc >/dev/null 2>/dev/null; then echo 'ERROR: pandoc is missing'; exit 1; fi if ! python3 -c 'import rsa' 2>/dev/null; then echo 'ERROR: python3-rsa is missing'; exit 1; fi @@ -68,18 +68,18 @@ make clean if $skip_tests ; then echo 'SKIPPING TESTS' else - nosetests --verbose --with-coverage --cover-package=youtube_dl --cover-html test --stop || exit 1 + nosetests --verbose --with-coverage --cover-package=youtube_dlc --cover-html test --stop || exit 1 fi /bin/echo -e "\n### Changing version in version.py..." -sed -i "s/__version__ = '.*'/__version__ = '$version'/" youtube_dl/version.py +sed -i "s/__version__ = '.*'/__version__ = '$version'/" youtube_dlc/version.py /bin/echo -e "\n### Changing version in ChangeLog..." sed -i "s//$version/" ChangeLog -/bin/echo -e "\n### Committing documentation, templates and youtube_dl/version.py..." +/bin/echo -e "\n### Committing documentation, templates and youtube_dlc/version.py..." make README.md CONTRIBUTING.md issuetemplates supportedsites -git add README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE/1_broken_site.md .github/ISSUE_TEMPLATE/2_site_support_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md .github/ISSUE_TEMPLATE/4_bug_report.md .github/ISSUE_TEMPLATE/5_feature_request.md .github/ISSUE_TEMPLATE/6_question.md docs/supportedsites.md youtube_dl/version.py ChangeLog +git add README.md CONTRIBUTING.md .github/ISSUE_TEMPLATE/1_broken_site.md .github/ISSUE_TEMPLATE/2_site_support_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md .github/ISSUE_TEMPLATE/4_bug_report.md .github/ISSUE_TEMPLATE/5_feature_request.md .github/ISSUE_TEMPLATE/6_question.md docs/supportedsites.md youtube_dlc/version.py ChangeLog git commit $gpg_sign_commits -m "release $version" /bin/echo -e "\n### Now tagging, signing and pushing..." @@ -94,13 +94,13 @@ git push origin "$version" /bin/echo -e "\n### OK, now it is time to build the binaries..." REV=$(git rev-parse HEAD) -make youtube-dl youtube-dl.tar.gz +make youtube-dlc youtube-dlc.tar.gz read -p "VM running? (y/n) " -n 1 -wget "http://$buildserver/build/ytdl-org/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe +wget "http://$buildserver/build/ytdl-org/youtube-dl/youtube-dlc.exe?rev=$REV" -O youtube-dlc.exe mkdir -p "build/$version" -mv youtube-dl youtube-dl.exe "build/$version" -mv youtube-dl.tar.gz "build/$version/youtube-dl-$version.tar.gz" -RELEASE_FILES="youtube-dl youtube-dl.exe youtube-dl-$version.tar.gz" +mv youtube-dlc youtube-dlc.exe "build/$version" +mv youtube-dlc.tar.gz "build/$version/youtube-dlc-$version.tar.gz" +RELEASE_FILES="youtube-dlc youtube-dlc.exe youtube-dlc-$version.tar.gz" (cd build/$version/ && md5sum $RELEASE_FILES > MD5SUMS) (cd build/$version/ && sha1sum $RELEASE_FILES > SHA1SUMS) (cd build/$version/ && sha256sum $RELEASE_FILES > SHA2-256SUMS) diff --git a/devscripts/show-downloads-statistics.py b/devscripts/show-downloads-statistics.py index 6c8d1cc2d..ef90a56ab 100644 --- a/devscripts/show-downloads-statistics.py +++ b/devscripts/show-downloads-statistics.py @@ -9,11 +9,11 @@ import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.compat import ( +from youtube_dlc.compat import ( compat_print, compat_urllib_request, ) -from youtube_dl.utils import format_bytes +from youtube_dlc.utils import format_bytes def format_size(bytes): @@ -36,9 +36,9 @@ for page in itertools.count(1): asset_name = asset['name'] total_bytes += asset['download_count'] * asset['size'] if all(not re.match(p, asset_name) for p in ( - r'^youtube-dl$', - r'^youtube-dl-\d{4}\.\d{2}\.\d{2}(?:\.\d+)?\.tar\.gz$', - r'^youtube-dl\.exe$')): + r'^youtube-dlc$', + r'^youtube-dlc-\d{4}\.\d{2}\.\d{2}(?:\.\d+)?\.tar\.gz$', + r'^youtube-dlc\.exe$')): continue compat_print( ' %s size: %s downloads: %d' diff --git a/devscripts/zsh-completion.in b/devscripts/zsh-completion.in index b394a1ae7..bb021862f 100644 --- a/devscripts/zsh-completion.in +++ b/devscripts/zsh-completion.in @@ -1,6 +1,6 @@ -#compdef youtube-dl +#compdef youtube-dlc -__youtube_dl() { +__youtube_dlc() { local curcontext="$curcontext" fileopts diropts cur prev typeset -A opt_args fileopts="{{fileopts}}" @@ -25,4 +25,4 @@ __youtube_dl() { esac } -__youtube_dl \ No newline at end of file +__youtube_dlc \ No newline at end of file diff --git a/devscripts/zsh-completion.py b/devscripts/zsh-completion.py index 60aaf76cc..8b957144f 100755 --- a/devscripts/zsh-completion.py +++ b/devscripts/zsh-completion.py @@ -6,9 +6,9 @@ from os.path import dirname as dirn import sys sys.path.insert(0, dirn(dirn((os.path.abspath(__file__))))) -import youtube_dl +import youtube_dlc -ZSH_COMPLETION_FILE = "youtube-dl.zsh" +ZSH_COMPLETION_FILE = "youtube-dlc.zsh" ZSH_COMPLETION_TEMPLATE = "devscripts/zsh-completion.in" @@ -45,5 +45,5 @@ def build_completion(opt_parser): f.write(template) -parser = youtube_dl.parseOpts()[0] +parser = youtube_dlc.parseOpts()[0] build_completion(parser) diff --git a/docs/Makefile b/docs/Makefile index 712218045..a7159ff45 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -85,17 +85,17 @@ qthelp: @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/youtube-dl.qhcp" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/youtube-dlc.qhcp" @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/youtube-dl.qhc" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/youtube-dlc.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/youtube-dl" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/youtube-dl" + @echo "# mkdir -p $$HOME/.local/share/devhelp/youtube-dlc" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/youtube-dlc" @echo "# devhelp" epub: diff --git a/docs/conf.py b/docs/conf.py index 0aaf1b8fc..fa616ebbb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ # coding: utf-8 # -# youtube-dl documentation build configuration file, created by +# youtube-dlc documentation build configuration file, created by # sphinx-quickstart on Fri Mar 14 21:05:43 2014. # # This file is execfile()d with the current directory set to its @@ -14,7 +14,7 @@ import sys import os -# Allows to import youtube_dl +# Allows to import youtube_dlc sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # -- General configuration ------------------------------------------------ @@ -36,7 +36,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'youtube-dl' +project = u'youtube-dlc' copyright = u'2014, Ricardo Garcia Gonzalez' # The version info for the project you're documenting, acts as replacement for @@ -44,7 +44,7 @@ copyright = u'2014, Ricardo Garcia Gonzalez' # built documents. # # The short X.Y version. -from youtube_dl.version import __version__ +from youtube_dlc.version import __version__ version = __version__ # The full version, including alpha/beta/rc tags. release = version @@ -68,4 +68,4 @@ html_theme = 'default' html_static_path = ['_static'] # Output file base name for HTML help builder. -htmlhelp_basename = 'youtube-dldoc' +htmlhelp_basename = 'youtube-dlcdoc' diff --git a/docs/index.rst b/docs/index.rst index b746ff95b..afa26fef1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,13 +1,13 @@ -Welcome to youtube-dl's documentation! +Welcome to youtube-dlc's documentation! ====================================== -*youtube-dl* is a command-line program to download videos from YouTube.com and more sites. +*youtube-dlc* is a command-line program to download videos from YouTube.com and more sites. It can also be used in Python code. Developer guide --------------- -This section contains information for using *youtube-dl* from Python programs. +This section contains information for using *youtube-dlc* from Python programs. .. toctree:: :maxdepth: 2 diff --git a/docs/module_guide.rst b/docs/module_guide.rst index 03d72882e..6413659cf 100644 --- a/docs/module_guide.rst +++ b/docs/module_guide.rst @@ -1,11 +1,11 @@ -Using the ``youtube_dl`` module +Using the ``youtube_dlc`` module =============================== -When using the ``youtube_dl`` module, you start by creating an instance of :class:`YoutubeDL` and adding all the available extractors: +When using the ``youtube_dlc`` module, you start by creating an instance of :class:`YoutubeDL` and adding all the available extractors: .. code-block:: python - >>> from youtube_dl import YoutubeDL + >>> from youtube_dlc import YoutubeDL >>> ydl = YoutubeDL() >>> ydl.add_default_info_extractors() @@ -22,7 +22,7 @@ You use the :meth:`YoutubeDL.extract_info` method for getting the video informat [youtube] BaW_jenozKc: Downloading video info webpage [youtube] BaW_jenozKc: Extracting video information >>> info['title'] - 'youtube-dl test video "\'/\\ä↭𝕐' + 'youtube-dlc test video "\'/\\ä↭𝕐' >>> info['height'], info['width'] (720, 1280) diff --git a/make_win.bat b/make_win.bat index a1f692e17..c5caac08f 100644 --- a/make_win.bat +++ b/make_win.bat @@ -1 +1 @@ -pyinstaller.exe youtube_dl\__main__.py --onefile --name youtube-dlc \ No newline at end of file +pyinstaller.exe youtube_dlc\__main__.py --onefile --name youtube-dlc \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index da78a9c47..f658aaa0a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,5 +2,5 @@ universal = True [flake8] -exclude = youtube_dl/extractor/__init__.py,devscripts/buildserver.py,devscripts/lazy_load_template.py,devscripts/make_issue_template.py,setup.py,build,.git,venv +exclude = youtube_dlc/extractor/__init__.py,devscripts/buildserver.py,devscripts/lazy_load_template.py,devscripts/make_issue_template.py,setup.py,build,.git,venv ignore = E402,E501,E731,E741,W503 diff --git a/setup.py b/setup.py index 23553b88a..083f9b0f8 100644 --- a/setup.py +++ b/setup.py @@ -7,9 +7,9 @@ import warnings import sys from distutils.spawn import spawn -# Get the version from youtube_dl/version.py without importing the package -exec(compile(open('youtube_dl/version.py').read(), - 'youtube_dl/version.py', 'exec')) +# Get the version from youtube_dlc/version.py without importing the package +exec(compile(open('youtube_dlc/version.py').read(), + 'youtube_dlc/version.py', 'exec')) DESCRIPTION = 'Media downloader supporting various sites such as youtube' LONG_DESCRIPTION = 'Command-line program to download videos from YouTube.com and other video sites. Based on a more active community fork.' @@ -18,10 +18,10 @@ if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe': print("inv") else: files_spec = [ - ('etc/bash_completion.d', ['youtube-dl.bash-completion']), - ('etc/fish/completions', ['youtube-dl.fish']), - ('share/doc/youtube_dl', ['README.txt']), - ('share/man/man1', ['youtube-dl.1']) + ('etc/bash_completion.d', ['youtube-dlc.bash-completion']), + ('etc/fish/completions', ['youtube-dlc.fish']), + ('share/doc/youtube_dlc', ['README.txt']), + ('share/man/man1', ['youtube-dlc.1']) ] root = os.path.dirname(os.path.abspath(__file__)) data_files = [] @@ -38,7 +38,7 @@ else: 'data_files': data_files, } #if setuptools_available: - params['entry_points'] = {'console_scripts': ['youtube-dlc = youtube_dl:main']} + params['entry_points'] = {'console_scripts': ['youtube-dlc = youtube_dlc:main']} #else: # params['scripts'] = ['bin/youtube-dlc'] @@ -54,7 +54,7 @@ class build_lazy_extractors(Command): def run(self): spawn( - [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'], + [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dlc/extractor/lazy_extractors.py'], dry_run=self.dry_run, ) @@ -69,9 +69,9 @@ setup( url="https://github.com/blackjack4494/youtube-dlc", # packages=setuptools.find_packages(), packages=[ - 'youtube_dl', - 'youtube_dl.extractor', 'youtube_dl.downloader', - 'youtube_dl.postprocessor'], + 'youtube_dlc', + 'youtube_dlc.extractor', 'youtube_dlc.downloader', + 'youtube_dlc.postprocessor'], classifiers=[ "Topic :: Multimedia :: Video", "Development Status :: 5 - Production/Stable", diff --git a/test/helper.py b/test/helper.py index e62aab11e..f45818b0f 100644 --- a/test/helper.py +++ b/test/helper.py @@ -10,13 +10,13 @@ import types import ssl import sys -import youtube_dl.extractor -from youtube_dl import YoutubeDL -from youtube_dl.compat import ( +import youtube_dlc.extractor +from youtube_dlc import YoutubeDL +from youtube_dlc.compat import ( compat_os_name, compat_str, ) -from youtube_dl.utils import ( +from youtube_dlc.utils import ( preferredencoding, write_string, ) @@ -90,7 +90,7 @@ class FakeYDL(YoutubeDL): def gettestcases(include_onlymatching=False): - for ie in youtube_dl.extractor.gen_extractors(): + for ie in youtube_dlc.extractor.gen_extractors(): for tc in ie.get_testcases(include_onlymatching): yield tc diff --git a/test/test_InfoExtractor.py b/test/test_InfoExtractor.py index 71f6608fe..bdd01e41a 100644 --- a/test/test_InfoExtractor.py +++ b/test/test_InfoExtractor.py @@ -10,10 +10,10 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL, expect_dict, expect_value, http_server_port -from youtube_dl.compat import compat_etree_fromstring, compat_http_server -from youtube_dl.extractor.common import InfoExtractor -from youtube_dl.extractor import YoutubeIE, get_info_extractor -from youtube_dl.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError +from youtube_dlc.compat import compat_etree_fromstring, compat_http_server +from youtube_dlc.extractor.common import InfoExtractor +from youtube_dlc.extractor import YoutubeIE, get_info_extractor +from youtube_dlc.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError import threading diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index 1e204e551..6d02c2a54 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -12,12 +12,12 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import copy from test.helper import FakeYDL, assertRegexpMatches -from youtube_dl import YoutubeDL -from youtube_dl.compat import compat_str, compat_urllib_error -from youtube_dl.extractor import YoutubeIE -from youtube_dl.extractor.common import InfoExtractor -from youtube_dl.postprocessor.common import PostProcessor -from youtube_dl.utils import ExtractorError, match_filter_func +from youtube_dlc import YoutubeDL +from youtube_dlc.compat import compat_str, compat_urllib_error +from youtube_dlc.extractor import YoutubeIE +from youtube_dlc.extractor.common import InfoExtractor +from youtube_dlc.postprocessor.common import PostProcessor +from youtube_dlc.utils import ExtractorError, match_filter_func TEST_URL = 'http://localhost/sample.mp4' diff --git a/test/test_YoutubeDLCookieJar.py b/test/test_YoutubeDLCookieJar.py index 05f48bd74..615d8a9d8 100644 --- a/test/test_YoutubeDLCookieJar.py +++ b/test/test_YoutubeDLCookieJar.py @@ -10,7 +10,7 @@ import tempfile import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.utils import YoutubeDLCookieJar +from youtube_dlc.utils import YoutubeDLCookieJar class TestYoutubeDLCookieJar(unittest.TestCase): diff --git a/test/test_aes.py b/test/test_aes.py index cc89fb6ab..ef1e1b189 100644 --- a/test/test_aes.py +++ b/test/test_aes.py @@ -8,8 +8,8 @@ import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text -from youtube_dl.utils import bytes_to_intlist, intlist_to_bytes +from youtube_dlc.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_cbc_encrypt, aes_decrypt_text +from youtube_dlc.utils import bytes_to_intlist, intlist_to_bytes import base64 # the encrypted data can be generate with 'devscripts/generate_aes_testdata.py' diff --git a/test/test_age_restriction.py b/test/test_age_restriction.py index 6f5513faa..b73bdd767 100644 --- a/test/test_age_restriction.py +++ b/test/test_age_restriction.py @@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import try_rm -from youtube_dl import YoutubeDL +from youtube_dlc import YoutubeDL def _download_restricted(url, filename, age): diff --git a/test/test_all_urls.py b/test/test_all_urls.py index 81056a999..7b6664cac 100644 --- a/test/test_all_urls.py +++ b/test/test_all_urls.py @@ -12,7 +12,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import gettestcases -from youtube_dl.extractor import ( +from youtube_dlc.extractor import ( FacebookIE, gen_extractors, YoutubeIE, @@ -70,7 +70,7 @@ class TestAllURLsMatching(unittest.TestCase): def test_youtube_search_matching(self): self.assertMatch('http://www.youtube.com/results?search_query=making+mustard', ['youtube:search_url']) - self.assertMatch('https://www.youtube.com/results?baz=bar&search_query=youtube-dl+test+video&filters=video&lclk=video', ['youtube:search_url']) + self.assertMatch('https://www.youtube.com/results?baz=bar&search_query=youtube-dlc+test+video&filters=video&lclk=video', ['youtube:search_url']) def test_youtube_extract(self): assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), id) diff --git a/test/test_cache.py b/test/test_cache.py index a16160142..1167519d1 100644 --- a/test/test_cache.py +++ b/test/test_cache.py @@ -13,7 +13,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL -from youtube_dl.cache import Cache +from youtube_dlc.cache import Cache def _is_empty(d): diff --git a/test/test_compat.py b/test/test_compat.py index 86ff389fd..8c49a001e 100644 --- a/test/test_compat.py +++ b/test/test_compat.py @@ -10,7 +10,7 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.compat import ( +from youtube_dlc.compat import ( compat_getenv, compat_setenv, compat_etree_Element, @@ -28,11 +28,11 @@ from youtube_dl.compat import ( class TestCompat(unittest.TestCase): def test_compat_getenv(self): test_str = 'тест' - compat_setenv('YOUTUBE_DL_COMPAT_GETENV', test_str) - self.assertEqual(compat_getenv('YOUTUBE_DL_COMPAT_GETENV'), test_str) + compat_setenv('youtube_dlc_COMPAT_GETENV', test_str) + self.assertEqual(compat_getenv('youtube_dlc_COMPAT_GETENV'), test_str) def test_compat_setenv(self): - test_var = 'YOUTUBE_DL_COMPAT_SETENV' + test_var = 'youtube_dlc_COMPAT_SETENV' test_str = 'тест' compat_setenv(test_var, test_str) compat_getenv(test_var) @@ -46,11 +46,11 @@ class TestCompat(unittest.TestCase): compat_setenv('HOME', old_home or '') def test_all_present(self): - import youtube_dl.compat - all_names = youtube_dl.compat.__all__ + import youtube_dlc.compat + all_names = youtube_dlc.compat.__all__ present_names = set(filter( lambda c: '_' in c and not c.startswith('_'), - dir(youtube_dl.compat))) - set(['unicode_literals']) + dir(youtube_dlc.compat))) - set(['unicode_literals']) self.assertEqual(all_names, sorted(present_names)) def test_compat_urllib_parse_unquote(self): diff --git a/test/test_download.py b/test/test_download.py index ebe820dfc..bcd3b4041 100644 --- a/test/test_download.py +++ b/test/test_download.py @@ -24,24 +24,24 @@ import io import json import socket -import youtube_dl.YoutubeDL -from youtube_dl.compat import ( +import youtube_dlc.YoutubeDL +from youtube_dlc.compat import ( compat_http_client, compat_urllib_error, compat_HTTPError, ) -from youtube_dl.utils import ( +from youtube_dlc.utils import ( DownloadError, ExtractorError, format_bytes, UnavailableVideoError, ) -from youtube_dl.extractor import get_info_extractor +from youtube_dlc.extractor import get_info_extractor RETRIES = 3 -class YoutubeDL(youtube_dl.YoutubeDL): +class YoutubeDL(youtube_dlc.YoutubeDL): def __init__(self, *args, **kwargs): self.to_stderr = self.to_screen self.processed_info_dicts = [] @@ -92,7 +92,7 @@ class TestDownload(unittest.TestCase): def generator(test_case, tname): def test_template(self): - ie = youtube_dl.extractor.get_info_extractor(test_case['name'])() + ie = youtube_dlc.extractor.get_info_extractor(test_case['name'])() other_ies = [get_info_extractor(ie_key)() for ie_key in test_case.get('add_ie', [])] is_playlist = any(k.startswith('playlist') for k in test_case) test_cases = test_case.get( diff --git a/test/test_downloader_http.py b/test/test_downloader_http.py index 750472281..c8e28bd3a 100644 --- a/test/test_downloader_http.py +++ b/test/test_downloader_http.py @@ -10,10 +10,10 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import http_server_port, try_rm -from youtube_dl import YoutubeDL -from youtube_dl.compat import compat_http_server -from youtube_dl.downloader.http import HttpFD -from youtube_dl.utils import encodeFilename +from youtube_dlc import YoutubeDL +from youtube_dlc.compat import compat_http_server +from youtube_dlc.downloader.http import HttpFD +from youtube_dlc.utils import encodeFilename import threading TEST_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/test/test_execution.py b/test/test_execution.py index 11661bb68..b18e63d73 100644 --- a/test/test_execution.py +++ b/test/test_execution.py @@ -10,7 +10,7 @@ import os import subprocess sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.utils import encodeArgument +from youtube_dlc.utils import encodeArgument rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -23,18 +23,18 @@ except AttributeError: class TestExecution(unittest.TestCase): def test_import(self): - subprocess.check_call([sys.executable, '-c', 'import youtube_dl'], cwd=rootDir) + subprocess.check_call([sys.executable, '-c', 'import youtube_dlc'], cwd=rootDir) def test_module_exec(self): if sys.version_info >= (2, 7): # Python 2.6 doesn't support package execution - subprocess.check_call([sys.executable, '-m', 'youtube_dl', '--version'], cwd=rootDir, stdout=_DEV_NULL) + subprocess.check_call([sys.executable, '-m', 'youtube_dlc', '--version'], cwd=rootDir, stdout=_DEV_NULL) def test_main_exec(self): - subprocess.check_call([sys.executable, 'youtube_dl/__main__.py', '--version'], cwd=rootDir, stdout=_DEV_NULL) + subprocess.check_call([sys.executable, 'youtube_dlc/__main__.py', '--version'], cwd=rootDir, stdout=_DEV_NULL) def test_cmdline_umlauts(self): p = subprocess.Popen( - [sys.executable, 'youtube_dl/__main__.py', encodeArgument('ä'), '--version'], + [sys.executable, 'youtube_dlc/__main__.py', encodeArgument('ä'), '--version'], cwd=rootDir, stdout=_DEV_NULL, stderr=subprocess.PIPE) _, stderr = p.communicate() self.assertFalse(stderr) diff --git a/test/test_http.py b/test/test_http.py index 3ee0a5dda..55c3c6183 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -9,8 +9,8 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import http_server_port -from youtube_dl import YoutubeDL -from youtube_dl.compat import compat_http_server, compat_urllib_request +from youtube_dlc import YoutubeDL +from youtube_dlc.compat import compat_http_server, compat_urllib_request import ssl import threading diff --git a/test/test_iqiyi_sdk_interpreter.py b/test/test_iqiyi_sdk_interpreter.py index 789059dbe..303609baa 100644 --- a/test/test_iqiyi_sdk_interpreter.py +++ b/test/test_iqiyi_sdk_interpreter.py @@ -9,7 +9,7 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL -from youtube_dl.extractor import IqiyiIE +from youtube_dlc.extractor import IqiyiIE class IqiyiIEWithCredentials(IqiyiIE): diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index c24b8ca74..97fc8d5aa 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -8,7 +8,7 @@ import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.jsinterp import JSInterpreter +from youtube_dlc.jsinterp import JSInterpreter class TestJSInterpreter(unittest.TestCase): diff --git a/test/test_netrc.py b/test/test_netrc.py index 7cf3a6a2e..566ba37a6 100644 --- a/test/test_netrc.py +++ b/test/test_netrc.py @@ -7,7 +7,7 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.extractor import ( +from youtube_dlc.extractor import ( gen_extractors, ) diff --git a/test/test_options.py b/test/test_options.py index 3a25a6ba3..dce253373 100644 --- a/test/test_options.py +++ b/test/test_options.py @@ -8,7 +8,7 @@ import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.options import _hide_login_info +from youtube_dlc.options import _hide_login_info class TestOptions(unittest.TestCase): diff --git a/test/test_postprocessors.py b/test/test_postprocessors.py index 4209d1d9a..6f538a3da 100644 --- a/test/test_postprocessors.py +++ b/test/test_postprocessors.py @@ -8,7 +8,7 @@ import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from youtube_dl.postprocessor import MetadataFromTitlePP +from youtube_dlc.postprocessor import MetadataFromTitlePP class TestMetadataFromTitle(unittest.TestCase): diff --git a/test/test_socks.py b/test/test_socks.py index 1e68eb0da..be52e2343 100644 --- a/test/test_socks.py +++ b/test/test_socks.py @@ -15,7 +15,7 @@ from test.helper import ( FakeYDL, get_params, ) -from youtube_dl.compat import ( +from youtube_dlc.compat import ( compat_str, compat_urllib_request, ) diff --git a/test/test_subtitles.py b/test/test_subtitles.py index 17aaaf20d..3ca03fb6f 100644 --- a/test/test_subtitles.py +++ b/test/test_subtitles.py @@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL, md5 -from youtube_dl.extractor import ( +from youtube_dlc.extractor import ( YoutubeIE, DailymotionIE, TEDIE, diff --git a/test/test_swfinterp.py b/test/test_swfinterp.py index 9f18055e6..1a8b353e8 100644 --- a/test/test_swfinterp.py +++ b/test/test_swfinterp.py @@ -14,7 +14,7 @@ import json import re import subprocess -from youtube_dl.swfinterp import SWFInterpreter +from youtube_dlc.swfinterp import SWFInterpreter TEST_DIR = os.path.join( diff --git a/test/test_update.py b/test/test_update.py index d9c71511d..1b144c43c 100644 --- a/test/test_update.py +++ b/test/test_update.py @@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import json -from youtube_dl.update import rsa_verify +from youtube_dlc.update import rsa_verify class TestUpdate(unittest.TestCase): diff --git a/test/test_utils.py b/test/test_utils.py index 0896f4150..663a34e07 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -15,7 +15,7 @@ import io import json import xml.etree.ElementTree -from youtube_dl.utils import ( +from youtube_dlc.utils import ( age_restricted, args_to_str, encode_base_n, @@ -105,7 +105,7 @@ from youtube_dl.utils import ( cli_bool_option, parse_codecs, ) -from youtube_dl.compat import ( +from youtube_dlc.compat import ( compat_chr, compat_etree_fromstring, compat_getenv, @@ -240,12 +240,12 @@ class TestUtil(unittest.TestCase): def env(var): return '%{0}%'.format(var) if sys.platform == 'win32' else '${0}'.format(var) - compat_setenv('YOUTUBE_DL_EXPATH_PATH', 'expanded') - self.assertEqual(expand_path(env('YOUTUBE_DL_EXPATH_PATH')), 'expanded') + compat_setenv('youtube_dlc_EXPATH_PATH', 'expanded') + self.assertEqual(expand_path(env('youtube_dlc_EXPATH_PATH')), 'expanded') self.assertEqual(expand_path(env('HOME')), compat_getenv('HOME')) self.assertEqual(expand_path('~'), compat_getenv('HOME')) self.assertEqual( - expand_path('~/%s' % env('YOUTUBE_DL_EXPATH_PATH')), + expand_path('~/%s' % env('youtube_dlc_EXPATH_PATH')), '%s/expanded' % compat_getenv('HOME')) def test_prepend_extension(self): @@ -1388,8 +1388,8 @@ Line 1 self.assertEqual(caesar('ebg', 'acegik', -2), 'abc') def test_rot47(self): - self.assertEqual(rot47('youtube-dl'), r'J@FEF36\5=') - self.assertEqual(rot47('YOUTUBE-DL'), r'*~&%&qt\s{') + self.assertEqual(rot47('youtube-dlc'), r'J@FEF36\5=') + self.assertEqual(rot47('youtube-dlc'), r'*~&%&qt\s{') def test_urshift(self): self.assertEqual(urshift(3, 1), 1) diff --git a/test/test_verbose_output.py b/test/test_verbose_output.py index c1465fe8c..462f25e03 100644 --- a/test/test_verbose_output.py +++ b/test/test_verbose_output.py @@ -17,7 +17,7 @@ class TestVerboseOutput(unittest.TestCase): def test_private_info_arg(self): outp = subprocess.Popen( [ - sys.executable, 'youtube_dl/__main__.py', '-v', + sys.executable, 'youtube_dlc/__main__.py', '-v', '--username', 'johnsmith@gmail.com', '--password', 'secret', ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -30,7 +30,7 @@ class TestVerboseOutput(unittest.TestCase): def test_private_info_shortarg(self): outp = subprocess.Popen( [ - sys.executable, 'youtube_dl/__main__.py', '-v', + sys.executable, 'youtube_dlc/__main__.py', '-v', '-u', 'johnsmith@gmail.com', '-p', 'secret', ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -43,7 +43,7 @@ class TestVerboseOutput(unittest.TestCase): def test_private_info_eq(self): outp = subprocess.Popen( [ - sys.executable, 'youtube_dl/__main__.py', '-v', + sys.executable, 'youtube_dlc/__main__.py', '-v', '--username=johnsmith@gmail.com', '--password=secret', ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -56,7 +56,7 @@ class TestVerboseOutput(unittest.TestCase): def test_private_info_shortarg_eq(self): outp = subprocess.Popen( [ - sys.executable, 'youtube_dl/__main__.py', '-v', + sys.executable, 'youtube_dlc/__main__.py', '-v', '-u=johnsmith@gmail.com', '-p=secret', ], cwd=rootDir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) diff --git a/test/test_write_annotations.py b/test/test_write_annotations.py index 41abdfe3b..d98c96c15 100644 --- a/test/test_write_annotations.py +++ b/test/test_write_annotations.py @@ -15,11 +15,11 @@ import io import xml.etree.ElementTree -import youtube_dl.YoutubeDL -import youtube_dl.extractor +import youtube_dlc.YoutubeDL +import youtube_dlc.extractor -class YoutubeDL(youtube_dl.YoutubeDL): +class YoutubeDL(youtube_dlc.YoutubeDL): def __init__(self, *args, **kwargs): super(YoutubeDL, self).__init__(*args, **kwargs) self.to_stderr = self.to_screen @@ -45,7 +45,7 @@ class TestAnnotations(unittest.TestCase): def test_info_json(self): expected = list(EXPECTED_ANNOTATIONS) # Two annotations could have the same text. - ie = youtube_dl.extractor.YoutubeIE() + ie = youtube_dlc.extractor.YoutubeIE() ydl = YoutubeDL(params) ydl.add_info_extractor(ie) ydl.download([TEST_ID]) diff --git a/test/test_youtube_chapters.py b/test/test_youtube_chapters.py index e69c57377..4529d2e84 100644 --- a/test/test_youtube_chapters.py +++ b/test/test_youtube_chapters.py @@ -9,7 +9,7 @@ import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import expect_value -from youtube_dl.extractor import YoutubeIE +from youtube_dlc.extractor import YoutubeIE class TestYoutubeChapters(unittest.TestCase): diff --git a/test/test_youtube_lists.py b/test/test_youtube_lists.py index c4f0abbea..a693963ef 100644 --- a/test/test_youtube_lists.py +++ b/test/test_youtube_lists.py @@ -10,7 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL -from youtube_dl.extractor import ( +from youtube_dlc.extractor import ( YoutubePlaylistIE, YoutubeIE, ) diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index 69df30eda..a54b36198 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -13,8 +13,8 @@ import re import string from test.helper import FakeYDL -from youtube_dl.extractor import YoutubeIE -from youtube_dl.compat import compat_str, compat_urlretrieve +from youtube_dlc.extractor import YoutubeIE +from youtube_dlc.compat import compat_str, compat_urlretrieve _TESTS = [ ( diff --git a/tox.ini b/tox.ini index 9c4e4a3d1..842091d65 100644 --- a/tox.ini +++ b/tox.ini @@ -10,5 +10,5 @@ defaultargs = test --exclude test_download.py --exclude test_age_restriction.py --exclude test_subtitles.py --exclude test_write_annotations.py --exclude test_youtube_lists.py --exclude test_iqiyi_sdk_interpreter.py --exclude test_socks.py -commands = nosetests --verbose {posargs:{[testenv]defaultargs}} # --with-coverage --cover-package=youtube_dl --cover-html +commands = nosetests --verbose {posargs:{[testenv]defaultargs}} # --with-coverage --cover-package=youtube_dlc --cover-html # test.test_download:TestDownload.test_NowVideo diff --git a/youtube-dl.plugin.zsh b/youtube-dl.plugin.zsh index 17ab1341a..27537ee11 100644 --- a/youtube-dl.plugin.zsh +++ b/youtube-dl.plugin.zsh @@ -1,4 +1,4 @@ -# This allows the youtube-dl command to be installed in ZSH using antigen. +# This allows the youtube-dlc command to be installed in ZSH using antigen. # Antigen is a bundle manager. It allows you to enhance the functionality of # your zsh session by installing bundles and themes easily. @@ -6,11 +6,11 @@ # http://antigen.sharats.me/ # https://github.com/zsh-users/antigen -# Install youtube-dl: +# Install youtube-dlc: # antigen bundle ytdl-org/youtube-dl # Bundles installed by antigen are available for use immediately. -# Update youtube-dl (and all other antigen bundles): +# Update youtube-dlc (and all other antigen bundles): # antigen update # The antigen command will download the git repository to a folder and then @@ -18,7 +18,7 @@ # code is documented here: # https://github.com/zsh-users/antigen#notes-on-writing-plugins -# This specific script just aliases youtube-dl to the python script that this +# This specific script just aliases youtube-dlc to the python script that this # library provides. This requires updating the PYTHONPATH to ensure that the # full set of code can be located. -alias youtube-dl="PYTHONPATH=$(dirname $0) $(dirname $0)/bin/youtube-dl" +alias youtube-dlc="PYTHONPATH=$(dirname $0) $(dirname $0)/bin/youtube-dlc" diff --git a/youtube_dl/YoutubeDL.py b/youtube_dlc/YoutubeDL.py old mode 100755 new mode 100644 similarity index 99% rename from youtube_dl/YoutubeDL.py rename to youtube_dlc/YoutubeDL.py index 0dc869d56..f79d31deb --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dlc/YoutubeDL.py @@ -228,7 +228,7 @@ class YoutubeDL(object): playlist items. postprocessors: A list of dictionaries, each with an entry * key: The name of the postprocessor. See - youtube_dl/postprocessor/__init__.py for a list. + youtube_dlc/postprocessor/__init__.py for a list. as well as any further keyword arguments for the postprocessor. progress_hooks: A list of functions that get called on download @@ -264,7 +264,7 @@ class YoutubeDL(object): about it, warn otherwise (default) source_address: Client-side IP address to bind to. call_home: Boolean, true iff we are allowed to contact the - youtube-dl servers for debugging. + youtube-dlc servers for debugging. sleep_interval: Number of seconds to sleep before each download when used alone or a lower bound of a range for randomized sleep before each download (minimum possible number @@ -301,7 +301,7 @@ class YoutubeDL(object): use downloader suggested by extractor if None. The following parameters are not used by YoutubeDL itself, they are used by - the downloader (see youtube_dl/downloader/common.py): + the downloader (see youtube_dlc/downloader/common.py): nopart, updatetime, buffersize, ratelimit, min_filesize, max_filesize, test, noresizebuffer, retries, continuedl, noprogress, consoletitle, xattr_set_filesize, external_downloader_args, hls_use_mpegts, @@ -441,7 +441,7 @@ class YoutubeDL(object): if re.match(r'^-[0-9A-Za-z_-]{10}$', a)] if idxs: correct_argv = ( - ['youtube-dl'] + ['youtube-dlc'] + [a for i, a in enumerate(argv) if i not in idxs] + ['--'] + [argv[i] for i in idxs] ) @@ -2254,7 +2254,7 @@ class YoutubeDL(object): self.get_encoding())) write_string(encoding_str, encoding=None) - self._write_string('[debug] youtube-dl version ' + __version__ + '\n') + self._write_string('[debug] youtube-dlc version ' + __version__ + '\n') if _LAZY_LOADER: self._write_string('[debug] Lazy loading extractors enabled' + '\n') try: @@ -2352,7 +2352,7 @@ class YoutubeDL(object): file_handler = compat_urllib_request.FileHandler() def file_open(*args, **kwargs): - raise compat_urllib_error.URLError('file:// scheme is explicitly disabled in youtube-dl for security reasons') + raise compat_urllib_error.URLError('file:// scheme is explicitly disabled in youtube-dlc for security reasons') file_handler.file_open = file_open opener = compat_urllib_request.build_opener( diff --git a/youtube_dl/__init__.py b/youtube_dlc/__init__.py similarity index 99% rename from youtube_dl/__init__.py rename to youtube_dlc/__init__.py index 9a659fc65..a663417da 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dlc/__init__.py @@ -53,7 +53,7 @@ def _real_main(argv=None): workaround_optparse_bug9161() - setproctitle('youtube-dl') + setproctitle('youtube-dlc') parser, opts, args = parseOpts(argv) @@ -455,7 +455,7 @@ def _real_main(argv=None): ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv) parser.error( 'You must provide at least one URL.\n' - 'Type youtube-dl --help to see a list of all options.') + 'Type youtube-dlc --help to see a list of all options.') try: if opts.load_info_filename is not None: diff --git a/youtube_dl/__main__.py b/youtube_dlc/__main__.py old mode 100755 new mode 100644 similarity index 73% rename from youtube_dl/__main__.py rename to youtube_dlc/__main__.py index 138f5fbec..0e7601686 --- a/youtube_dl/__main__.py +++ b/youtube_dlc/__main__.py @@ -2,8 +2,8 @@ from __future__ import unicode_literals # Execute with -# $ python youtube_dl/__main__.py (2.6+) -# $ python -m youtube_dl (2.7+) +# $ python youtube_dlc/__main__.py (2.6+) +# $ python -m youtube_dlc (2.7+) import sys @@ -13,7 +13,7 @@ if __package__ is None and not hasattr(sys, 'frozen'): path = os.path.realpath(os.path.abspath(__file__)) sys.path.insert(0, os.path.dirname(os.path.dirname(path))) -import youtube_dl +import youtube_dlc if __name__ == '__main__': - youtube_dl.main() + youtube_dlc.main() diff --git a/youtube_dl/aes.py b/youtube_dlc/aes.py similarity index 100% rename from youtube_dl/aes.py rename to youtube_dlc/aes.py diff --git a/youtube_dl/cache.py b/youtube_dlc/cache.py similarity index 98% rename from youtube_dl/cache.py rename to youtube_dlc/cache.py index 7bdade1bd..ada6aa1f2 100644 --- a/youtube_dl/cache.py +++ b/youtube_dlc/cache.py @@ -23,7 +23,7 @@ class Cache(object): res = self._ydl.params.get('cachedir') if res is None: cache_root = compat_getenv('XDG_CACHE_HOME', '~/.cache') - res = os.path.join(cache_root, 'youtube-dl') + res = os.path.join(cache_root, 'youtube-dlc') return expand_path(res) def _get_cache_fn(self, section, key, dtype): diff --git a/youtube_dl/compat.py b/youtube_dlc/compat.py similarity index 99% rename from youtube_dl/compat.py rename to youtube_dlc/compat.py index 0ee9bc760..1cf7efed6 100644 --- a/youtube_dl/compat.py +++ b/youtube_dlc/compat.py @@ -2973,7 +2973,7 @@ else: if platform.python_implementation() == 'PyPy' and sys.pypy_version_info < (5, 4, 0): # PyPy2 prior to version 5.4.0 expects byte strings as Windows function - # names, see the original PyPy issue [1] and the youtube-dl one [2]. + # names, see the original PyPy issue [1] and the youtube-dlc one [2]. # 1. https://bitbucket.org/pypy/pypy/issues/2360/windows-ctypescdll-typeerror-function-name # 2. https://github.com/ytdl-org/youtube-dl/pull/4392 def compat_ctypes_WINFUNCTYPE(*args, **kwargs): diff --git a/youtube_dl/downloader/__init__.py b/youtube_dlc/downloader/__init__.py similarity index 100% rename from youtube_dl/downloader/__init__.py rename to youtube_dlc/downloader/__init__.py diff --git a/youtube_dl/downloader/common.py b/youtube_dlc/downloader/common.py similarity index 99% rename from youtube_dl/downloader/common.py rename to youtube_dlc/downloader/common.py index 1cdba89cd..31c286458 100644 --- a/youtube_dl/downloader/common.py +++ b/youtube_dlc/downloader/common.py @@ -243,7 +243,7 @@ class FileDownloader(object): else: clear_line = ('\r\x1b[K' if sys.stderr.isatty() else '\r') self.to_screen(clear_line + fullmsg, skip_eol=not is_last_line) - self.to_console_title('youtube-dl ' + msg) + self.to_console_title('youtube-dlc ' + msg) def report_progress(self, s): if s['status'] == 'finished': diff --git a/youtube_dl/downloader/dash.py b/youtube_dlc/downloader/dash.py similarity index 100% rename from youtube_dl/downloader/dash.py rename to youtube_dlc/downloader/dash.py diff --git a/youtube_dl/downloader/external.py b/youtube_dlc/downloader/external.py similarity index 100% rename from youtube_dl/downloader/external.py rename to youtube_dlc/downloader/external.py diff --git a/youtube_dl/downloader/f4m.py b/youtube_dlc/downloader/f4m.py similarity index 100% rename from youtube_dl/downloader/f4m.py rename to youtube_dlc/downloader/f4m.py diff --git a/youtube_dl/downloader/fragment.py b/youtube_dlc/downloader/fragment.py similarity index 98% rename from youtube_dl/downloader/fragment.py rename to youtube_dlc/downloader/fragment.py index 02f35459e..9339b3a62 100644 --- a/youtube_dl/downloader/fragment.py +++ b/youtube_dlc/downloader/fragment.py @@ -32,9 +32,9 @@ class FragmentFD(FileDownloader): keep_fragments: Keep downloaded fragments on disk after downloading is finished - For each incomplete fragment download youtube-dl keeps on disk a special + For each incomplete fragment download youtube-dlc keeps on disk a special bookkeeping file with download state and metadata (in future such files will - be used for any incomplete download handled by youtube-dl). This file is + be used for any incomplete download handled by youtube-dlc). This file is used to properly handle resuming, check download file consistency and detect potential errors. The file has a .ytdl extension and represents a standard JSON file of the following format: diff --git a/youtube_dl/downloader/hls.py b/youtube_dlc/downloader/hls.py similarity index 100% rename from youtube_dl/downloader/hls.py rename to youtube_dlc/downloader/hls.py diff --git a/youtube_dl/downloader/http.py b/youtube_dlc/downloader/http.py similarity index 100% rename from youtube_dl/downloader/http.py rename to youtube_dlc/downloader/http.py diff --git a/youtube_dl/downloader/ism.py b/youtube_dlc/downloader/ism.py similarity index 100% rename from youtube_dl/downloader/ism.py rename to youtube_dlc/downloader/ism.py diff --git a/youtube_dl/downloader/rtmp.py b/youtube_dlc/downloader/rtmp.py similarity index 100% rename from youtube_dl/downloader/rtmp.py rename to youtube_dlc/downloader/rtmp.py diff --git a/youtube_dl/downloader/rtsp.py b/youtube_dlc/downloader/rtsp.py similarity index 100% rename from youtube_dl/downloader/rtsp.py rename to youtube_dlc/downloader/rtsp.py diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dlc/downloader/youtube_live_chat.py similarity index 100% rename from youtube_dl/downloader/youtube_live_chat.py rename to youtube_dlc/downloader/youtube_live_chat.py diff --git a/youtube_dl/extractor/__init__.py b/youtube_dlc/extractor/__init__.py similarity index 100% rename from youtube_dl/extractor/__init__.py rename to youtube_dlc/extractor/__init__.py diff --git a/youtube_dl/extractor/abc.py b/youtube_dlc/extractor/abc.py similarity index 100% rename from youtube_dl/extractor/abc.py rename to youtube_dlc/extractor/abc.py diff --git a/youtube_dl/extractor/abcnews.py b/youtube_dlc/extractor/abcnews.py similarity index 100% rename from youtube_dl/extractor/abcnews.py rename to youtube_dlc/extractor/abcnews.py diff --git a/youtube_dl/extractor/abcotvs.py b/youtube_dlc/extractor/abcotvs.py similarity index 100% rename from youtube_dl/extractor/abcotvs.py rename to youtube_dlc/extractor/abcotvs.py diff --git a/youtube_dl/extractor/academicearth.py b/youtube_dlc/extractor/academicearth.py similarity index 100% rename from youtube_dl/extractor/academicearth.py rename to youtube_dlc/extractor/academicearth.py diff --git a/youtube_dl/extractor/acast.py b/youtube_dlc/extractor/acast.py similarity index 100% rename from youtube_dl/extractor/acast.py rename to youtube_dlc/extractor/acast.py diff --git a/youtube_dl/extractor/adn.py b/youtube_dlc/extractor/adn.py similarity index 100% rename from youtube_dl/extractor/adn.py rename to youtube_dlc/extractor/adn.py diff --git a/youtube_dl/extractor/adobeconnect.py b/youtube_dlc/extractor/adobeconnect.py similarity index 100% rename from youtube_dl/extractor/adobeconnect.py rename to youtube_dlc/extractor/adobeconnect.py diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dlc/extractor/adobepass.py similarity index 100% rename from youtube_dl/extractor/adobepass.py rename to youtube_dlc/extractor/adobepass.py diff --git a/youtube_dl/extractor/adobetv.py b/youtube_dlc/extractor/adobetv.py similarity index 100% rename from youtube_dl/extractor/adobetv.py rename to youtube_dlc/extractor/adobetv.py diff --git a/youtube_dl/extractor/adultswim.py b/youtube_dlc/extractor/adultswim.py similarity index 100% rename from youtube_dl/extractor/adultswim.py rename to youtube_dlc/extractor/adultswim.py diff --git a/youtube_dl/extractor/aenetworks.py b/youtube_dlc/extractor/aenetworks.py similarity index 100% rename from youtube_dl/extractor/aenetworks.py rename to youtube_dlc/extractor/aenetworks.py diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dlc/extractor/afreecatv.py similarity index 100% rename from youtube_dl/extractor/afreecatv.py rename to youtube_dlc/extractor/afreecatv.py diff --git a/youtube_dl/extractor/airmozilla.py b/youtube_dlc/extractor/airmozilla.py similarity index 100% rename from youtube_dl/extractor/airmozilla.py rename to youtube_dlc/extractor/airmozilla.py diff --git a/youtube_dl/extractor/aliexpress.py b/youtube_dlc/extractor/aliexpress.py similarity index 100% rename from youtube_dl/extractor/aliexpress.py rename to youtube_dlc/extractor/aliexpress.py diff --git a/youtube_dl/extractor/aljazeera.py b/youtube_dlc/extractor/aljazeera.py similarity index 100% rename from youtube_dl/extractor/aljazeera.py rename to youtube_dlc/extractor/aljazeera.py diff --git a/youtube_dl/extractor/allocine.py b/youtube_dlc/extractor/allocine.py similarity index 100% rename from youtube_dl/extractor/allocine.py rename to youtube_dlc/extractor/allocine.py diff --git a/youtube_dl/extractor/alphaporno.py b/youtube_dlc/extractor/alphaporno.py similarity index 100% rename from youtube_dl/extractor/alphaporno.py rename to youtube_dlc/extractor/alphaporno.py diff --git a/youtube_dl/extractor/amcnetworks.py b/youtube_dlc/extractor/amcnetworks.py similarity index 100% rename from youtube_dl/extractor/amcnetworks.py rename to youtube_dlc/extractor/amcnetworks.py diff --git a/youtube_dl/extractor/americastestkitchen.py b/youtube_dlc/extractor/americastestkitchen.py similarity index 100% rename from youtube_dl/extractor/americastestkitchen.py rename to youtube_dlc/extractor/americastestkitchen.py diff --git a/youtube_dl/extractor/amp.py b/youtube_dlc/extractor/amp.py similarity index 100% rename from youtube_dl/extractor/amp.py rename to youtube_dlc/extractor/amp.py diff --git a/youtube_dl/extractor/animeondemand.py b/youtube_dlc/extractor/animeondemand.py similarity index 100% rename from youtube_dl/extractor/animeondemand.py rename to youtube_dlc/extractor/animeondemand.py diff --git a/youtube_dl/extractor/anvato.py b/youtube_dlc/extractor/anvato.py similarity index 100% rename from youtube_dl/extractor/anvato.py rename to youtube_dlc/extractor/anvato.py diff --git a/youtube_dl/extractor/aol.py b/youtube_dlc/extractor/aol.py similarity index 100% rename from youtube_dl/extractor/aol.py rename to youtube_dlc/extractor/aol.py diff --git a/youtube_dl/extractor/apa.py b/youtube_dlc/extractor/apa.py similarity index 100% rename from youtube_dl/extractor/apa.py rename to youtube_dlc/extractor/apa.py diff --git a/youtube_dl/extractor/aparat.py b/youtube_dlc/extractor/aparat.py similarity index 100% rename from youtube_dl/extractor/aparat.py rename to youtube_dlc/extractor/aparat.py diff --git a/youtube_dl/extractor/appleconnect.py b/youtube_dlc/extractor/appleconnect.py similarity index 100% rename from youtube_dl/extractor/appleconnect.py rename to youtube_dlc/extractor/appleconnect.py diff --git a/youtube_dl/extractor/appletrailers.py b/youtube_dlc/extractor/appletrailers.py similarity index 99% rename from youtube_dl/extractor/appletrailers.py rename to youtube_dlc/extractor/appletrailers.py index a9ef733e0..b5ed2b88b 100644 --- a/youtube_dl/extractor/appletrailers.py +++ b/youtube_dlc/extractor/appletrailers.py @@ -199,7 +199,7 @@ class AppleTrailersIE(InfoExtractor): 'upload_date': upload_date, 'uploader_id': uploader_id, 'http_headers': { - 'User-Agent': 'QuickTime compatible (youtube-dl)', + 'User-Agent': 'QuickTime compatible (youtube-dlc)', }, }) diff --git a/youtube_dl/extractor/archiveorg.py b/youtube_dlc/extractor/archiveorg.py similarity index 100% rename from youtube_dl/extractor/archiveorg.py rename to youtube_dlc/extractor/archiveorg.py diff --git a/youtube_dl/extractor/ard.py b/youtube_dlc/extractor/ard.py similarity index 100% rename from youtube_dl/extractor/ard.py rename to youtube_dlc/extractor/ard.py diff --git a/youtube_dl/extractor/arkena.py b/youtube_dlc/extractor/arkena.py similarity index 100% rename from youtube_dl/extractor/arkena.py rename to youtube_dlc/extractor/arkena.py diff --git a/youtube_dl/extractor/arte.py b/youtube_dlc/extractor/arte.py similarity index 100% rename from youtube_dl/extractor/arte.py rename to youtube_dlc/extractor/arte.py diff --git a/youtube_dl/extractor/asiancrush.py b/youtube_dlc/extractor/asiancrush.py similarity index 100% rename from youtube_dl/extractor/asiancrush.py rename to youtube_dlc/extractor/asiancrush.py diff --git a/youtube_dl/extractor/atresplayer.py b/youtube_dlc/extractor/atresplayer.py similarity index 100% rename from youtube_dl/extractor/atresplayer.py rename to youtube_dlc/extractor/atresplayer.py diff --git a/youtube_dl/extractor/atttechchannel.py b/youtube_dlc/extractor/atttechchannel.py similarity index 100% rename from youtube_dl/extractor/atttechchannel.py rename to youtube_dlc/extractor/atttechchannel.py diff --git a/youtube_dl/extractor/atvat.py b/youtube_dlc/extractor/atvat.py similarity index 100% rename from youtube_dl/extractor/atvat.py rename to youtube_dlc/extractor/atvat.py diff --git a/youtube_dl/extractor/audimedia.py b/youtube_dlc/extractor/audimedia.py similarity index 100% rename from youtube_dl/extractor/audimedia.py rename to youtube_dlc/extractor/audimedia.py diff --git a/youtube_dl/extractor/audioboom.py b/youtube_dlc/extractor/audioboom.py similarity index 100% rename from youtube_dl/extractor/audioboom.py rename to youtube_dlc/extractor/audioboom.py diff --git a/youtube_dl/extractor/audiomack.py b/youtube_dlc/extractor/audiomack.py similarity index 100% rename from youtube_dl/extractor/audiomack.py rename to youtube_dlc/extractor/audiomack.py diff --git a/youtube_dl/extractor/awaan.py b/youtube_dlc/extractor/awaan.py similarity index 100% rename from youtube_dl/extractor/awaan.py rename to youtube_dlc/extractor/awaan.py diff --git a/youtube_dl/extractor/aws.py b/youtube_dlc/extractor/aws.py similarity index 100% rename from youtube_dl/extractor/aws.py rename to youtube_dlc/extractor/aws.py diff --git a/youtube_dl/extractor/azmedien.py b/youtube_dlc/extractor/azmedien.py similarity index 100% rename from youtube_dl/extractor/azmedien.py rename to youtube_dlc/extractor/azmedien.py diff --git a/youtube_dl/extractor/baidu.py b/youtube_dlc/extractor/baidu.py similarity index 100% rename from youtube_dl/extractor/baidu.py rename to youtube_dlc/extractor/baidu.py diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dlc/extractor/bandcamp.py similarity index 98% rename from youtube_dl/extractor/bandcamp.py rename to youtube_dlc/extractor/bandcamp.py index f14b407dc..b8a57e6a5 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dlc/extractor/bandcamp.py @@ -28,12 +28,12 @@ from ..utils import ( class BandcampIE(InfoExtractor): _VALID_URL = r'https?://[^/]+\.bandcamp\.com/track/(?P[^/?#&]+)' _TESTS = [{ - 'url': 'http://youtube-dl.bandcamp.com/track/youtube-dl-test-song', + 'url': 'http://youtube-dlc.bandcamp.com/track/youtube-dlc-test-song', 'md5': 'c557841d5e50261777a6585648adf439', 'info_dict': { 'id': '1812978515', 'ext': 'mp3', - 'title': "youtube-dl \"'/\\\u00e4\u21ad - youtube-dl test song \"'/\\\u00e4\u21ad", + 'title': "youtube-dlc \"'/\\\u00e4\u21ad - youtube-dlc test song \"'/\\\u00e4\u21ad", 'duration': 9.8485, }, '_skip': 'There is a limit of 200 free downloads / month for the test song' diff --git a/youtube_dl/extractor/bbc.py b/youtube_dlc/extractor/bbc.py similarity index 100% rename from youtube_dl/extractor/bbc.py rename to youtube_dlc/extractor/bbc.py diff --git a/youtube_dl/extractor/beampro.py b/youtube_dlc/extractor/beampro.py similarity index 100% rename from youtube_dl/extractor/beampro.py rename to youtube_dlc/extractor/beampro.py diff --git a/youtube_dl/extractor/beatport.py b/youtube_dlc/extractor/beatport.py similarity index 100% rename from youtube_dl/extractor/beatport.py rename to youtube_dlc/extractor/beatport.py diff --git a/youtube_dl/extractor/beeg.py b/youtube_dlc/extractor/beeg.py similarity index 100% rename from youtube_dl/extractor/beeg.py rename to youtube_dlc/extractor/beeg.py diff --git a/youtube_dl/extractor/behindkink.py b/youtube_dlc/extractor/behindkink.py similarity index 100% rename from youtube_dl/extractor/behindkink.py rename to youtube_dlc/extractor/behindkink.py diff --git a/youtube_dl/extractor/bellmedia.py b/youtube_dlc/extractor/bellmedia.py similarity index 100% rename from youtube_dl/extractor/bellmedia.py rename to youtube_dlc/extractor/bellmedia.py diff --git a/youtube_dl/extractor/bet.py b/youtube_dlc/extractor/bet.py similarity index 100% rename from youtube_dl/extractor/bet.py rename to youtube_dlc/extractor/bet.py diff --git a/youtube_dl/extractor/bfi.py b/youtube_dlc/extractor/bfi.py similarity index 100% rename from youtube_dl/extractor/bfi.py rename to youtube_dlc/extractor/bfi.py diff --git a/youtube_dl/extractor/bigflix.py b/youtube_dlc/extractor/bigflix.py similarity index 100% rename from youtube_dl/extractor/bigflix.py rename to youtube_dlc/extractor/bigflix.py diff --git a/youtube_dl/extractor/bild.py b/youtube_dlc/extractor/bild.py similarity index 100% rename from youtube_dl/extractor/bild.py rename to youtube_dlc/extractor/bild.py diff --git a/youtube_dl/extractor/bilibili.py b/youtube_dlc/extractor/bilibili.py similarity index 99% rename from youtube_dl/extractor/bilibili.py rename to youtube_dlc/extractor/bilibili.py index 4dc597e16..d39ee8ffe 100644 --- a/youtube_dl/extractor/bilibili.py +++ b/youtube_dlc/extractor/bilibili.py @@ -139,7 +139,7 @@ class BiliBiliIE(InfoExtractor): webpage, 'player parameters'))['cid'][0] else: if 'no_bangumi_tip' not in smuggled_data: - self.to_screen('Downloading episode %s. To download all videos in anime %s, re-run youtube-dl with %s' % ( + self.to_screen('Downloading episode %s. To download all videos in anime %s, re-run youtube-dlc with %s' % ( video_id, anime_id, compat_urlparse.urljoin(url, '//bangumi.bilibili.com/anime/%s' % anime_id))) headers = { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', diff --git a/youtube_dl/extractor/biobiochiletv.py b/youtube_dlc/extractor/biobiochiletv.py similarity index 100% rename from youtube_dl/extractor/biobiochiletv.py rename to youtube_dlc/extractor/biobiochiletv.py diff --git a/youtube_dl/extractor/biqle.py b/youtube_dlc/extractor/biqle.py similarity index 100% rename from youtube_dl/extractor/biqle.py rename to youtube_dlc/extractor/biqle.py diff --git a/youtube_dl/extractor/bitchute.py b/youtube_dlc/extractor/bitchute.py similarity index 100% rename from youtube_dl/extractor/bitchute.py rename to youtube_dlc/extractor/bitchute.py diff --git a/youtube_dl/extractor/bleacherreport.py b/youtube_dlc/extractor/bleacherreport.py similarity index 100% rename from youtube_dl/extractor/bleacherreport.py rename to youtube_dlc/extractor/bleacherreport.py diff --git a/youtube_dl/extractor/blinkx.py b/youtube_dlc/extractor/blinkx.py similarity index 100% rename from youtube_dl/extractor/blinkx.py rename to youtube_dlc/extractor/blinkx.py diff --git a/youtube_dl/extractor/bloomberg.py b/youtube_dlc/extractor/bloomberg.py similarity index 100% rename from youtube_dl/extractor/bloomberg.py rename to youtube_dlc/extractor/bloomberg.py diff --git a/youtube_dl/extractor/bokecc.py b/youtube_dlc/extractor/bokecc.py similarity index 100% rename from youtube_dl/extractor/bokecc.py rename to youtube_dlc/extractor/bokecc.py diff --git a/youtube_dl/extractor/bostonglobe.py b/youtube_dlc/extractor/bostonglobe.py similarity index 100% rename from youtube_dl/extractor/bostonglobe.py rename to youtube_dlc/extractor/bostonglobe.py diff --git a/youtube_dl/extractor/bpb.py b/youtube_dlc/extractor/bpb.py similarity index 100% rename from youtube_dl/extractor/bpb.py rename to youtube_dlc/extractor/bpb.py diff --git a/youtube_dl/extractor/br.py b/youtube_dlc/extractor/br.py similarity index 100% rename from youtube_dl/extractor/br.py rename to youtube_dlc/extractor/br.py diff --git a/youtube_dl/extractor/bravotv.py b/youtube_dlc/extractor/bravotv.py similarity index 100% rename from youtube_dl/extractor/bravotv.py rename to youtube_dlc/extractor/bravotv.py diff --git a/youtube_dl/extractor/breakcom.py b/youtube_dlc/extractor/breakcom.py similarity index 100% rename from youtube_dl/extractor/breakcom.py rename to youtube_dlc/extractor/breakcom.py diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dlc/extractor/brightcove.py similarity index 100% rename from youtube_dl/extractor/brightcove.py rename to youtube_dlc/extractor/brightcove.py diff --git a/youtube_dl/extractor/businessinsider.py b/youtube_dlc/extractor/businessinsider.py similarity index 100% rename from youtube_dl/extractor/businessinsider.py rename to youtube_dlc/extractor/businessinsider.py diff --git a/youtube_dl/extractor/buzzfeed.py b/youtube_dlc/extractor/buzzfeed.py similarity index 100% rename from youtube_dl/extractor/buzzfeed.py rename to youtube_dlc/extractor/buzzfeed.py diff --git a/youtube_dl/extractor/byutv.py b/youtube_dlc/extractor/byutv.py similarity index 100% rename from youtube_dl/extractor/byutv.py rename to youtube_dlc/extractor/byutv.py diff --git a/youtube_dl/extractor/c56.py b/youtube_dlc/extractor/c56.py similarity index 100% rename from youtube_dl/extractor/c56.py rename to youtube_dlc/extractor/c56.py diff --git a/youtube_dl/extractor/camdemy.py b/youtube_dlc/extractor/camdemy.py similarity index 100% rename from youtube_dl/extractor/camdemy.py rename to youtube_dlc/extractor/camdemy.py diff --git a/youtube_dl/extractor/cammodels.py b/youtube_dlc/extractor/cammodels.py similarity index 100% rename from youtube_dl/extractor/cammodels.py rename to youtube_dlc/extractor/cammodels.py diff --git a/youtube_dl/extractor/camtube.py b/youtube_dlc/extractor/camtube.py similarity index 100% rename from youtube_dl/extractor/camtube.py rename to youtube_dlc/extractor/camtube.py diff --git a/youtube_dl/extractor/camwithher.py b/youtube_dlc/extractor/camwithher.py similarity index 100% rename from youtube_dl/extractor/camwithher.py rename to youtube_dlc/extractor/camwithher.py diff --git a/youtube_dl/extractor/canalc2.py b/youtube_dlc/extractor/canalc2.py similarity index 100% rename from youtube_dl/extractor/canalc2.py rename to youtube_dlc/extractor/canalc2.py diff --git a/youtube_dl/extractor/canalplus.py b/youtube_dlc/extractor/canalplus.py similarity index 100% rename from youtube_dl/extractor/canalplus.py rename to youtube_dlc/extractor/canalplus.py diff --git a/youtube_dl/extractor/canvas.py b/youtube_dlc/extractor/canvas.py similarity index 100% rename from youtube_dl/extractor/canvas.py rename to youtube_dlc/extractor/canvas.py diff --git a/youtube_dl/extractor/carambatv.py b/youtube_dlc/extractor/carambatv.py similarity index 100% rename from youtube_dl/extractor/carambatv.py rename to youtube_dlc/extractor/carambatv.py diff --git a/youtube_dl/extractor/cartoonnetwork.py b/youtube_dlc/extractor/cartoonnetwork.py similarity index 100% rename from youtube_dl/extractor/cartoonnetwork.py rename to youtube_dlc/extractor/cartoonnetwork.py diff --git a/youtube_dl/extractor/cbc.py b/youtube_dlc/extractor/cbc.py similarity index 100% rename from youtube_dl/extractor/cbc.py rename to youtube_dlc/extractor/cbc.py diff --git a/youtube_dl/extractor/cbs.py b/youtube_dlc/extractor/cbs.py similarity index 100% rename from youtube_dl/extractor/cbs.py rename to youtube_dlc/extractor/cbs.py diff --git a/youtube_dl/extractor/cbsinteractive.py b/youtube_dlc/extractor/cbsinteractive.py similarity index 100% rename from youtube_dl/extractor/cbsinteractive.py rename to youtube_dlc/extractor/cbsinteractive.py diff --git a/youtube_dl/extractor/cbslocal.py b/youtube_dlc/extractor/cbslocal.py similarity index 100% rename from youtube_dl/extractor/cbslocal.py rename to youtube_dlc/extractor/cbslocal.py diff --git a/youtube_dl/extractor/cbsnews.py b/youtube_dlc/extractor/cbsnews.py similarity index 100% rename from youtube_dl/extractor/cbsnews.py rename to youtube_dlc/extractor/cbsnews.py diff --git a/youtube_dl/extractor/cbssports.py b/youtube_dlc/extractor/cbssports.py similarity index 100% rename from youtube_dl/extractor/cbssports.py rename to youtube_dlc/extractor/cbssports.py diff --git a/youtube_dl/extractor/ccc.py b/youtube_dlc/extractor/ccc.py similarity index 100% rename from youtube_dl/extractor/ccc.py rename to youtube_dlc/extractor/ccc.py diff --git a/youtube_dl/extractor/ccma.py b/youtube_dlc/extractor/ccma.py similarity index 100% rename from youtube_dl/extractor/ccma.py rename to youtube_dlc/extractor/ccma.py diff --git a/youtube_dl/extractor/cctv.py b/youtube_dlc/extractor/cctv.py similarity index 100% rename from youtube_dl/extractor/cctv.py rename to youtube_dlc/extractor/cctv.py diff --git a/youtube_dl/extractor/cda.py b/youtube_dlc/extractor/cda.py similarity index 100% rename from youtube_dl/extractor/cda.py rename to youtube_dlc/extractor/cda.py diff --git a/youtube_dl/extractor/ceskatelevize.py b/youtube_dlc/extractor/ceskatelevize.py similarity index 100% rename from youtube_dl/extractor/ceskatelevize.py rename to youtube_dlc/extractor/ceskatelevize.py diff --git a/youtube_dl/extractor/channel9.py b/youtube_dlc/extractor/channel9.py similarity index 100% rename from youtube_dl/extractor/channel9.py rename to youtube_dlc/extractor/channel9.py diff --git a/youtube_dl/extractor/charlierose.py b/youtube_dlc/extractor/charlierose.py similarity index 100% rename from youtube_dl/extractor/charlierose.py rename to youtube_dlc/extractor/charlierose.py diff --git a/youtube_dl/extractor/chaturbate.py b/youtube_dlc/extractor/chaturbate.py similarity index 100% rename from youtube_dl/extractor/chaturbate.py rename to youtube_dlc/extractor/chaturbate.py diff --git a/youtube_dl/extractor/chilloutzone.py b/youtube_dlc/extractor/chilloutzone.py similarity index 100% rename from youtube_dl/extractor/chilloutzone.py rename to youtube_dlc/extractor/chilloutzone.py diff --git a/youtube_dl/extractor/chirbit.py b/youtube_dlc/extractor/chirbit.py similarity index 100% rename from youtube_dl/extractor/chirbit.py rename to youtube_dlc/extractor/chirbit.py diff --git a/youtube_dl/extractor/cinchcast.py b/youtube_dlc/extractor/cinchcast.py similarity index 100% rename from youtube_dl/extractor/cinchcast.py rename to youtube_dlc/extractor/cinchcast.py diff --git a/youtube_dl/extractor/cinemax.py b/youtube_dlc/extractor/cinemax.py similarity index 100% rename from youtube_dl/extractor/cinemax.py rename to youtube_dlc/extractor/cinemax.py diff --git a/youtube_dl/extractor/ciscolive.py b/youtube_dlc/extractor/ciscolive.py similarity index 100% rename from youtube_dl/extractor/ciscolive.py rename to youtube_dlc/extractor/ciscolive.py diff --git a/youtube_dl/extractor/cjsw.py b/youtube_dlc/extractor/cjsw.py similarity index 100% rename from youtube_dl/extractor/cjsw.py rename to youtube_dlc/extractor/cjsw.py diff --git a/youtube_dl/extractor/cliphunter.py b/youtube_dlc/extractor/cliphunter.py similarity index 100% rename from youtube_dl/extractor/cliphunter.py rename to youtube_dlc/extractor/cliphunter.py diff --git a/youtube_dl/extractor/clippit.py b/youtube_dlc/extractor/clippit.py similarity index 100% rename from youtube_dl/extractor/clippit.py rename to youtube_dlc/extractor/clippit.py diff --git a/youtube_dl/extractor/cliprs.py b/youtube_dlc/extractor/cliprs.py similarity index 100% rename from youtube_dl/extractor/cliprs.py rename to youtube_dlc/extractor/cliprs.py diff --git a/youtube_dl/extractor/clipsyndicate.py b/youtube_dlc/extractor/clipsyndicate.py similarity index 100% rename from youtube_dl/extractor/clipsyndicate.py rename to youtube_dlc/extractor/clipsyndicate.py diff --git a/youtube_dl/extractor/closertotruth.py b/youtube_dlc/extractor/closertotruth.py similarity index 100% rename from youtube_dl/extractor/closertotruth.py rename to youtube_dlc/extractor/closertotruth.py diff --git a/youtube_dl/extractor/cloudflarestream.py b/youtube_dlc/extractor/cloudflarestream.py similarity index 100% rename from youtube_dl/extractor/cloudflarestream.py rename to youtube_dlc/extractor/cloudflarestream.py diff --git a/youtube_dl/extractor/cloudy.py b/youtube_dlc/extractor/cloudy.py similarity index 100% rename from youtube_dl/extractor/cloudy.py rename to youtube_dlc/extractor/cloudy.py diff --git a/youtube_dl/extractor/clubic.py b/youtube_dlc/extractor/clubic.py similarity index 100% rename from youtube_dl/extractor/clubic.py rename to youtube_dlc/extractor/clubic.py diff --git a/youtube_dl/extractor/clyp.py b/youtube_dlc/extractor/clyp.py similarity index 100% rename from youtube_dl/extractor/clyp.py rename to youtube_dlc/extractor/clyp.py diff --git a/youtube_dl/extractor/cmt.py b/youtube_dlc/extractor/cmt.py similarity index 100% rename from youtube_dl/extractor/cmt.py rename to youtube_dlc/extractor/cmt.py diff --git a/youtube_dl/extractor/cnbc.py b/youtube_dlc/extractor/cnbc.py similarity index 100% rename from youtube_dl/extractor/cnbc.py rename to youtube_dlc/extractor/cnbc.py diff --git a/youtube_dl/extractor/cnn.py b/youtube_dlc/extractor/cnn.py similarity index 100% rename from youtube_dl/extractor/cnn.py rename to youtube_dlc/extractor/cnn.py diff --git a/youtube_dl/extractor/comedycentral.py b/youtube_dlc/extractor/comedycentral.py similarity index 100% rename from youtube_dl/extractor/comedycentral.py rename to youtube_dlc/extractor/comedycentral.py diff --git a/youtube_dl/extractor/common.py b/youtube_dlc/extractor/common.py similarity index 99% rename from youtube_dl/extractor/common.py rename to youtube_dlc/extractor/common.py index a61753b17..c1ea5d846 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dlc/extractor/common.py @@ -269,7 +269,7 @@ class InfoExtractor(object): Set to "root" to indicate that this is a comment to the original video. age_limit: Age restriction for the video, as an integer (years) - webpage_url: The URL to the video webpage, if given to youtube-dl it + webpage_url: The URL to the video webpage, if given to youtube-dlc it should allow to get the same result again. (It will be set by YoutubeDL if it's missing) categories: A list of categories that the video falls in, for example @@ -1500,7 +1500,7 @@ class InfoExtractor(object): if not isinstance(manifest, compat_etree_Element) and not fatal: return [] - # currently youtube-dl cannot decode the playerVerificationChallenge as Akamai uses Adobe Alchemy + # currently youtube-dlc cannot decode the playerVerificationChallenge as Akamai uses Adobe Alchemy akamai_pv = manifest.find('{http://ns.adobe.com/f4m/1.0}pv-2.0') if akamai_pv is not None and ';' in akamai_pv.text: playerVerificationChallenge = akamai_pv.text.split(';')[0] diff --git a/youtube_dl/extractor/commonmistakes.py b/youtube_dlc/extractor/commonmistakes.py similarity index 92% rename from youtube_dl/extractor/commonmistakes.py rename to youtube_dlc/extractor/commonmistakes.py index 7e12499b1..933b89eb3 100644 --- a/youtube_dl/extractor/commonmistakes.py +++ b/youtube_dlc/extractor/commonmistakes.py @@ -22,12 +22,12 @@ class CommonMistakesIE(InfoExtractor): def _real_extract(self, url): msg = ( - 'You\'ve asked youtube-dl to download the URL "%s". ' + 'You\'ve asked youtube-dlc to download the URL "%s". ' 'That doesn\'t make any sense. ' 'Simply remove the parameter in your command or configuration.' ) % url if not self._downloader.params.get('verbose'): - msg += ' Add -v to the command line to see what arguments and configuration youtube-dl got.' + msg += ' Add -v to the command line to see what arguments and configuration youtube-dlc got.' raise ExtractorError(msg, expected=True) diff --git a/youtube_dl/extractor/commonprotocols.py b/youtube_dlc/extractor/commonprotocols.py similarity index 100% rename from youtube_dl/extractor/commonprotocols.py rename to youtube_dlc/extractor/commonprotocols.py diff --git a/youtube_dl/extractor/condenast.py b/youtube_dlc/extractor/condenast.py similarity index 100% rename from youtube_dl/extractor/condenast.py rename to youtube_dlc/extractor/condenast.py diff --git a/youtube_dl/extractor/contv.py b/youtube_dlc/extractor/contv.py similarity index 100% rename from youtube_dl/extractor/contv.py rename to youtube_dlc/extractor/contv.py diff --git a/youtube_dl/extractor/corus.py b/youtube_dlc/extractor/corus.py similarity index 100% rename from youtube_dl/extractor/corus.py rename to youtube_dlc/extractor/corus.py diff --git a/youtube_dl/extractor/coub.py b/youtube_dlc/extractor/coub.py similarity index 100% rename from youtube_dl/extractor/coub.py rename to youtube_dlc/extractor/coub.py diff --git a/youtube_dl/extractor/cracked.py b/youtube_dlc/extractor/cracked.py similarity index 100% rename from youtube_dl/extractor/cracked.py rename to youtube_dlc/extractor/cracked.py diff --git a/youtube_dl/extractor/crackle.py b/youtube_dlc/extractor/crackle.py similarity index 100% rename from youtube_dl/extractor/crackle.py rename to youtube_dlc/extractor/crackle.py diff --git a/youtube_dl/extractor/crooksandliars.py b/youtube_dlc/extractor/crooksandliars.py similarity index 100% rename from youtube_dl/extractor/crooksandliars.py rename to youtube_dlc/extractor/crooksandliars.py diff --git a/youtube_dl/extractor/crunchyroll.py b/youtube_dlc/extractor/crunchyroll.py similarity index 100% rename from youtube_dl/extractor/crunchyroll.py rename to youtube_dlc/extractor/crunchyroll.py diff --git a/youtube_dl/extractor/cspan.py b/youtube_dlc/extractor/cspan.py similarity index 100% rename from youtube_dl/extractor/cspan.py rename to youtube_dlc/extractor/cspan.py diff --git a/youtube_dl/extractor/ctsnews.py b/youtube_dlc/extractor/ctsnews.py similarity index 100% rename from youtube_dl/extractor/ctsnews.py rename to youtube_dlc/extractor/ctsnews.py diff --git a/youtube_dl/extractor/ctvnews.py b/youtube_dlc/extractor/ctvnews.py similarity index 100% rename from youtube_dl/extractor/ctvnews.py rename to youtube_dlc/extractor/ctvnews.py diff --git a/youtube_dl/extractor/cultureunplugged.py b/youtube_dlc/extractor/cultureunplugged.py similarity index 100% rename from youtube_dl/extractor/cultureunplugged.py rename to youtube_dlc/extractor/cultureunplugged.py diff --git a/youtube_dl/extractor/curiositystream.py b/youtube_dlc/extractor/curiositystream.py similarity index 100% rename from youtube_dl/extractor/curiositystream.py rename to youtube_dlc/extractor/curiositystream.py diff --git a/youtube_dl/extractor/cwtv.py b/youtube_dlc/extractor/cwtv.py similarity index 100% rename from youtube_dl/extractor/cwtv.py rename to youtube_dlc/extractor/cwtv.py diff --git a/youtube_dl/extractor/dailymail.py b/youtube_dlc/extractor/dailymail.py similarity index 100% rename from youtube_dl/extractor/dailymail.py rename to youtube_dlc/extractor/dailymail.py diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dlc/extractor/dailymotion.py similarity index 100% rename from youtube_dl/extractor/dailymotion.py rename to youtube_dlc/extractor/dailymotion.py diff --git a/youtube_dl/extractor/daum.py b/youtube_dlc/extractor/daum.py similarity index 100% rename from youtube_dl/extractor/daum.py rename to youtube_dlc/extractor/daum.py diff --git a/youtube_dl/extractor/dbtv.py b/youtube_dlc/extractor/dbtv.py similarity index 100% rename from youtube_dl/extractor/dbtv.py rename to youtube_dlc/extractor/dbtv.py diff --git a/youtube_dl/extractor/dctp.py b/youtube_dlc/extractor/dctp.py similarity index 100% rename from youtube_dl/extractor/dctp.py rename to youtube_dlc/extractor/dctp.py diff --git a/youtube_dl/extractor/deezer.py b/youtube_dlc/extractor/deezer.py similarity index 100% rename from youtube_dl/extractor/deezer.py rename to youtube_dlc/extractor/deezer.py diff --git a/youtube_dl/extractor/defense.py b/youtube_dlc/extractor/defense.py similarity index 100% rename from youtube_dl/extractor/defense.py rename to youtube_dlc/extractor/defense.py diff --git a/youtube_dl/extractor/democracynow.py b/youtube_dlc/extractor/democracynow.py similarity index 100% rename from youtube_dl/extractor/democracynow.py rename to youtube_dlc/extractor/democracynow.py diff --git a/youtube_dl/extractor/dfb.py b/youtube_dlc/extractor/dfb.py similarity index 100% rename from youtube_dl/extractor/dfb.py rename to youtube_dlc/extractor/dfb.py diff --git a/youtube_dl/extractor/dhm.py b/youtube_dlc/extractor/dhm.py similarity index 100% rename from youtube_dl/extractor/dhm.py rename to youtube_dlc/extractor/dhm.py diff --git a/youtube_dl/extractor/digg.py b/youtube_dlc/extractor/digg.py similarity index 100% rename from youtube_dl/extractor/digg.py rename to youtube_dlc/extractor/digg.py diff --git a/youtube_dl/extractor/digiteka.py b/youtube_dlc/extractor/digiteka.py similarity index 100% rename from youtube_dl/extractor/digiteka.py rename to youtube_dlc/extractor/digiteka.py diff --git a/youtube_dl/extractor/discovery.py b/youtube_dlc/extractor/discovery.py similarity index 100% rename from youtube_dl/extractor/discovery.py rename to youtube_dlc/extractor/discovery.py diff --git a/youtube_dl/extractor/discoverygo.py b/youtube_dlc/extractor/discoverygo.py similarity index 100% rename from youtube_dl/extractor/discoverygo.py rename to youtube_dlc/extractor/discoverygo.py diff --git a/youtube_dl/extractor/discoverynetworks.py b/youtube_dlc/extractor/discoverynetworks.py similarity index 100% rename from youtube_dl/extractor/discoverynetworks.py rename to youtube_dlc/extractor/discoverynetworks.py diff --git a/youtube_dl/extractor/discoveryvr.py b/youtube_dlc/extractor/discoveryvr.py similarity index 100% rename from youtube_dl/extractor/discoveryvr.py rename to youtube_dlc/extractor/discoveryvr.py diff --git a/youtube_dl/extractor/disney.py b/youtube_dlc/extractor/disney.py similarity index 100% rename from youtube_dl/extractor/disney.py rename to youtube_dlc/extractor/disney.py diff --git a/youtube_dl/extractor/dispeak.py b/youtube_dlc/extractor/dispeak.py similarity index 100% rename from youtube_dl/extractor/dispeak.py rename to youtube_dlc/extractor/dispeak.py diff --git a/youtube_dl/extractor/dlive.py b/youtube_dlc/extractor/dlive.py similarity index 100% rename from youtube_dl/extractor/dlive.py rename to youtube_dlc/extractor/dlive.py diff --git a/youtube_dl/extractor/doodstream.py b/youtube_dlc/extractor/doodstream.py similarity index 100% rename from youtube_dl/extractor/doodstream.py rename to youtube_dlc/extractor/doodstream.py diff --git a/youtube_dl/extractor/dotsub.py b/youtube_dlc/extractor/dotsub.py similarity index 100% rename from youtube_dl/extractor/dotsub.py rename to youtube_dlc/extractor/dotsub.py diff --git a/youtube_dl/extractor/douyutv.py b/youtube_dlc/extractor/douyutv.py similarity index 100% rename from youtube_dl/extractor/douyutv.py rename to youtube_dlc/extractor/douyutv.py diff --git a/youtube_dl/extractor/dplay.py b/youtube_dlc/extractor/dplay.py similarity index 100% rename from youtube_dl/extractor/dplay.py rename to youtube_dlc/extractor/dplay.py diff --git a/youtube_dl/extractor/drbonanza.py b/youtube_dlc/extractor/drbonanza.py similarity index 100% rename from youtube_dl/extractor/drbonanza.py rename to youtube_dlc/extractor/drbonanza.py diff --git a/youtube_dl/extractor/dreisat.py b/youtube_dlc/extractor/dreisat.py similarity index 100% rename from youtube_dl/extractor/dreisat.py rename to youtube_dlc/extractor/dreisat.py diff --git a/youtube_dl/extractor/dropbox.py b/youtube_dlc/extractor/dropbox.py similarity index 90% rename from youtube_dl/extractor/dropbox.py rename to youtube_dlc/extractor/dropbox.py index 14b6c00b0..9dc6614c5 100644 --- a/youtube_dl/extractor/dropbox.py +++ b/youtube_dlc/extractor/dropbox.py @@ -13,11 +13,11 @@ class DropboxIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dropbox[.]com/sh?/(?P<id>[a-zA-Z0-9]{15})/.*' _TESTS = [ { - 'url': 'https://www.dropbox.com/s/nelirfsxnmcfbfh/youtube-dl%20test%20video%20%27%C3%A4%22BaW_jenozKc.mp4?dl=0', + 'url': 'https://www.dropbox.com/s/nelirfsxnmcfbfh/youtube-dlc%20test%20video%20%27%C3%A4%22BaW_jenozKc.mp4?dl=0', 'info_dict': { 'id': 'nelirfsxnmcfbfh', 'ext': 'mp4', - 'title': 'youtube-dl test video \'ä"BaW_jenozKc' + 'title': 'youtube-dlc test video \'ä"BaW_jenozKc' } }, { 'url': 'https://www.dropbox.com/sh/662glsejgzoj9sr/AAByil3FGH9KFNZ13e08eSa1a/Pregame%20Ceremony%20Program%20PA%2020140518.m4v', diff --git a/youtube_dl/extractor/drtuber.py b/youtube_dlc/extractor/drtuber.py similarity index 100% rename from youtube_dl/extractor/drtuber.py rename to youtube_dlc/extractor/drtuber.py diff --git a/youtube_dl/extractor/drtv.py b/youtube_dlc/extractor/drtv.py similarity index 100% rename from youtube_dl/extractor/drtv.py rename to youtube_dlc/extractor/drtv.py diff --git a/youtube_dl/extractor/dtube.py b/youtube_dlc/extractor/dtube.py similarity index 100% rename from youtube_dl/extractor/dtube.py rename to youtube_dlc/extractor/dtube.py diff --git a/youtube_dl/extractor/dumpert.py b/youtube_dlc/extractor/dumpert.py similarity index 100% rename from youtube_dl/extractor/dumpert.py rename to youtube_dlc/extractor/dumpert.py diff --git a/youtube_dl/extractor/dvtv.py b/youtube_dlc/extractor/dvtv.py similarity index 100% rename from youtube_dl/extractor/dvtv.py rename to youtube_dlc/extractor/dvtv.py diff --git a/youtube_dl/extractor/dw.py b/youtube_dlc/extractor/dw.py similarity index 100% rename from youtube_dl/extractor/dw.py rename to youtube_dlc/extractor/dw.py diff --git a/youtube_dl/extractor/eagleplatform.py b/youtube_dlc/extractor/eagleplatform.py similarity index 100% rename from youtube_dl/extractor/eagleplatform.py rename to youtube_dlc/extractor/eagleplatform.py diff --git a/youtube_dl/extractor/ebaumsworld.py b/youtube_dlc/extractor/ebaumsworld.py similarity index 100% rename from youtube_dl/extractor/ebaumsworld.py rename to youtube_dlc/extractor/ebaumsworld.py diff --git a/youtube_dl/extractor/echomsk.py b/youtube_dlc/extractor/echomsk.py similarity index 100% rename from youtube_dl/extractor/echomsk.py rename to youtube_dlc/extractor/echomsk.py diff --git a/youtube_dl/extractor/egghead.py b/youtube_dlc/extractor/egghead.py similarity index 100% rename from youtube_dl/extractor/egghead.py rename to youtube_dlc/extractor/egghead.py diff --git a/youtube_dl/extractor/ehow.py b/youtube_dlc/extractor/ehow.py similarity index 100% rename from youtube_dl/extractor/ehow.py rename to youtube_dlc/extractor/ehow.py diff --git a/youtube_dl/extractor/eighttracks.py b/youtube_dlc/extractor/eighttracks.py similarity index 85% rename from youtube_dl/extractor/eighttracks.py rename to youtube_dlc/extractor/eighttracks.py index 9a44f89f3..5ededd31d 100644 --- a/youtube_dl/extractor/eighttracks.py +++ b/youtube_dlc/extractor/eighttracks.py @@ -18,12 +18,12 @@ class EightTracksIE(InfoExtractor): _VALID_URL = r'https?://8tracks\.com/(?P<user>[^/]+)/(?P<id>[^/#]+)(?:#.*)?$' _TEST = { 'name': 'EightTracks', - 'url': 'http://8tracks.com/ytdl/youtube-dl-test-tracks-a', + 'url': 'http://8tracks.com/ytdl/youtube-dlc-test-tracks-a', 'info_dict': { 'id': '1336550', - 'display_id': 'youtube-dl-test-tracks-a', + 'display_id': 'youtube-dlc-test-tracks-a', 'description': "test chars: \"'/\\ä↭", - 'title': "youtube-dl test tracks \"'/\\ä↭<>", + 'title': "youtube-dlc test tracks \"'/\\ä↭<>", }, 'playlist': [ { @@ -31,7 +31,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885610', 'ext': 'm4a', - 'title': "youtue-dl project<>\"' - youtube-dl test track 1 \"'/\\\u00e4\u21ad", + 'title': "youtue-dl project<>\"' - youtube-dlc test track 1 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } }, @@ -40,7 +40,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885608', 'ext': 'm4a', - 'title': "youtube-dl project - youtube-dl test track 2 \"'/\\\u00e4\u21ad", + 'title': "youtube-dlc project - youtube-dlc test track 2 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } }, @@ -49,7 +49,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885679', 'ext': 'm4a', - 'title': "youtube-dl project as well - youtube-dl test track 3 \"'/\\\u00e4\u21ad", + 'title': "youtube-dlc project as well - youtube-dlc test track 3 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } }, @@ -58,7 +58,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885680', 'ext': 'm4a', - 'title': "youtube-dl project as well - youtube-dl test track 4 \"'/\\\u00e4\u21ad", + 'title': "youtube-dlc project as well - youtube-dlc test track 4 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } }, @@ -67,7 +67,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885682', 'ext': 'm4a', - 'title': "PH - youtube-dl test track 5 \"'/\\\u00e4\u21ad", + 'title': "PH - youtube-dlc test track 5 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } }, @@ -76,7 +76,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885683', 'ext': 'm4a', - 'title': "PH - youtube-dl test track 6 \"'/\\\u00e4\u21ad", + 'title': "PH - youtube-dlc test track 6 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } }, @@ -85,7 +85,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885684', 'ext': 'm4a', - 'title': "phihag - youtube-dl test track 7 \"'/\\\u00e4\u21ad", + 'title': "phihag - youtube-dlc test track 7 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } }, @@ -94,7 +94,7 @@ class EightTracksIE(InfoExtractor): 'info_dict': { 'id': '11885685', 'ext': 'm4a', - 'title': "phihag - youtube-dl test track 8 \"'/\\\u00e4\u21ad", + 'title': "phihag - youtube-dlc test track 8 \"'/\\\u00e4\u21ad", 'uploader_id': 'ytdl' } } diff --git a/youtube_dl/extractor/einthusan.py b/youtube_dlc/extractor/einthusan.py similarity index 100% rename from youtube_dl/extractor/einthusan.py rename to youtube_dlc/extractor/einthusan.py diff --git a/youtube_dl/extractor/eitb.py b/youtube_dlc/extractor/eitb.py similarity index 100% rename from youtube_dl/extractor/eitb.py rename to youtube_dlc/extractor/eitb.py diff --git a/youtube_dl/extractor/ellentube.py b/youtube_dlc/extractor/ellentube.py similarity index 100% rename from youtube_dl/extractor/ellentube.py rename to youtube_dlc/extractor/ellentube.py diff --git a/youtube_dl/extractor/elpais.py b/youtube_dlc/extractor/elpais.py similarity index 100% rename from youtube_dl/extractor/elpais.py rename to youtube_dlc/extractor/elpais.py diff --git a/youtube_dl/extractor/embedly.py b/youtube_dlc/extractor/embedly.py similarity index 100% rename from youtube_dl/extractor/embedly.py rename to youtube_dlc/extractor/embedly.py diff --git a/youtube_dl/extractor/engadget.py b/youtube_dlc/extractor/engadget.py similarity index 100% rename from youtube_dl/extractor/engadget.py rename to youtube_dlc/extractor/engadget.py diff --git a/youtube_dl/extractor/eporner.py b/youtube_dlc/extractor/eporner.py similarity index 100% rename from youtube_dl/extractor/eporner.py rename to youtube_dlc/extractor/eporner.py diff --git a/youtube_dl/extractor/eroprofile.py b/youtube_dlc/extractor/eroprofile.py similarity index 100% rename from youtube_dl/extractor/eroprofile.py rename to youtube_dlc/extractor/eroprofile.py diff --git a/youtube_dl/extractor/escapist.py b/youtube_dlc/extractor/escapist.py similarity index 100% rename from youtube_dl/extractor/escapist.py rename to youtube_dlc/extractor/escapist.py diff --git a/youtube_dl/extractor/espn.py b/youtube_dlc/extractor/espn.py similarity index 100% rename from youtube_dl/extractor/espn.py rename to youtube_dlc/extractor/espn.py diff --git a/youtube_dl/extractor/esri.py b/youtube_dlc/extractor/esri.py similarity index 100% rename from youtube_dl/extractor/esri.py rename to youtube_dlc/extractor/esri.py diff --git a/youtube_dl/extractor/europa.py b/youtube_dlc/extractor/europa.py similarity index 100% rename from youtube_dl/extractor/europa.py rename to youtube_dlc/extractor/europa.py diff --git a/youtube_dl/extractor/everyonesmixtape.py b/youtube_dlc/extractor/everyonesmixtape.py similarity index 100% rename from youtube_dl/extractor/everyonesmixtape.py rename to youtube_dlc/extractor/everyonesmixtape.py diff --git a/youtube_dl/extractor/expotv.py b/youtube_dlc/extractor/expotv.py similarity index 100% rename from youtube_dl/extractor/expotv.py rename to youtube_dlc/extractor/expotv.py diff --git a/youtube_dl/extractor/expressen.py b/youtube_dlc/extractor/expressen.py similarity index 100% rename from youtube_dl/extractor/expressen.py rename to youtube_dlc/extractor/expressen.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dlc/extractor/extractors.py similarity index 100% rename from youtube_dl/extractor/extractors.py rename to youtube_dlc/extractor/extractors.py diff --git a/youtube_dl/extractor/extremetube.py b/youtube_dlc/extractor/extremetube.py similarity index 100% rename from youtube_dl/extractor/extremetube.py rename to youtube_dlc/extractor/extremetube.py diff --git a/youtube_dl/extractor/eyedotv.py b/youtube_dlc/extractor/eyedotv.py similarity index 100% rename from youtube_dl/extractor/eyedotv.py rename to youtube_dlc/extractor/eyedotv.py diff --git a/youtube_dl/extractor/facebook.py b/youtube_dlc/extractor/facebook.py similarity index 100% rename from youtube_dl/extractor/facebook.py rename to youtube_dlc/extractor/facebook.py diff --git a/youtube_dl/extractor/faz.py b/youtube_dlc/extractor/faz.py similarity index 100% rename from youtube_dl/extractor/faz.py rename to youtube_dlc/extractor/faz.py diff --git a/youtube_dl/extractor/fc2.py b/youtube_dlc/extractor/fc2.py similarity index 100% rename from youtube_dl/extractor/fc2.py rename to youtube_dlc/extractor/fc2.py diff --git a/youtube_dl/extractor/fczenit.py b/youtube_dlc/extractor/fczenit.py similarity index 100% rename from youtube_dl/extractor/fczenit.py rename to youtube_dlc/extractor/fczenit.py diff --git a/youtube_dl/extractor/filmon.py b/youtube_dlc/extractor/filmon.py similarity index 100% rename from youtube_dl/extractor/filmon.py rename to youtube_dlc/extractor/filmon.py diff --git a/youtube_dl/extractor/filmweb.py b/youtube_dlc/extractor/filmweb.py similarity index 100% rename from youtube_dl/extractor/filmweb.py rename to youtube_dlc/extractor/filmweb.py diff --git a/youtube_dl/extractor/firsttv.py b/youtube_dlc/extractor/firsttv.py similarity index 100% rename from youtube_dl/extractor/firsttv.py rename to youtube_dlc/extractor/firsttv.py diff --git a/youtube_dl/extractor/fivemin.py b/youtube_dlc/extractor/fivemin.py similarity index 100% rename from youtube_dl/extractor/fivemin.py rename to youtube_dlc/extractor/fivemin.py diff --git a/youtube_dl/extractor/fivetv.py b/youtube_dlc/extractor/fivetv.py similarity index 100% rename from youtube_dl/extractor/fivetv.py rename to youtube_dlc/extractor/fivetv.py diff --git a/youtube_dl/extractor/flickr.py b/youtube_dlc/extractor/flickr.py similarity index 100% rename from youtube_dl/extractor/flickr.py rename to youtube_dlc/extractor/flickr.py diff --git a/youtube_dl/extractor/folketinget.py b/youtube_dlc/extractor/folketinget.py similarity index 100% rename from youtube_dl/extractor/folketinget.py rename to youtube_dlc/extractor/folketinget.py diff --git a/youtube_dl/extractor/footyroom.py b/youtube_dlc/extractor/footyroom.py similarity index 100% rename from youtube_dl/extractor/footyroom.py rename to youtube_dlc/extractor/footyroom.py diff --git a/youtube_dl/extractor/formula1.py b/youtube_dlc/extractor/formula1.py similarity index 100% rename from youtube_dl/extractor/formula1.py rename to youtube_dlc/extractor/formula1.py diff --git a/youtube_dl/extractor/fourtube.py b/youtube_dlc/extractor/fourtube.py similarity index 100% rename from youtube_dl/extractor/fourtube.py rename to youtube_dlc/extractor/fourtube.py diff --git a/youtube_dl/extractor/fox.py b/youtube_dlc/extractor/fox.py similarity index 100% rename from youtube_dl/extractor/fox.py rename to youtube_dlc/extractor/fox.py diff --git a/youtube_dl/extractor/fox9.py b/youtube_dlc/extractor/fox9.py similarity index 100% rename from youtube_dl/extractor/fox9.py rename to youtube_dlc/extractor/fox9.py diff --git a/youtube_dl/extractor/foxgay.py b/youtube_dlc/extractor/foxgay.py similarity index 100% rename from youtube_dl/extractor/foxgay.py rename to youtube_dlc/extractor/foxgay.py diff --git a/youtube_dl/extractor/foxnews.py b/youtube_dlc/extractor/foxnews.py similarity index 100% rename from youtube_dl/extractor/foxnews.py rename to youtube_dlc/extractor/foxnews.py diff --git a/youtube_dl/extractor/foxsports.py b/youtube_dlc/extractor/foxsports.py similarity index 100% rename from youtube_dl/extractor/foxsports.py rename to youtube_dlc/extractor/foxsports.py diff --git a/youtube_dl/extractor/franceculture.py b/youtube_dlc/extractor/franceculture.py similarity index 100% rename from youtube_dl/extractor/franceculture.py rename to youtube_dlc/extractor/franceculture.py diff --git a/youtube_dl/extractor/franceinter.py b/youtube_dlc/extractor/franceinter.py similarity index 100% rename from youtube_dl/extractor/franceinter.py rename to youtube_dlc/extractor/franceinter.py diff --git a/youtube_dl/extractor/francetv.py b/youtube_dlc/extractor/francetv.py similarity index 100% rename from youtube_dl/extractor/francetv.py rename to youtube_dlc/extractor/francetv.py diff --git a/youtube_dl/extractor/freesound.py b/youtube_dlc/extractor/freesound.py similarity index 100% rename from youtube_dl/extractor/freesound.py rename to youtube_dlc/extractor/freesound.py diff --git a/youtube_dl/extractor/freespeech.py b/youtube_dlc/extractor/freespeech.py similarity index 100% rename from youtube_dl/extractor/freespeech.py rename to youtube_dlc/extractor/freespeech.py diff --git a/youtube_dl/extractor/freshlive.py b/youtube_dlc/extractor/freshlive.py similarity index 100% rename from youtube_dl/extractor/freshlive.py rename to youtube_dlc/extractor/freshlive.py diff --git a/youtube_dl/extractor/frontendmasters.py b/youtube_dlc/extractor/frontendmasters.py similarity index 100% rename from youtube_dl/extractor/frontendmasters.py rename to youtube_dlc/extractor/frontendmasters.py diff --git a/youtube_dl/extractor/funimation.py b/youtube_dlc/extractor/funimation.py similarity index 100% rename from youtube_dl/extractor/funimation.py rename to youtube_dlc/extractor/funimation.py diff --git a/youtube_dl/extractor/funk.py b/youtube_dlc/extractor/funk.py similarity index 100% rename from youtube_dl/extractor/funk.py rename to youtube_dlc/extractor/funk.py diff --git a/youtube_dl/extractor/fusion.py b/youtube_dlc/extractor/fusion.py similarity index 100% rename from youtube_dl/extractor/fusion.py rename to youtube_dlc/extractor/fusion.py diff --git a/youtube_dl/extractor/fxnetworks.py b/youtube_dlc/extractor/fxnetworks.py similarity index 100% rename from youtube_dl/extractor/fxnetworks.py rename to youtube_dlc/extractor/fxnetworks.py diff --git a/youtube_dl/extractor/gaia.py b/youtube_dlc/extractor/gaia.py similarity index 100% rename from youtube_dl/extractor/gaia.py rename to youtube_dlc/extractor/gaia.py diff --git a/youtube_dl/extractor/gameinformer.py b/youtube_dlc/extractor/gameinformer.py similarity index 100% rename from youtube_dl/extractor/gameinformer.py rename to youtube_dlc/extractor/gameinformer.py diff --git a/youtube_dl/extractor/gamespot.py b/youtube_dlc/extractor/gamespot.py similarity index 100% rename from youtube_dl/extractor/gamespot.py rename to youtube_dlc/extractor/gamespot.py diff --git a/youtube_dl/extractor/gamestar.py b/youtube_dlc/extractor/gamestar.py similarity index 100% rename from youtube_dl/extractor/gamestar.py rename to youtube_dlc/extractor/gamestar.py diff --git a/youtube_dl/extractor/gaskrank.py b/youtube_dlc/extractor/gaskrank.py similarity index 100% rename from youtube_dl/extractor/gaskrank.py rename to youtube_dlc/extractor/gaskrank.py diff --git a/youtube_dl/extractor/gazeta.py b/youtube_dlc/extractor/gazeta.py similarity index 100% rename from youtube_dl/extractor/gazeta.py rename to youtube_dlc/extractor/gazeta.py diff --git a/youtube_dl/extractor/gdcvault.py b/youtube_dlc/extractor/gdcvault.py similarity index 100% rename from youtube_dl/extractor/gdcvault.py rename to youtube_dlc/extractor/gdcvault.py diff --git a/youtube_dl/extractor/generic.py b/youtube_dlc/extractor/generic.py similarity index 99% rename from youtube_dl/extractor/generic.py rename to youtube_dlc/extractor/generic.py index 355067a50..aba06b328 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dlc/extractor/generic.py @@ -1947,7 +1947,7 @@ class GenericIE(InfoExtractor): }, { # vshare embed - 'url': 'https://youtube-dl-demo.neocities.org/vshare.html', + 'url': 'https://youtube-dlc-demo.neocities.org/vshare.html', 'md5': '17b39f55b5497ae8b59f5fbce8e35886', 'info_dict': { 'id': '0f64ce6', @@ -2263,7 +2263,7 @@ class GenericIE(InfoExtractor): if default_search == 'auto_warning': if re.match(r'^(?:url|URL)$', url): raise ExtractorError( - 'Invalid URL: %r . Call youtube-dl like this: youtube-dl -v "https://www.youtube.com/watch?v=BaW_jenozKc" ' % url, + 'Invalid URL: %r . Call youtube-dlc like this: youtube-dlc -v "https://www.youtube.com/watch?v=BaW_jenozKc" ' % url, expected=True) else: self._downloader.report_warning( @@ -2273,7 +2273,7 @@ class GenericIE(InfoExtractor): if default_search in ('error', 'fixup_error'): raise ExtractorError( '%r is not a valid URL. ' - 'Set --default-search "ytsearch" (or run youtube-dl "ytsearch:%s" ) to search YouTube' + 'Set --default-search "ytsearch" (or run youtube-dlc "ytsearch:%s" ) to search YouTube' % (url, url), expected=True) else: if ':' not in default_search: @@ -2349,7 +2349,7 @@ class GenericIE(InfoExtractor): request = sanitized_Request(url) # Some webservers may serve compressed content of rather big size (e.g. gzipped flac) # making it impossible to download only chunk of the file (yet we need only 512kB to - # test whether it's HTML or not). According to youtube-dl default Accept-Encoding + # test whether it's HTML or not). According to youtube-dlc default Accept-Encoding # that will always result in downloading the whole file that is not desirable. # Therefore for extraction pass we have to override Accept-Encoding to any in order # to accept raw bytes and being able to download only a chunk. @@ -3372,7 +3372,7 @@ class GenericIE(InfoExtractor): if not found: # twitter:player is a https URL to iframe player that may or may not - # be supported by youtube-dl thus this is checked the very last (see + # be supported by youtube-dlc thus this is checked the very last (see # https://dev.twitter.com/cards/types/player#On_twitter.com_via_desktop_browser) embed_url = self._html_search_meta('twitter:player', webpage, default=None) if embed_url and embed_url != url: diff --git a/youtube_dl/extractor/gfycat.py b/youtube_dlc/extractor/gfycat.py similarity index 100% rename from youtube_dl/extractor/gfycat.py rename to youtube_dlc/extractor/gfycat.py diff --git a/youtube_dl/extractor/giantbomb.py b/youtube_dlc/extractor/giantbomb.py similarity index 100% rename from youtube_dl/extractor/giantbomb.py rename to youtube_dlc/extractor/giantbomb.py diff --git a/youtube_dl/extractor/giga.py b/youtube_dlc/extractor/giga.py similarity index 100% rename from youtube_dl/extractor/giga.py rename to youtube_dlc/extractor/giga.py diff --git a/youtube_dl/extractor/gigya.py b/youtube_dlc/extractor/gigya.py similarity index 100% rename from youtube_dl/extractor/gigya.py rename to youtube_dlc/extractor/gigya.py diff --git a/youtube_dl/extractor/glide.py b/youtube_dlc/extractor/glide.py similarity index 100% rename from youtube_dl/extractor/glide.py rename to youtube_dlc/extractor/glide.py diff --git a/youtube_dl/extractor/globo.py b/youtube_dlc/extractor/globo.py similarity index 100% rename from youtube_dl/extractor/globo.py rename to youtube_dlc/extractor/globo.py diff --git a/youtube_dl/extractor/go.py b/youtube_dlc/extractor/go.py similarity index 100% rename from youtube_dl/extractor/go.py rename to youtube_dlc/extractor/go.py diff --git a/youtube_dl/extractor/godtube.py b/youtube_dlc/extractor/godtube.py similarity index 100% rename from youtube_dl/extractor/godtube.py rename to youtube_dlc/extractor/godtube.py diff --git a/youtube_dl/extractor/golem.py b/youtube_dlc/extractor/golem.py similarity index 100% rename from youtube_dl/extractor/golem.py rename to youtube_dlc/extractor/golem.py diff --git a/youtube_dl/extractor/googledrive.py b/youtube_dlc/extractor/googledrive.py similarity index 100% rename from youtube_dl/extractor/googledrive.py rename to youtube_dlc/extractor/googledrive.py diff --git a/youtube_dl/extractor/googleplus.py b/youtube_dlc/extractor/googleplus.py similarity index 100% rename from youtube_dl/extractor/googleplus.py rename to youtube_dlc/extractor/googleplus.py diff --git a/youtube_dl/extractor/googlesearch.py b/youtube_dlc/extractor/googlesearch.py similarity index 100% rename from youtube_dl/extractor/googlesearch.py rename to youtube_dlc/extractor/googlesearch.py diff --git a/youtube_dl/extractor/goshgay.py b/youtube_dlc/extractor/goshgay.py similarity index 100% rename from youtube_dl/extractor/goshgay.py rename to youtube_dlc/extractor/goshgay.py diff --git a/youtube_dl/extractor/gputechconf.py b/youtube_dlc/extractor/gputechconf.py similarity index 100% rename from youtube_dl/extractor/gputechconf.py rename to youtube_dlc/extractor/gputechconf.py diff --git a/youtube_dl/extractor/groupon.py b/youtube_dlc/extractor/groupon.py similarity index 100% rename from youtube_dl/extractor/groupon.py rename to youtube_dlc/extractor/groupon.py diff --git a/youtube_dl/extractor/hbo.py b/youtube_dlc/extractor/hbo.py similarity index 100% rename from youtube_dl/extractor/hbo.py rename to youtube_dlc/extractor/hbo.py diff --git a/youtube_dl/extractor/hearthisat.py b/youtube_dlc/extractor/hearthisat.py similarity index 100% rename from youtube_dl/extractor/hearthisat.py rename to youtube_dlc/extractor/hearthisat.py diff --git a/youtube_dl/extractor/heise.py b/youtube_dlc/extractor/heise.py similarity index 100% rename from youtube_dl/extractor/heise.py rename to youtube_dlc/extractor/heise.py diff --git a/youtube_dl/extractor/hellporno.py b/youtube_dlc/extractor/hellporno.py similarity index 100% rename from youtube_dl/extractor/hellporno.py rename to youtube_dlc/extractor/hellporno.py diff --git a/youtube_dl/extractor/helsinki.py b/youtube_dlc/extractor/helsinki.py similarity index 100% rename from youtube_dl/extractor/helsinki.py rename to youtube_dlc/extractor/helsinki.py diff --git a/youtube_dl/extractor/hentaistigma.py b/youtube_dlc/extractor/hentaistigma.py similarity index 100% rename from youtube_dl/extractor/hentaistigma.py rename to youtube_dlc/extractor/hentaistigma.py diff --git a/youtube_dl/extractor/hgtv.py b/youtube_dlc/extractor/hgtv.py similarity index 100% rename from youtube_dl/extractor/hgtv.py rename to youtube_dlc/extractor/hgtv.py diff --git a/youtube_dl/extractor/hidive.py b/youtube_dlc/extractor/hidive.py similarity index 100% rename from youtube_dl/extractor/hidive.py rename to youtube_dlc/extractor/hidive.py diff --git a/youtube_dl/extractor/historicfilms.py b/youtube_dlc/extractor/historicfilms.py similarity index 100% rename from youtube_dl/extractor/historicfilms.py rename to youtube_dlc/extractor/historicfilms.py diff --git a/youtube_dl/extractor/hitbox.py b/youtube_dlc/extractor/hitbox.py similarity index 100% rename from youtube_dl/extractor/hitbox.py rename to youtube_dlc/extractor/hitbox.py diff --git a/youtube_dl/extractor/hitrecord.py b/youtube_dlc/extractor/hitrecord.py similarity index 100% rename from youtube_dl/extractor/hitrecord.py rename to youtube_dlc/extractor/hitrecord.py diff --git a/youtube_dl/extractor/hketv.py b/youtube_dlc/extractor/hketv.py similarity index 100% rename from youtube_dl/extractor/hketv.py rename to youtube_dlc/extractor/hketv.py diff --git a/youtube_dl/extractor/hornbunny.py b/youtube_dlc/extractor/hornbunny.py similarity index 100% rename from youtube_dl/extractor/hornbunny.py rename to youtube_dlc/extractor/hornbunny.py diff --git a/youtube_dl/extractor/hotnewhiphop.py b/youtube_dlc/extractor/hotnewhiphop.py similarity index 100% rename from youtube_dl/extractor/hotnewhiphop.py rename to youtube_dlc/extractor/hotnewhiphop.py diff --git a/youtube_dl/extractor/hotstar.py b/youtube_dlc/extractor/hotstar.py similarity index 100% rename from youtube_dl/extractor/hotstar.py rename to youtube_dlc/extractor/hotstar.py diff --git a/youtube_dl/extractor/howcast.py b/youtube_dlc/extractor/howcast.py similarity index 100% rename from youtube_dl/extractor/howcast.py rename to youtube_dlc/extractor/howcast.py diff --git a/youtube_dl/extractor/howstuffworks.py b/youtube_dlc/extractor/howstuffworks.py similarity index 100% rename from youtube_dl/extractor/howstuffworks.py rename to youtube_dlc/extractor/howstuffworks.py diff --git a/youtube_dl/extractor/hrfensehen.py b/youtube_dlc/extractor/hrfensehen.py similarity index 98% rename from youtube_dl/extractor/hrfensehen.py rename to youtube_dlc/extractor/hrfensehen.py index 2beadef2c..805345e69 100644 --- a/youtube_dl/extractor/hrfensehen.py +++ b/youtube_dlc/extractor/hrfensehen.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import json import re -from youtube_dl.utils import int_or_none, unified_timestamp, unescapeHTML +from youtube_dlc.utils import int_or_none, unified_timestamp, unescapeHTML from .common import InfoExtractor diff --git a/youtube_dl/extractor/hrti.py b/youtube_dlc/extractor/hrti.py similarity index 100% rename from youtube_dl/extractor/hrti.py rename to youtube_dlc/extractor/hrti.py diff --git a/youtube_dl/extractor/huajiao.py b/youtube_dlc/extractor/huajiao.py similarity index 100% rename from youtube_dl/extractor/huajiao.py rename to youtube_dlc/extractor/huajiao.py diff --git a/youtube_dl/extractor/huffpost.py b/youtube_dlc/extractor/huffpost.py similarity index 100% rename from youtube_dl/extractor/huffpost.py rename to youtube_dlc/extractor/huffpost.py diff --git a/youtube_dl/extractor/hungama.py b/youtube_dlc/extractor/hungama.py similarity index 100% rename from youtube_dl/extractor/hungama.py rename to youtube_dlc/extractor/hungama.py diff --git a/youtube_dl/extractor/hypem.py b/youtube_dlc/extractor/hypem.py similarity index 100% rename from youtube_dl/extractor/hypem.py rename to youtube_dlc/extractor/hypem.py diff --git a/youtube_dl/extractor/ign.py b/youtube_dlc/extractor/ign.py similarity index 100% rename from youtube_dl/extractor/ign.py rename to youtube_dlc/extractor/ign.py diff --git a/youtube_dl/extractor/imdb.py b/youtube_dlc/extractor/imdb.py similarity index 100% rename from youtube_dl/extractor/imdb.py rename to youtube_dlc/extractor/imdb.py diff --git a/youtube_dl/extractor/imggaming.py b/youtube_dlc/extractor/imggaming.py similarity index 100% rename from youtube_dl/extractor/imggaming.py rename to youtube_dlc/extractor/imggaming.py diff --git a/youtube_dl/extractor/imgur.py b/youtube_dlc/extractor/imgur.py similarity index 97% rename from youtube_dl/extractor/imgur.py rename to youtube_dlc/extractor/imgur.py index a5ba03efa..4dc7b0b5c 100644 --- a/youtube_dl/extractor/imgur.py +++ b/youtube_dlc/extractor/imgur.py @@ -60,7 +60,7 @@ class ImgurIE(InfoExtractor): 'width': width, 'height': height, 'http_headers': { - 'User-Agent': 'youtube-dl (like wget)', + 'User-Agent': 'youtube-dlc (like wget)', }, }) @@ -82,7 +82,7 @@ class ImgurIE(InfoExtractor): 'url': self._proto_relative_url(gifd['gifUrl']), 'filesize': gifd.get('size'), 'http_headers': { - 'User-Agent': 'youtube-dl (like wget)', + 'User-Agent': 'youtube-dlc (like wget)', }, }) diff --git a/youtube_dl/extractor/ina.py b/youtube_dlc/extractor/ina.py similarity index 100% rename from youtube_dl/extractor/ina.py rename to youtube_dlc/extractor/ina.py diff --git a/youtube_dl/extractor/inc.py b/youtube_dlc/extractor/inc.py similarity index 100% rename from youtube_dl/extractor/inc.py rename to youtube_dlc/extractor/inc.py diff --git a/youtube_dl/extractor/indavideo.py b/youtube_dlc/extractor/indavideo.py similarity index 100% rename from youtube_dl/extractor/indavideo.py rename to youtube_dlc/extractor/indavideo.py diff --git a/youtube_dl/extractor/infoq.py b/youtube_dlc/extractor/infoq.py similarity index 100% rename from youtube_dl/extractor/infoq.py rename to youtube_dlc/extractor/infoq.py diff --git a/youtube_dl/extractor/instagram.py b/youtube_dlc/extractor/instagram.py similarity index 100% rename from youtube_dl/extractor/instagram.py rename to youtube_dlc/extractor/instagram.py diff --git a/youtube_dl/extractor/internazionale.py b/youtube_dlc/extractor/internazionale.py similarity index 100% rename from youtube_dl/extractor/internazionale.py rename to youtube_dlc/extractor/internazionale.py diff --git a/youtube_dl/extractor/internetvideoarchive.py b/youtube_dlc/extractor/internetvideoarchive.py similarity index 100% rename from youtube_dl/extractor/internetvideoarchive.py rename to youtube_dlc/extractor/internetvideoarchive.py diff --git a/youtube_dl/extractor/iprima.py b/youtube_dlc/extractor/iprima.py similarity index 100% rename from youtube_dl/extractor/iprima.py rename to youtube_dlc/extractor/iprima.py diff --git a/youtube_dl/extractor/iqiyi.py b/youtube_dlc/extractor/iqiyi.py similarity index 100% rename from youtube_dl/extractor/iqiyi.py rename to youtube_dlc/extractor/iqiyi.py diff --git a/youtube_dl/extractor/ir90tv.py b/youtube_dlc/extractor/ir90tv.py similarity index 100% rename from youtube_dl/extractor/ir90tv.py rename to youtube_dlc/extractor/ir90tv.py diff --git a/youtube_dl/extractor/itv.py b/youtube_dlc/extractor/itv.py similarity index 100% rename from youtube_dl/extractor/itv.py rename to youtube_dlc/extractor/itv.py diff --git a/youtube_dl/extractor/ivi.py b/youtube_dlc/extractor/ivi.py similarity index 99% rename from youtube_dl/extractor/ivi.py rename to youtube_dlc/extractor/ivi.py index b5a740a01..b9cb5a8e6 100644 --- a/youtube_dl/extractor/ivi.py +++ b/youtube_dlc/extractor/ivi.py @@ -142,7 +142,7 @@ class IviIE(InfoExtractor): continue elif bundled: raise ExtractorError( - 'This feature does not work from bundled exe. Run youtube-dl from sources.', + 'This feature does not work from bundled exe. Run youtube-dlc from sources.', expected=True) elif not pycryptodomex_found: raise ExtractorError( diff --git a/youtube_dl/extractor/ivideon.py b/youtube_dlc/extractor/ivideon.py similarity index 100% rename from youtube_dl/extractor/ivideon.py rename to youtube_dlc/extractor/ivideon.py diff --git a/youtube_dl/extractor/iwara.py b/youtube_dlc/extractor/iwara.py similarity index 100% rename from youtube_dl/extractor/iwara.py rename to youtube_dlc/extractor/iwara.py diff --git a/youtube_dl/extractor/izlesene.py b/youtube_dlc/extractor/izlesene.py similarity index 100% rename from youtube_dl/extractor/izlesene.py rename to youtube_dlc/extractor/izlesene.py diff --git a/youtube_dl/extractor/jamendo.py b/youtube_dlc/extractor/jamendo.py similarity index 100% rename from youtube_dl/extractor/jamendo.py rename to youtube_dlc/extractor/jamendo.py diff --git a/youtube_dl/extractor/jeuxvideo.py b/youtube_dlc/extractor/jeuxvideo.py similarity index 100% rename from youtube_dl/extractor/jeuxvideo.py rename to youtube_dlc/extractor/jeuxvideo.py diff --git a/youtube_dl/extractor/joj.py b/youtube_dlc/extractor/joj.py similarity index 97% rename from youtube_dl/extractor/joj.py rename to youtube_dlc/extractor/joj.py index 62b28e980..637618183 100644 --- a/youtube_dl/extractor/joj.py +++ b/youtube_dlc/extractor/joj.py @@ -1,108 +1,108 @@ -# coding: utf-8 -from __future__ import unicode_literals - -import re - -from .common import InfoExtractor -from ..compat import compat_str -from ..utils import ( - int_or_none, - js_to_json, - try_get, -) - - -class JojIE(InfoExtractor): - _VALID_URL = r'''(?x) - (?: - joj:| - https?://media\.joj\.sk/embed/ - ) - (?P<id>[^/?#^]+) - ''' - _TESTS = [{ - 'url': 'https://media.joj.sk/embed/a388ec4c-6019-4a4a-9312-b1bee194e932', - 'info_dict': { - 'id': 'a388ec4c-6019-4a4a-9312-b1bee194e932', - 'ext': 'mp4', - 'title': 'NOVÉ BÝVANIE', - 'thumbnail': r're:^https?://.*\.jpg$', - 'duration': 3118, - } - }, { - 'url': 'https://media.joj.sk/embed/9i1cxv', - 'only_matching': True, - }, { - 'url': 'joj:a388ec4c-6019-4a4a-9312-b1bee194e932', - 'only_matching': True, - }, { - 'url': 'joj:9i1cxv', - 'only_matching': True, - }] - - @staticmethod - def _extract_urls(webpage): - return [ - mobj.group('url') - for mobj in re.finditer( - r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//media\.joj\.sk/embed/(?:(?!\1).)+)\1', - webpage)] - - def _real_extract(self, url): - video_id = self._match_id(url) - - webpage = self._download_webpage( - 'https://media.joj.sk/embed/%s' % video_id, video_id) - - title = self._search_regex( - (r'videoTitle\s*:\s*(["\'])(?P<title>(?:(?!\1).)+)\1', - r'<title>(?P<title>[^<]+)'), webpage, 'title', - default=None, group='title') or self._og_search_title(webpage) - - bitrates = self._parse_json( - self._search_regex( - r'(?s)(?:src|bitrates)\s*=\s*({.+?});', webpage, 'bitrates', - default='{}'), - video_id, transform_source=js_to_json, fatal=False) - - formats = [] - for format_url in try_get(bitrates, lambda x: x['mp4'], list) or []: - if isinstance(format_url, compat_str): - height = self._search_regex( - r'(\d+)[pP]\.', format_url, 'height', default=None) - formats.append({ - 'url': format_url, - 'format_id': '%sp' % height if height else None, - 'height': int(height), - }) - if not formats: - playlist = self._download_xml( - 'https://media.joj.sk/services/Video.php?clip=%s' % video_id, - video_id) - for file_el in playlist.findall('./files/file'): - path = file_el.get('path') - if not path: - continue - format_id = file_el.get('id') or file_el.get('label') - formats.append({ - 'url': 'http://n16.joj.sk/storage/%s' % path.replace( - 'dat/', '', 1), - 'format_id': format_id, - 'height': int_or_none(self._search_regex( - r'(\d+)[pP]', format_id or path, 'height', - default=None)), - }) - self._sort_formats(formats) - - thumbnail = self._og_search_thumbnail(webpage) - - duration = int_or_none(self._search_regex( - r'videoDuration\s*:\s*(\d+)', webpage, 'duration', fatal=False)) - - return { - 'id': video_id, - 'title': title, - 'thumbnail': thumbnail, - 'duration': duration, - 'formats': formats, - } +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..compat import compat_str +from ..utils import ( + int_or_none, + js_to_json, + try_get, +) + + +class JojIE(InfoExtractor): + _VALID_URL = r'''(?x) + (?: + joj:| + https?://media\.joj\.sk/embed/ + ) + (?P<id>[^/?#^]+) + ''' + _TESTS = [{ + 'url': 'https://media.joj.sk/embed/a388ec4c-6019-4a4a-9312-b1bee194e932', + 'info_dict': { + 'id': 'a388ec4c-6019-4a4a-9312-b1bee194e932', + 'ext': 'mp4', + 'title': 'NOVÉ BÝVANIE', + 'thumbnail': r're:^https?://.*\.jpg$', + 'duration': 3118, + } + }, { + 'url': 'https://media.joj.sk/embed/9i1cxv', + 'only_matching': True, + }, { + 'url': 'joj:a388ec4c-6019-4a4a-9312-b1bee194e932', + 'only_matching': True, + }, { + 'url': 'joj:9i1cxv', + 'only_matching': True, + }] + + @staticmethod + def _extract_urls(webpage): + return [ + mobj.group('url') + for mobj in re.finditer( + r'<iframe\b[^>]+\bsrc=(["\'])(?P<url>(?:https?:)?//media\.joj\.sk/embed/(?:(?!\1).)+)\1', + webpage)] + + def _real_extract(self, url): + video_id = self._match_id(url) + + webpage = self._download_webpage( + 'https://media.joj.sk/embed/%s' % video_id, video_id) + + title = self._search_regex( + (r'videoTitle\s*:\s*(["\'])(?P<title>(?:(?!\1).)+)\1', + r'<title>(?P<title>[^<]+)'), webpage, 'title', + default=None, group='title') or self._og_search_title(webpage) + + bitrates = self._parse_json( + self._search_regex( + r'(?s)(?:src|bitrates)\s*=\s*({.+?});', webpage, 'bitrates', + default='{}'), + video_id, transform_source=js_to_json, fatal=False) + + formats = [] + for format_url in try_get(bitrates, lambda x: x['mp4'], list) or []: + if isinstance(format_url, compat_str): + height = self._search_regex( + r'(\d+)[pP]\.', format_url, 'height', default=None) + formats.append({ + 'url': format_url, + 'format_id': '%sp' % height if height else None, + 'height': int(height), + }) + if not formats: + playlist = self._download_xml( + 'https://media.joj.sk/services/Video.php?clip=%s' % video_id, + video_id) + for file_el in playlist.findall('./files/file'): + path = file_el.get('path') + if not path: + continue + format_id = file_el.get('id') or file_el.get('label') + formats.append({ + 'url': 'http://n16.joj.sk/storage/%s' % path.replace( + 'dat/', '', 1), + 'format_id': format_id, + 'height': int_or_none(self._search_regex( + r'(\d+)[pP]', format_id or path, 'height', + default=None)), + }) + self._sort_formats(formats) + + thumbnail = self._og_search_thumbnail(webpage) + + duration = int_or_none(self._search_regex( + r'videoDuration\s*:\s*(\d+)', webpage, 'duration', fatal=False)) + + return { + 'id': video_id, + 'title': title, + 'thumbnail': thumbnail, + 'duration': duration, + 'formats': formats, + } diff --git a/youtube_dl/extractor/jove.py b/youtube_dlc/extractor/jove.py similarity index 100% rename from youtube_dl/extractor/jove.py rename to youtube_dlc/extractor/jove.py diff --git a/youtube_dl/extractor/jwplatform.py b/youtube_dlc/extractor/jwplatform.py similarity index 100% rename from youtube_dl/extractor/jwplatform.py rename to youtube_dlc/extractor/jwplatform.py diff --git a/youtube_dl/extractor/kakao.py b/youtube_dlc/extractor/kakao.py similarity index 100% rename from youtube_dl/extractor/kakao.py rename to youtube_dlc/extractor/kakao.py diff --git a/youtube_dl/extractor/kaltura.py b/youtube_dlc/extractor/kaltura.py similarity index 100% rename from youtube_dl/extractor/kaltura.py rename to youtube_dlc/extractor/kaltura.py diff --git a/youtube_dl/extractor/kanalplay.py b/youtube_dlc/extractor/kanalplay.py similarity index 100% rename from youtube_dl/extractor/kanalplay.py rename to youtube_dlc/extractor/kanalplay.py diff --git a/youtube_dl/extractor/kankan.py b/youtube_dlc/extractor/kankan.py similarity index 100% rename from youtube_dl/extractor/kankan.py rename to youtube_dlc/extractor/kankan.py diff --git a/youtube_dl/extractor/karaoketv.py b/youtube_dlc/extractor/karaoketv.py similarity index 100% rename from youtube_dl/extractor/karaoketv.py rename to youtube_dlc/extractor/karaoketv.py diff --git a/youtube_dl/extractor/karrierevideos.py b/youtube_dlc/extractor/karrierevideos.py similarity index 100% rename from youtube_dl/extractor/karrierevideos.py rename to youtube_dlc/extractor/karrierevideos.py diff --git a/youtube_dl/extractor/keezmovies.py b/youtube_dlc/extractor/keezmovies.py similarity index 100% rename from youtube_dl/extractor/keezmovies.py rename to youtube_dlc/extractor/keezmovies.py diff --git a/youtube_dl/extractor/ketnet.py b/youtube_dlc/extractor/ketnet.py similarity index 100% rename from youtube_dl/extractor/ketnet.py rename to youtube_dlc/extractor/ketnet.py diff --git a/youtube_dl/extractor/khanacademy.py b/youtube_dlc/extractor/khanacademy.py similarity index 100% rename from youtube_dl/extractor/khanacademy.py rename to youtube_dlc/extractor/khanacademy.py diff --git a/youtube_dl/extractor/kickstarter.py b/youtube_dlc/extractor/kickstarter.py similarity index 100% rename from youtube_dl/extractor/kickstarter.py rename to youtube_dlc/extractor/kickstarter.py diff --git a/youtube_dl/extractor/kinja.py b/youtube_dlc/extractor/kinja.py similarity index 100% rename from youtube_dl/extractor/kinja.py rename to youtube_dlc/extractor/kinja.py diff --git a/youtube_dl/extractor/kinopoisk.py b/youtube_dlc/extractor/kinopoisk.py similarity index 100% rename from youtube_dl/extractor/kinopoisk.py rename to youtube_dlc/extractor/kinopoisk.py diff --git a/youtube_dl/extractor/konserthusetplay.py b/youtube_dlc/extractor/konserthusetplay.py similarity index 100% rename from youtube_dl/extractor/konserthusetplay.py rename to youtube_dlc/extractor/konserthusetplay.py diff --git a/youtube_dl/extractor/krasview.py b/youtube_dlc/extractor/krasview.py similarity index 100% rename from youtube_dl/extractor/krasview.py rename to youtube_dlc/extractor/krasview.py diff --git a/youtube_dl/extractor/ku6.py b/youtube_dlc/extractor/ku6.py similarity index 100% rename from youtube_dl/extractor/ku6.py rename to youtube_dlc/extractor/ku6.py diff --git a/youtube_dl/extractor/kusi.py b/youtube_dlc/extractor/kusi.py similarity index 100% rename from youtube_dl/extractor/kusi.py rename to youtube_dlc/extractor/kusi.py diff --git a/youtube_dl/extractor/kuwo.py b/youtube_dlc/extractor/kuwo.py similarity index 100% rename from youtube_dl/extractor/kuwo.py rename to youtube_dlc/extractor/kuwo.py diff --git a/youtube_dl/extractor/la7.py b/youtube_dlc/extractor/la7.py similarity index 100% rename from youtube_dl/extractor/la7.py rename to youtube_dlc/extractor/la7.py diff --git a/youtube_dl/extractor/laola1tv.py b/youtube_dlc/extractor/laola1tv.py similarity index 100% rename from youtube_dl/extractor/laola1tv.py rename to youtube_dlc/extractor/laola1tv.py diff --git a/youtube_dl/extractor/lci.py b/youtube_dlc/extractor/lci.py similarity index 100% rename from youtube_dl/extractor/lci.py rename to youtube_dlc/extractor/lci.py diff --git a/youtube_dl/extractor/lcp.py b/youtube_dlc/extractor/lcp.py similarity index 100% rename from youtube_dl/extractor/lcp.py rename to youtube_dlc/extractor/lcp.py diff --git a/youtube_dl/extractor/lecture2go.py b/youtube_dlc/extractor/lecture2go.py similarity index 100% rename from youtube_dl/extractor/lecture2go.py rename to youtube_dlc/extractor/lecture2go.py diff --git a/youtube_dl/extractor/lecturio.py b/youtube_dlc/extractor/lecturio.py similarity index 100% rename from youtube_dl/extractor/lecturio.py rename to youtube_dlc/extractor/lecturio.py diff --git a/youtube_dl/extractor/leeco.py b/youtube_dlc/extractor/leeco.py similarity index 100% rename from youtube_dl/extractor/leeco.py rename to youtube_dlc/extractor/leeco.py diff --git a/youtube_dl/extractor/lego.py b/youtube_dlc/extractor/lego.py similarity index 100% rename from youtube_dl/extractor/lego.py rename to youtube_dlc/extractor/lego.py diff --git a/youtube_dl/extractor/lemonde.py b/youtube_dlc/extractor/lemonde.py similarity index 100% rename from youtube_dl/extractor/lemonde.py rename to youtube_dlc/extractor/lemonde.py diff --git a/youtube_dl/extractor/lenta.py b/youtube_dlc/extractor/lenta.py similarity index 100% rename from youtube_dl/extractor/lenta.py rename to youtube_dlc/extractor/lenta.py diff --git a/youtube_dl/extractor/libraryofcongress.py b/youtube_dlc/extractor/libraryofcongress.py similarity index 100% rename from youtube_dl/extractor/libraryofcongress.py rename to youtube_dlc/extractor/libraryofcongress.py diff --git a/youtube_dl/extractor/libsyn.py b/youtube_dlc/extractor/libsyn.py similarity index 100% rename from youtube_dl/extractor/libsyn.py rename to youtube_dlc/extractor/libsyn.py diff --git a/youtube_dl/extractor/lifenews.py b/youtube_dlc/extractor/lifenews.py similarity index 100% rename from youtube_dl/extractor/lifenews.py rename to youtube_dlc/extractor/lifenews.py diff --git a/youtube_dl/extractor/limelight.py b/youtube_dlc/extractor/limelight.py similarity index 100% rename from youtube_dl/extractor/limelight.py rename to youtube_dlc/extractor/limelight.py diff --git a/youtube_dl/extractor/line.py b/youtube_dlc/extractor/line.py similarity index 100% rename from youtube_dl/extractor/line.py rename to youtube_dlc/extractor/line.py diff --git a/youtube_dl/extractor/linkedin.py b/youtube_dlc/extractor/linkedin.py similarity index 100% rename from youtube_dl/extractor/linkedin.py rename to youtube_dlc/extractor/linkedin.py diff --git a/youtube_dl/extractor/linuxacademy.py b/youtube_dlc/extractor/linuxacademy.py similarity index 100% rename from youtube_dl/extractor/linuxacademy.py rename to youtube_dlc/extractor/linuxacademy.py diff --git a/youtube_dl/extractor/litv.py b/youtube_dlc/extractor/litv.py similarity index 100% rename from youtube_dl/extractor/litv.py rename to youtube_dlc/extractor/litv.py diff --git a/youtube_dl/extractor/livejournal.py b/youtube_dlc/extractor/livejournal.py similarity index 100% rename from youtube_dl/extractor/livejournal.py rename to youtube_dlc/extractor/livejournal.py diff --git a/youtube_dl/extractor/liveleak.py b/youtube_dlc/extractor/liveleak.py similarity index 100% rename from youtube_dl/extractor/liveleak.py rename to youtube_dlc/extractor/liveleak.py diff --git a/youtube_dl/extractor/livestream.py b/youtube_dlc/extractor/livestream.py similarity index 100% rename from youtube_dl/extractor/livestream.py rename to youtube_dlc/extractor/livestream.py diff --git a/youtube_dl/extractor/lnkgo.py b/youtube_dlc/extractor/lnkgo.py similarity index 100% rename from youtube_dl/extractor/lnkgo.py rename to youtube_dlc/extractor/lnkgo.py diff --git a/youtube_dl/extractor/localnews8.py b/youtube_dlc/extractor/localnews8.py similarity index 100% rename from youtube_dl/extractor/localnews8.py rename to youtube_dlc/extractor/localnews8.py diff --git a/youtube_dl/extractor/lovehomeporn.py b/youtube_dlc/extractor/lovehomeporn.py similarity index 100% rename from youtube_dl/extractor/lovehomeporn.py rename to youtube_dlc/extractor/lovehomeporn.py diff --git a/youtube_dl/extractor/lrt.py b/youtube_dlc/extractor/lrt.py similarity index 100% rename from youtube_dl/extractor/lrt.py rename to youtube_dlc/extractor/lrt.py diff --git a/youtube_dl/extractor/lynda.py b/youtube_dlc/extractor/lynda.py similarity index 100% rename from youtube_dl/extractor/lynda.py rename to youtube_dlc/extractor/lynda.py diff --git a/youtube_dl/extractor/m6.py b/youtube_dlc/extractor/m6.py similarity index 100% rename from youtube_dl/extractor/m6.py rename to youtube_dlc/extractor/m6.py diff --git a/youtube_dl/extractor/mailru.py b/youtube_dlc/extractor/mailru.py similarity index 100% rename from youtube_dl/extractor/mailru.py rename to youtube_dlc/extractor/mailru.py diff --git a/youtube_dl/extractor/malltv.py b/youtube_dlc/extractor/malltv.py similarity index 100% rename from youtube_dl/extractor/malltv.py rename to youtube_dlc/extractor/malltv.py diff --git a/youtube_dl/extractor/mangomolo.py b/youtube_dlc/extractor/mangomolo.py similarity index 100% rename from youtube_dl/extractor/mangomolo.py rename to youtube_dlc/extractor/mangomolo.py diff --git a/youtube_dl/extractor/manyvids.py b/youtube_dlc/extractor/manyvids.py similarity index 100% rename from youtube_dl/extractor/manyvids.py rename to youtube_dlc/extractor/manyvids.py diff --git a/youtube_dl/extractor/markiza.py b/youtube_dlc/extractor/markiza.py similarity index 100% rename from youtube_dl/extractor/markiza.py rename to youtube_dlc/extractor/markiza.py diff --git a/youtube_dl/extractor/massengeschmacktv.py b/youtube_dlc/extractor/massengeschmacktv.py similarity index 100% rename from youtube_dl/extractor/massengeschmacktv.py rename to youtube_dlc/extractor/massengeschmacktv.py diff --git a/youtube_dl/extractor/matchtv.py b/youtube_dlc/extractor/matchtv.py similarity index 100% rename from youtube_dl/extractor/matchtv.py rename to youtube_dlc/extractor/matchtv.py diff --git a/youtube_dl/extractor/mdr.py b/youtube_dlc/extractor/mdr.py similarity index 100% rename from youtube_dl/extractor/mdr.py rename to youtube_dlc/extractor/mdr.py diff --git a/youtube_dl/extractor/medialaan.py b/youtube_dlc/extractor/medialaan.py similarity index 100% rename from youtube_dl/extractor/medialaan.py rename to youtube_dlc/extractor/medialaan.py diff --git a/youtube_dl/extractor/mediaset.py b/youtube_dlc/extractor/mediaset.py similarity index 100% rename from youtube_dl/extractor/mediaset.py rename to youtube_dlc/extractor/mediaset.py diff --git a/youtube_dl/extractor/mediasite.py b/youtube_dlc/extractor/mediasite.py similarity index 100% rename from youtube_dl/extractor/mediasite.py rename to youtube_dlc/extractor/mediasite.py diff --git a/youtube_dl/extractor/medici.py b/youtube_dlc/extractor/medici.py similarity index 100% rename from youtube_dl/extractor/medici.py rename to youtube_dlc/extractor/medici.py diff --git a/youtube_dl/extractor/megaphone.py b/youtube_dlc/extractor/megaphone.py similarity index 100% rename from youtube_dl/extractor/megaphone.py rename to youtube_dlc/extractor/megaphone.py diff --git a/youtube_dl/extractor/meipai.py b/youtube_dlc/extractor/meipai.py similarity index 100% rename from youtube_dl/extractor/meipai.py rename to youtube_dlc/extractor/meipai.py diff --git a/youtube_dl/extractor/melonvod.py b/youtube_dlc/extractor/melonvod.py similarity index 100% rename from youtube_dl/extractor/melonvod.py rename to youtube_dlc/extractor/melonvod.py diff --git a/youtube_dl/extractor/meta.py b/youtube_dlc/extractor/meta.py similarity index 100% rename from youtube_dl/extractor/meta.py rename to youtube_dlc/extractor/meta.py diff --git a/youtube_dl/extractor/metacafe.py b/youtube_dlc/extractor/metacafe.py similarity index 100% rename from youtube_dl/extractor/metacafe.py rename to youtube_dlc/extractor/metacafe.py diff --git a/youtube_dl/extractor/metacritic.py b/youtube_dlc/extractor/metacritic.py similarity index 100% rename from youtube_dl/extractor/metacritic.py rename to youtube_dlc/extractor/metacritic.py diff --git a/youtube_dl/extractor/mgoon.py b/youtube_dlc/extractor/mgoon.py similarity index 100% rename from youtube_dl/extractor/mgoon.py rename to youtube_dlc/extractor/mgoon.py diff --git a/youtube_dl/extractor/mgtv.py b/youtube_dlc/extractor/mgtv.py similarity index 100% rename from youtube_dl/extractor/mgtv.py rename to youtube_dlc/extractor/mgtv.py diff --git a/youtube_dl/extractor/miaopai.py b/youtube_dlc/extractor/miaopai.py similarity index 100% rename from youtube_dl/extractor/miaopai.py rename to youtube_dlc/extractor/miaopai.py diff --git a/youtube_dl/extractor/microsoftvirtualacademy.py b/youtube_dlc/extractor/microsoftvirtualacademy.py similarity index 100% rename from youtube_dl/extractor/microsoftvirtualacademy.py rename to youtube_dlc/extractor/microsoftvirtualacademy.py diff --git a/youtube_dl/extractor/ministrygrid.py b/youtube_dlc/extractor/ministrygrid.py similarity index 100% rename from youtube_dl/extractor/ministrygrid.py rename to youtube_dlc/extractor/ministrygrid.py diff --git a/youtube_dl/extractor/minoto.py b/youtube_dlc/extractor/minoto.py similarity index 100% rename from youtube_dl/extractor/minoto.py rename to youtube_dlc/extractor/minoto.py diff --git a/youtube_dl/extractor/miomio.py b/youtube_dlc/extractor/miomio.py similarity index 100% rename from youtube_dl/extractor/miomio.py rename to youtube_dlc/extractor/miomio.py diff --git a/youtube_dl/extractor/mit.py b/youtube_dlc/extractor/mit.py similarity index 100% rename from youtube_dl/extractor/mit.py rename to youtube_dlc/extractor/mit.py diff --git a/youtube_dl/extractor/mitele.py b/youtube_dlc/extractor/mitele.py similarity index 100% rename from youtube_dl/extractor/mitele.py rename to youtube_dlc/extractor/mitele.py diff --git a/youtube_dl/extractor/mixcloud.py b/youtube_dlc/extractor/mixcloud.py similarity index 100% rename from youtube_dl/extractor/mixcloud.py rename to youtube_dlc/extractor/mixcloud.py diff --git a/youtube_dl/extractor/mlb.py b/youtube_dlc/extractor/mlb.py similarity index 100% rename from youtube_dl/extractor/mlb.py rename to youtube_dlc/extractor/mlb.py diff --git a/youtube_dl/extractor/mnet.py b/youtube_dlc/extractor/mnet.py similarity index 100% rename from youtube_dl/extractor/mnet.py rename to youtube_dlc/extractor/mnet.py diff --git a/youtube_dl/extractor/moevideo.py b/youtube_dlc/extractor/moevideo.py similarity index 100% rename from youtube_dl/extractor/moevideo.py rename to youtube_dlc/extractor/moevideo.py diff --git a/youtube_dl/extractor/mofosex.py b/youtube_dlc/extractor/mofosex.py similarity index 100% rename from youtube_dl/extractor/mofosex.py rename to youtube_dlc/extractor/mofosex.py diff --git a/youtube_dl/extractor/mojvideo.py b/youtube_dlc/extractor/mojvideo.py similarity index 100% rename from youtube_dl/extractor/mojvideo.py rename to youtube_dlc/extractor/mojvideo.py diff --git a/youtube_dl/extractor/morningstar.py b/youtube_dlc/extractor/morningstar.py similarity index 100% rename from youtube_dl/extractor/morningstar.py rename to youtube_dlc/extractor/morningstar.py diff --git a/youtube_dl/extractor/motherless.py b/youtube_dlc/extractor/motherless.py similarity index 100% rename from youtube_dl/extractor/motherless.py rename to youtube_dlc/extractor/motherless.py diff --git a/youtube_dl/extractor/motorsport.py b/youtube_dlc/extractor/motorsport.py similarity index 100% rename from youtube_dl/extractor/motorsport.py rename to youtube_dlc/extractor/motorsport.py diff --git a/youtube_dl/extractor/movieclips.py b/youtube_dlc/extractor/movieclips.py similarity index 100% rename from youtube_dl/extractor/movieclips.py rename to youtube_dlc/extractor/movieclips.py diff --git a/youtube_dl/extractor/moviezine.py b/youtube_dlc/extractor/moviezine.py similarity index 100% rename from youtube_dl/extractor/moviezine.py rename to youtube_dlc/extractor/moviezine.py diff --git a/youtube_dl/extractor/movingimage.py b/youtube_dlc/extractor/movingimage.py similarity index 100% rename from youtube_dl/extractor/movingimage.py rename to youtube_dlc/extractor/movingimage.py diff --git a/youtube_dl/extractor/msn.py b/youtube_dlc/extractor/msn.py similarity index 100% rename from youtube_dl/extractor/msn.py rename to youtube_dlc/extractor/msn.py diff --git a/youtube_dl/extractor/mtv.py b/youtube_dlc/extractor/mtv.py similarity index 100% rename from youtube_dl/extractor/mtv.py rename to youtube_dlc/extractor/mtv.py diff --git a/youtube_dl/extractor/muenchentv.py b/youtube_dlc/extractor/muenchentv.py similarity index 100% rename from youtube_dl/extractor/muenchentv.py rename to youtube_dlc/extractor/muenchentv.py diff --git a/youtube_dl/extractor/mwave.py b/youtube_dlc/extractor/mwave.py similarity index 100% rename from youtube_dl/extractor/mwave.py rename to youtube_dlc/extractor/mwave.py diff --git a/youtube_dl/extractor/mychannels.py b/youtube_dlc/extractor/mychannels.py similarity index 100% rename from youtube_dl/extractor/mychannels.py rename to youtube_dlc/extractor/mychannels.py diff --git a/youtube_dl/extractor/myspace.py b/youtube_dlc/extractor/myspace.py similarity index 100% rename from youtube_dl/extractor/myspace.py rename to youtube_dlc/extractor/myspace.py diff --git a/youtube_dl/extractor/myspass.py b/youtube_dlc/extractor/myspass.py similarity index 100% rename from youtube_dl/extractor/myspass.py rename to youtube_dlc/extractor/myspass.py diff --git a/youtube_dl/extractor/myvi.py b/youtube_dlc/extractor/myvi.py similarity index 100% rename from youtube_dl/extractor/myvi.py rename to youtube_dlc/extractor/myvi.py diff --git a/youtube_dl/extractor/myvidster.py b/youtube_dlc/extractor/myvidster.py similarity index 100% rename from youtube_dl/extractor/myvidster.py rename to youtube_dlc/extractor/myvidster.py diff --git a/youtube_dl/extractor/nationalgeographic.py b/youtube_dlc/extractor/nationalgeographic.py similarity index 100% rename from youtube_dl/extractor/nationalgeographic.py rename to youtube_dlc/extractor/nationalgeographic.py diff --git a/youtube_dl/extractor/naver.py b/youtube_dlc/extractor/naver.py similarity index 100% rename from youtube_dl/extractor/naver.py rename to youtube_dlc/extractor/naver.py diff --git a/youtube_dl/extractor/nba.py b/youtube_dlc/extractor/nba.py similarity index 100% rename from youtube_dl/extractor/nba.py rename to youtube_dlc/extractor/nba.py diff --git a/youtube_dl/extractor/nbc.py b/youtube_dlc/extractor/nbc.py similarity index 100% rename from youtube_dl/extractor/nbc.py rename to youtube_dlc/extractor/nbc.py diff --git a/youtube_dl/extractor/ndr.py b/youtube_dlc/extractor/ndr.py similarity index 100% rename from youtube_dl/extractor/ndr.py rename to youtube_dlc/extractor/ndr.py diff --git a/youtube_dl/extractor/ndtv.py b/youtube_dlc/extractor/ndtv.py similarity index 100% rename from youtube_dl/extractor/ndtv.py rename to youtube_dlc/extractor/ndtv.py diff --git a/youtube_dl/extractor/nerdcubed.py b/youtube_dlc/extractor/nerdcubed.py similarity index 100% rename from youtube_dl/extractor/nerdcubed.py rename to youtube_dlc/extractor/nerdcubed.py diff --git a/youtube_dl/extractor/neteasemusic.py b/youtube_dlc/extractor/neteasemusic.py similarity index 100% rename from youtube_dl/extractor/neteasemusic.py rename to youtube_dlc/extractor/neteasemusic.py diff --git a/youtube_dl/extractor/netzkino.py b/youtube_dlc/extractor/netzkino.py similarity index 100% rename from youtube_dl/extractor/netzkino.py rename to youtube_dlc/extractor/netzkino.py diff --git a/youtube_dl/extractor/newgrounds.py b/youtube_dlc/extractor/newgrounds.py similarity index 100% rename from youtube_dl/extractor/newgrounds.py rename to youtube_dlc/extractor/newgrounds.py diff --git a/youtube_dl/extractor/newstube.py b/youtube_dlc/extractor/newstube.py similarity index 100% rename from youtube_dl/extractor/newstube.py rename to youtube_dlc/extractor/newstube.py diff --git a/youtube_dl/extractor/nextmedia.py b/youtube_dlc/extractor/nextmedia.py similarity index 100% rename from youtube_dl/extractor/nextmedia.py rename to youtube_dlc/extractor/nextmedia.py diff --git a/youtube_dl/extractor/nexx.py b/youtube_dlc/extractor/nexx.py similarity index 100% rename from youtube_dl/extractor/nexx.py rename to youtube_dlc/extractor/nexx.py diff --git a/youtube_dl/extractor/nfl.py b/youtube_dlc/extractor/nfl.py similarity index 100% rename from youtube_dl/extractor/nfl.py rename to youtube_dlc/extractor/nfl.py diff --git a/youtube_dl/extractor/nhk.py b/youtube_dlc/extractor/nhk.py similarity index 100% rename from youtube_dl/extractor/nhk.py rename to youtube_dlc/extractor/nhk.py diff --git a/youtube_dl/extractor/nhl.py b/youtube_dlc/extractor/nhl.py similarity index 100% rename from youtube_dl/extractor/nhl.py rename to youtube_dlc/extractor/nhl.py diff --git a/youtube_dl/extractor/nick.py b/youtube_dlc/extractor/nick.py similarity index 100% rename from youtube_dl/extractor/nick.py rename to youtube_dlc/extractor/nick.py diff --git a/youtube_dl/extractor/niconico.py b/youtube_dlc/extractor/niconico.py similarity index 100% rename from youtube_dl/extractor/niconico.py rename to youtube_dlc/extractor/niconico.py diff --git a/youtube_dl/extractor/ninecninemedia.py b/youtube_dlc/extractor/ninecninemedia.py similarity index 100% rename from youtube_dl/extractor/ninecninemedia.py rename to youtube_dlc/extractor/ninecninemedia.py diff --git a/youtube_dl/extractor/ninegag.py b/youtube_dlc/extractor/ninegag.py similarity index 100% rename from youtube_dl/extractor/ninegag.py rename to youtube_dlc/extractor/ninegag.py diff --git a/youtube_dl/extractor/ninenow.py b/youtube_dlc/extractor/ninenow.py similarity index 100% rename from youtube_dl/extractor/ninenow.py rename to youtube_dlc/extractor/ninenow.py diff --git a/youtube_dl/extractor/nintendo.py b/youtube_dlc/extractor/nintendo.py similarity index 100% rename from youtube_dl/extractor/nintendo.py rename to youtube_dlc/extractor/nintendo.py diff --git a/youtube_dl/extractor/njpwworld.py b/youtube_dlc/extractor/njpwworld.py similarity index 100% rename from youtube_dl/extractor/njpwworld.py rename to youtube_dlc/extractor/njpwworld.py diff --git a/youtube_dl/extractor/nobelprize.py b/youtube_dlc/extractor/nobelprize.py similarity index 100% rename from youtube_dl/extractor/nobelprize.py rename to youtube_dlc/extractor/nobelprize.py diff --git a/youtube_dl/extractor/noco.py b/youtube_dlc/extractor/noco.py similarity index 100% rename from youtube_dl/extractor/noco.py rename to youtube_dlc/extractor/noco.py diff --git a/youtube_dl/extractor/nonktube.py b/youtube_dlc/extractor/nonktube.py similarity index 100% rename from youtube_dl/extractor/nonktube.py rename to youtube_dlc/extractor/nonktube.py diff --git a/youtube_dl/extractor/noovo.py b/youtube_dlc/extractor/noovo.py similarity index 100% rename from youtube_dl/extractor/noovo.py rename to youtube_dlc/extractor/noovo.py diff --git a/youtube_dl/extractor/normalboots.py b/youtube_dlc/extractor/normalboots.py similarity index 100% rename from youtube_dl/extractor/normalboots.py rename to youtube_dlc/extractor/normalboots.py diff --git a/youtube_dl/extractor/nosvideo.py b/youtube_dlc/extractor/nosvideo.py similarity index 100% rename from youtube_dl/extractor/nosvideo.py rename to youtube_dlc/extractor/nosvideo.py diff --git a/youtube_dl/extractor/nova.py b/youtube_dlc/extractor/nova.py similarity index 100% rename from youtube_dl/extractor/nova.py rename to youtube_dlc/extractor/nova.py diff --git a/youtube_dl/extractor/nowness.py b/youtube_dlc/extractor/nowness.py similarity index 98% rename from youtube_dl/extractor/nowness.py rename to youtube_dlc/extractor/nowness.py index f26dafb8f..c136bc8c0 100644 --- a/youtube_dl/extractor/nowness.py +++ b/youtube_dlc/extractor/nowness.py @@ -37,7 +37,7 @@ class NownessBaseIE(InfoExtractor): elif source == 'youtube': return self.url_result(video_id, 'Youtube') elif source == 'cinematique': - # youtube-dl currently doesn't support cinematique + # youtube-dlc currently doesn't support cinematique # return self.url_result('http://cinematique.com/embed/%s' % video_id, 'Cinematique') pass diff --git a/youtube_dl/extractor/noz.py b/youtube_dlc/extractor/noz.py similarity index 100% rename from youtube_dl/extractor/noz.py rename to youtube_dlc/extractor/noz.py diff --git a/youtube_dl/extractor/npo.py b/youtube_dlc/extractor/npo.py similarity index 100% rename from youtube_dl/extractor/npo.py rename to youtube_dlc/extractor/npo.py diff --git a/youtube_dl/extractor/npr.py b/youtube_dlc/extractor/npr.py similarity index 100% rename from youtube_dl/extractor/npr.py rename to youtube_dlc/extractor/npr.py diff --git a/youtube_dl/extractor/nrk.py b/youtube_dlc/extractor/nrk.py similarity index 100% rename from youtube_dl/extractor/nrk.py rename to youtube_dlc/extractor/nrk.py diff --git a/youtube_dl/extractor/nrl.py b/youtube_dlc/extractor/nrl.py similarity index 100% rename from youtube_dl/extractor/nrl.py rename to youtube_dlc/extractor/nrl.py diff --git a/youtube_dl/extractor/ntvcojp.py b/youtube_dlc/extractor/ntvcojp.py similarity index 100% rename from youtube_dl/extractor/ntvcojp.py rename to youtube_dlc/extractor/ntvcojp.py diff --git a/youtube_dl/extractor/ntvde.py b/youtube_dlc/extractor/ntvde.py similarity index 100% rename from youtube_dl/extractor/ntvde.py rename to youtube_dlc/extractor/ntvde.py diff --git a/youtube_dl/extractor/ntvru.py b/youtube_dlc/extractor/ntvru.py similarity index 100% rename from youtube_dl/extractor/ntvru.py rename to youtube_dlc/extractor/ntvru.py diff --git a/youtube_dl/extractor/nuevo.py b/youtube_dlc/extractor/nuevo.py similarity index 100% rename from youtube_dl/extractor/nuevo.py rename to youtube_dlc/extractor/nuevo.py diff --git a/youtube_dl/extractor/nuvid.py b/youtube_dlc/extractor/nuvid.py similarity index 100% rename from youtube_dl/extractor/nuvid.py rename to youtube_dlc/extractor/nuvid.py diff --git a/youtube_dl/extractor/nytimes.py b/youtube_dlc/extractor/nytimes.py similarity index 100% rename from youtube_dl/extractor/nytimes.py rename to youtube_dlc/extractor/nytimes.py diff --git a/youtube_dl/extractor/nzz.py b/youtube_dlc/extractor/nzz.py similarity index 100% rename from youtube_dl/extractor/nzz.py rename to youtube_dlc/extractor/nzz.py diff --git a/youtube_dl/extractor/odatv.py b/youtube_dlc/extractor/odatv.py similarity index 100% rename from youtube_dl/extractor/odatv.py rename to youtube_dlc/extractor/odatv.py diff --git a/youtube_dl/extractor/odnoklassniki.py b/youtube_dlc/extractor/odnoklassniki.py similarity index 100% rename from youtube_dl/extractor/odnoklassniki.py rename to youtube_dlc/extractor/odnoklassniki.py diff --git a/youtube_dl/extractor/oktoberfesttv.py b/youtube_dlc/extractor/oktoberfesttv.py similarity index 100% rename from youtube_dl/extractor/oktoberfesttv.py rename to youtube_dlc/extractor/oktoberfesttv.py diff --git a/youtube_dl/extractor/once.py b/youtube_dlc/extractor/once.py similarity index 100% rename from youtube_dl/extractor/once.py rename to youtube_dlc/extractor/once.py diff --git a/youtube_dl/extractor/ondemandkorea.py b/youtube_dlc/extractor/ondemandkorea.py similarity index 100% rename from youtube_dl/extractor/ondemandkorea.py rename to youtube_dlc/extractor/ondemandkorea.py diff --git a/youtube_dl/extractor/onet.py b/youtube_dlc/extractor/onet.py similarity index 100% rename from youtube_dl/extractor/onet.py rename to youtube_dlc/extractor/onet.py diff --git a/youtube_dl/extractor/onionstudios.py b/youtube_dlc/extractor/onionstudios.py similarity index 100% rename from youtube_dl/extractor/onionstudios.py rename to youtube_dlc/extractor/onionstudios.py diff --git a/youtube_dl/extractor/ooyala.py b/youtube_dlc/extractor/ooyala.py similarity index 100% rename from youtube_dl/extractor/ooyala.py rename to youtube_dlc/extractor/ooyala.py diff --git a/youtube_dl/extractor/openload.py b/youtube_dlc/extractor/openload.py similarity index 100% rename from youtube_dl/extractor/openload.py rename to youtube_dlc/extractor/openload.py diff --git a/youtube_dl/extractor/ora.py b/youtube_dlc/extractor/ora.py similarity index 100% rename from youtube_dl/extractor/ora.py rename to youtube_dlc/extractor/ora.py diff --git a/youtube_dl/extractor/orf.py b/youtube_dlc/extractor/orf.py similarity index 100% rename from youtube_dl/extractor/orf.py rename to youtube_dlc/extractor/orf.py diff --git a/youtube_dl/extractor/outsidetv.py b/youtube_dlc/extractor/outsidetv.py similarity index 100% rename from youtube_dl/extractor/outsidetv.py rename to youtube_dlc/extractor/outsidetv.py diff --git a/youtube_dl/extractor/packtpub.py b/youtube_dlc/extractor/packtpub.py similarity index 100% rename from youtube_dl/extractor/packtpub.py rename to youtube_dlc/extractor/packtpub.py diff --git a/youtube_dl/extractor/pandoratv.py b/youtube_dlc/extractor/pandoratv.py similarity index 100% rename from youtube_dl/extractor/pandoratv.py rename to youtube_dlc/extractor/pandoratv.py diff --git a/youtube_dl/extractor/parliamentliveuk.py b/youtube_dlc/extractor/parliamentliveuk.py similarity index 100% rename from youtube_dl/extractor/parliamentliveuk.py rename to youtube_dlc/extractor/parliamentliveuk.py diff --git a/youtube_dl/extractor/patreon.py b/youtube_dlc/extractor/patreon.py similarity index 100% rename from youtube_dl/extractor/patreon.py rename to youtube_dlc/extractor/patreon.py diff --git a/youtube_dl/extractor/pbs.py b/youtube_dlc/extractor/pbs.py similarity index 100% rename from youtube_dl/extractor/pbs.py rename to youtube_dlc/extractor/pbs.py diff --git a/youtube_dl/extractor/pearvideo.py b/youtube_dlc/extractor/pearvideo.py similarity index 100% rename from youtube_dl/extractor/pearvideo.py rename to youtube_dlc/extractor/pearvideo.py diff --git a/youtube_dl/extractor/peertube.py b/youtube_dlc/extractor/peertube.py similarity index 100% rename from youtube_dl/extractor/peertube.py rename to youtube_dlc/extractor/peertube.py diff --git a/youtube_dl/extractor/people.py b/youtube_dlc/extractor/people.py similarity index 100% rename from youtube_dl/extractor/people.py rename to youtube_dlc/extractor/people.py diff --git a/youtube_dl/extractor/performgroup.py b/youtube_dlc/extractor/performgroup.py similarity index 100% rename from youtube_dl/extractor/performgroup.py rename to youtube_dlc/extractor/performgroup.py diff --git a/youtube_dl/extractor/periscope.py b/youtube_dlc/extractor/periscope.py similarity index 100% rename from youtube_dl/extractor/periscope.py rename to youtube_dlc/extractor/periscope.py diff --git a/youtube_dl/extractor/philharmoniedeparis.py b/youtube_dlc/extractor/philharmoniedeparis.py similarity index 100% rename from youtube_dl/extractor/philharmoniedeparis.py rename to youtube_dlc/extractor/philharmoniedeparis.py diff --git a/youtube_dl/extractor/phoenix.py b/youtube_dlc/extractor/phoenix.py similarity index 100% rename from youtube_dl/extractor/phoenix.py rename to youtube_dlc/extractor/phoenix.py diff --git a/youtube_dl/extractor/photobucket.py b/youtube_dlc/extractor/photobucket.py similarity index 100% rename from youtube_dl/extractor/photobucket.py rename to youtube_dlc/extractor/photobucket.py diff --git a/youtube_dl/extractor/picarto.py b/youtube_dlc/extractor/picarto.py similarity index 100% rename from youtube_dl/extractor/picarto.py rename to youtube_dlc/extractor/picarto.py diff --git a/youtube_dl/extractor/piksel.py b/youtube_dlc/extractor/piksel.py similarity index 100% rename from youtube_dl/extractor/piksel.py rename to youtube_dlc/extractor/piksel.py diff --git a/youtube_dl/extractor/pinkbike.py b/youtube_dlc/extractor/pinkbike.py similarity index 100% rename from youtube_dl/extractor/pinkbike.py rename to youtube_dlc/extractor/pinkbike.py diff --git a/youtube_dl/extractor/pladform.py b/youtube_dlc/extractor/pladform.py similarity index 100% rename from youtube_dl/extractor/pladform.py rename to youtube_dlc/extractor/pladform.py diff --git a/youtube_dl/extractor/platzi.py b/youtube_dlc/extractor/platzi.py similarity index 100% rename from youtube_dl/extractor/platzi.py rename to youtube_dlc/extractor/platzi.py diff --git a/youtube_dl/extractor/playfm.py b/youtube_dlc/extractor/playfm.py similarity index 100% rename from youtube_dl/extractor/playfm.py rename to youtube_dlc/extractor/playfm.py diff --git a/youtube_dl/extractor/playplustv.py b/youtube_dlc/extractor/playplustv.py similarity index 100% rename from youtube_dl/extractor/playplustv.py rename to youtube_dlc/extractor/playplustv.py diff --git a/youtube_dl/extractor/plays.py b/youtube_dlc/extractor/plays.py similarity index 100% rename from youtube_dl/extractor/plays.py rename to youtube_dlc/extractor/plays.py diff --git a/youtube_dl/extractor/playtvak.py b/youtube_dlc/extractor/playtvak.py similarity index 100% rename from youtube_dl/extractor/playtvak.py rename to youtube_dlc/extractor/playtvak.py diff --git a/youtube_dl/extractor/playvid.py b/youtube_dlc/extractor/playvid.py similarity index 100% rename from youtube_dl/extractor/playvid.py rename to youtube_dlc/extractor/playvid.py diff --git a/youtube_dl/extractor/playwire.py b/youtube_dlc/extractor/playwire.py similarity index 100% rename from youtube_dl/extractor/playwire.py rename to youtube_dlc/extractor/playwire.py diff --git a/youtube_dl/extractor/pluralsight.py b/youtube_dlc/extractor/pluralsight.py similarity index 100% rename from youtube_dl/extractor/pluralsight.py rename to youtube_dlc/extractor/pluralsight.py diff --git a/youtube_dl/extractor/podomatic.py b/youtube_dlc/extractor/podomatic.py similarity index 100% rename from youtube_dl/extractor/podomatic.py rename to youtube_dlc/extractor/podomatic.py diff --git a/youtube_dl/extractor/pokemon.py b/youtube_dlc/extractor/pokemon.py similarity index 100% rename from youtube_dl/extractor/pokemon.py rename to youtube_dlc/extractor/pokemon.py diff --git a/youtube_dl/extractor/polskieradio.py b/youtube_dlc/extractor/polskieradio.py similarity index 100% rename from youtube_dl/extractor/polskieradio.py rename to youtube_dlc/extractor/polskieradio.py diff --git a/youtube_dl/extractor/popcorntimes.py b/youtube_dlc/extractor/popcorntimes.py similarity index 100% rename from youtube_dl/extractor/popcorntimes.py rename to youtube_dlc/extractor/popcorntimes.py diff --git a/youtube_dl/extractor/popcorntv.py b/youtube_dlc/extractor/popcorntv.py similarity index 100% rename from youtube_dl/extractor/popcorntv.py rename to youtube_dlc/extractor/popcorntv.py diff --git a/youtube_dl/extractor/porn91.py b/youtube_dlc/extractor/porn91.py similarity index 100% rename from youtube_dl/extractor/porn91.py rename to youtube_dlc/extractor/porn91.py diff --git a/youtube_dl/extractor/porncom.py b/youtube_dlc/extractor/porncom.py similarity index 100% rename from youtube_dl/extractor/porncom.py rename to youtube_dlc/extractor/porncom.py diff --git a/youtube_dl/extractor/pornhd.py b/youtube_dlc/extractor/pornhd.py similarity index 100% rename from youtube_dl/extractor/pornhd.py rename to youtube_dlc/extractor/pornhd.py diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dlc/extractor/pornhub.py similarity index 100% rename from youtube_dl/extractor/pornhub.py rename to youtube_dlc/extractor/pornhub.py diff --git a/youtube_dl/extractor/pornotube.py b/youtube_dlc/extractor/pornotube.py similarity index 100% rename from youtube_dl/extractor/pornotube.py rename to youtube_dlc/extractor/pornotube.py diff --git a/youtube_dl/extractor/pornovoisines.py b/youtube_dlc/extractor/pornovoisines.py similarity index 100% rename from youtube_dl/extractor/pornovoisines.py rename to youtube_dlc/extractor/pornovoisines.py diff --git a/youtube_dl/extractor/pornoxo.py b/youtube_dlc/extractor/pornoxo.py similarity index 100% rename from youtube_dl/extractor/pornoxo.py rename to youtube_dlc/extractor/pornoxo.py diff --git a/youtube_dl/extractor/presstv.py b/youtube_dlc/extractor/presstv.py similarity index 100% rename from youtube_dl/extractor/presstv.py rename to youtube_dlc/extractor/presstv.py diff --git a/youtube_dl/extractor/prosiebensat1.py b/youtube_dlc/extractor/prosiebensat1.py similarity index 100% rename from youtube_dl/extractor/prosiebensat1.py rename to youtube_dlc/extractor/prosiebensat1.py diff --git a/youtube_dl/extractor/puhutv.py b/youtube_dlc/extractor/puhutv.py similarity index 100% rename from youtube_dl/extractor/puhutv.py rename to youtube_dlc/extractor/puhutv.py diff --git a/youtube_dl/extractor/puls4.py b/youtube_dlc/extractor/puls4.py similarity index 100% rename from youtube_dl/extractor/puls4.py rename to youtube_dlc/extractor/puls4.py diff --git a/youtube_dl/extractor/pyvideo.py b/youtube_dlc/extractor/pyvideo.py similarity index 100% rename from youtube_dl/extractor/pyvideo.py rename to youtube_dlc/extractor/pyvideo.py diff --git a/youtube_dl/extractor/qqmusic.py b/youtube_dlc/extractor/qqmusic.py similarity index 100% rename from youtube_dl/extractor/qqmusic.py rename to youtube_dlc/extractor/qqmusic.py diff --git a/youtube_dl/extractor/r7.py b/youtube_dlc/extractor/r7.py similarity index 100% rename from youtube_dl/extractor/r7.py rename to youtube_dlc/extractor/r7.py diff --git a/youtube_dl/extractor/radiobremen.py b/youtube_dlc/extractor/radiobremen.py similarity index 100% rename from youtube_dl/extractor/radiobremen.py rename to youtube_dlc/extractor/radiobremen.py diff --git a/youtube_dl/extractor/radiocanada.py b/youtube_dlc/extractor/radiocanada.py similarity index 100% rename from youtube_dl/extractor/radiocanada.py rename to youtube_dlc/extractor/radiocanada.py diff --git a/youtube_dl/extractor/radiode.py b/youtube_dlc/extractor/radiode.py similarity index 100% rename from youtube_dl/extractor/radiode.py rename to youtube_dlc/extractor/radiode.py diff --git a/youtube_dl/extractor/radiofrance.py b/youtube_dlc/extractor/radiofrance.py similarity index 100% rename from youtube_dl/extractor/radiofrance.py rename to youtube_dlc/extractor/radiofrance.py diff --git a/youtube_dl/extractor/radiojavan.py b/youtube_dlc/extractor/radiojavan.py similarity index 100% rename from youtube_dl/extractor/radiojavan.py rename to youtube_dlc/extractor/radiojavan.py diff --git a/youtube_dl/extractor/rai.py b/youtube_dlc/extractor/rai.py similarity index 100% rename from youtube_dl/extractor/rai.py rename to youtube_dlc/extractor/rai.py diff --git a/youtube_dl/extractor/raywenderlich.py b/youtube_dlc/extractor/raywenderlich.py similarity index 100% rename from youtube_dl/extractor/raywenderlich.py rename to youtube_dlc/extractor/raywenderlich.py diff --git a/youtube_dl/extractor/rbmaradio.py b/youtube_dlc/extractor/rbmaradio.py similarity index 100% rename from youtube_dl/extractor/rbmaradio.py rename to youtube_dlc/extractor/rbmaradio.py diff --git a/youtube_dl/extractor/rds.py b/youtube_dlc/extractor/rds.py similarity index 100% rename from youtube_dl/extractor/rds.py rename to youtube_dlc/extractor/rds.py diff --git a/youtube_dl/extractor/redbulltv.py b/youtube_dlc/extractor/redbulltv.py similarity index 100% rename from youtube_dl/extractor/redbulltv.py rename to youtube_dlc/extractor/redbulltv.py diff --git a/youtube_dl/extractor/reddit.py b/youtube_dlc/extractor/reddit.py similarity index 100% rename from youtube_dl/extractor/reddit.py rename to youtube_dlc/extractor/reddit.py diff --git a/youtube_dl/extractor/redtube.py b/youtube_dlc/extractor/redtube.py similarity index 100% rename from youtube_dl/extractor/redtube.py rename to youtube_dlc/extractor/redtube.py diff --git a/youtube_dl/extractor/regiotv.py b/youtube_dlc/extractor/regiotv.py similarity index 100% rename from youtube_dl/extractor/regiotv.py rename to youtube_dlc/extractor/regiotv.py diff --git a/youtube_dl/extractor/rentv.py b/youtube_dlc/extractor/rentv.py similarity index 100% rename from youtube_dl/extractor/rentv.py rename to youtube_dlc/extractor/rentv.py diff --git a/youtube_dl/extractor/restudy.py b/youtube_dlc/extractor/restudy.py similarity index 100% rename from youtube_dl/extractor/restudy.py rename to youtube_dlc/extractor/restudy.py diff --git a/youtube_dl/extractor/reuters.py b/youtube_dlc/extractor/reuters.py similarity index 100% rename from youtube_dl/extractor/reuters.py rename to youtube_dlc/extractor/reuters.py diff --git a/youtube_dl/extractor/reverbnation.py b/youtube_dlc/extractor/reverbnation.py similarity index 100% rename from youtube_dl/extractor/reverbnation.py rename to youtube_dlc/extractor/reverbnation.py diff --git a/youtube_dl/extractor/rice.py b/youtube_dlc/extractor/rice.py similarity index 100% rename from youtube_dl/extractor/rice.py rename to youtube_dlc/extractor/rice.py diff --git a/youtube_dl/extractor/rmcdecouverte.py b/youtube_dlc/extractor/rmcdecouverte.py similarity index 100% rename from youtube_dl/extractor/rmcdecouverte.py rename to youtube_dlc/extractor/rmcdecouverte.py diff --git a/youtube_dl/extractor/ro220.py b/youtube_dlc/extractor/ro220.py similarity index 100% rename from youtube_dl/extractor/ro220.py rename to youtube_dlc/extractor/ro220.py diff --git a/youtube_dl/extractor/rockstargames.py b/youtube_dlc/extractor/rockstargames.py similarity index 100% rename from youtube_dl/extractor/rockstargames.py rename to youtube_dlc/extractor/rockstargames.py diff --git a/youtube_dl/extractor/roosterteeth.py b/youtube_dlc/extractor/roosterteeth.py similarity index 100% rename from youtube_dl/extractor/roosterteeth.py rename to youtube_dlc/extractor/roosterteeth.py diff --git a/youtube_dl/extractor/rottentomatoes.py b/youtube_dlc/extractor/rottentomatoes.py similarity index 100% rename from youtube_dl/extractor/rottentomatoes.py rename to youtube_dlc/extractor/rottentomatoes.py diff --git a/youtube_dl/extractor/roxwel.py b/youtube_dlc/extractor/roxwel.py similarity index 100% rename from youtube_dl/extractor/roxwel.py rename to youtube_dlc/extractor/roxwel.py diff --git a/youtube_dl/extractor/rozhlas.py b/youtube_dlc/extractor/rozhlas.py similarity index 100% rename from youtube_dl/extractor/rozhlas.py rename to youtube_dlc/extractor/rozhlas.py diff --git a/youtube_dl/extractor/rtbf.py b/youtube_dlc/extractor/rtbf.py similarity index 100% rename from youtube_dl/extractor/rtbf.py rename to youtube_dlc/extractor/rtbf.py diff --git a/youtube_dl/extractor/rte.py b/youtube_dlc/extractor/rte.py similarity index 100% rename from youtube_dl/extractor/rte.py rename to youtube_dlc/extractor/rte.py diff --git a/youtube_dl/extractor/rtl2.py b/youtube_dlc/extractor/rtl2.py similarity index 100% rename from youtube_dl/extractor/rtl2.py rename to youtube_dlc/extractor/rtl2.py diff --git a/youtube_dl/extractor/rtlnl.py b/youtube_dlc/extractor/rtlnl.py similarity index 100% rename from youtube_dl/extractor/rtlnl.py rename to youtube_dlc/extractor/rtlnl.py diff --git a/youtube_dl/extractor/rtp.py b/youtube_dlc/extractor/rtp.py similarity index 100% rename from youtube_dl/extractor/rtp.py rename to youtube_dlc/extractor/rtp.py diff --git a/youtube_dl/extractor/rts.py b/youtube_dlc/extractor/rts.py similarity index 100% rename from youtube_dl/extractor/rts.py rename to youtube_dlc/extractor/rts.py diff --git a/youtube_dl/extractor/rtve.py b/youtube_dlc/extractor/rtve.py similarity index 100% rename from youtube_dl/extractor/rtve.py rename to youtube_dlc/extractor/rtve.py diff --git a/youtube_dl/extractor/rtvnh.py b/youtube_dlc/extractor/rtvnh.py similarity index 100% rename from youtube_dl/extractor/rtvnh.py rename to youtube_dlc/extractor/rtvnh.py diff --git a/youtube_dl/extractor/rtvs.py b/youtube_dlc/extractor/rtvs.py similarity index 100% rename from youtube_dl/extractor/rtvs.py rename to youtube_dlc/extractor/rtvs.py diff --git a/youtube_dl/extractor/ruhd.py b/youtube_dlc/extractor/ruhd.py similarity index 100% rename from youtube_dl/extractor/ruhd.py rename to youtube_dlc/extractor/ruhd.py diff --git a/youtube_dl/extractor/rutube.py b/youtube_dlc/extractor/rutube.py similarity index 100% rename from youtube_dl/extractor/rutube.py rename to youtube_dlc/extractor/rutube.py diff --git a/youtube_dl/extractor/rutv.py b/youtube_dlc/extractor/rutv.py similarity index 100% rename from youtube_dl/extractor/rutv.py rename to youtube_dlc/extractor/rutv.py diff --git a/youtube_dl/extractor/ruutu.py b/youtube_dlc/extractor/ruutu.py similarity index 100% rename from youtube_dl/extractor/ruutu.py rename to youtube_dlc/extractor/ruutu.py diff --git a/youtube_dl/extractor/ruv.py b/youtube_dlc/extractor/ruv.py similarity index 100% rename from youtube_dl/extractor/ruv.py rename to youtube_dlc/extractor/ruv.py diff --git a/youtube_dl/extractor/safari.py b/youtube_dlc/extractor/safari.py similarity index 100% rename from youtube_dl/extractor/safari.py rename to youtube_dlc/extractor/safari.py diff --git a/youtube_dl/extractor/sapo.py b/youtube_dlc/extractor/sapo.py similarity index 100% rename from youtube_dl/extractor/sapo.py rename to youtube_dlc/extractor/sapo.py diff --git a/youtube_dl/extractor/savefrom.py b/youtube_dlc/extractor/savefrom.py similarity index 100% rename from youtube_dl/extractor/savefrom.py rename to youtube_dlc/extractor/savefrom.py diff --git a/youtube_dl/extractor/sbs.py b/youtube_dlc/extractor/sbs.py similarity index 100% rename from youtube_dl/extractor/sbs.py rename to youtube_dlc/extractor/sbs.py diff --git a/youtube_dl/extractor/screencast.py b/youtube_dlc/extractor/screencast.py similarity index 100% rename from youtube_dl/extractor/screencast.py rename to youtube_dlc/extractor/screencast.py diff --git a/youtube_dl/extractor/screencastomatic.py b/youtube_dlc/extractor/screencastomatic.py similarity index 100% rename from youtube_dl/extractor/screencastomatic.py rename to youtube_dlc/extractor/screencastomatic.py diff --git a/youtube_dl/extractor/scrippsnetworks.py b/youtube_dlc/extractor/scrippsnetworks.py similarity index 100% rename from youtube_dl/extractor/scrippsnetworks.py rename to youtube_dlc/extractor/scrippsnetworks.py diff --git a/youtube_dl/extractor/scte.py b/youtube_dlc/extractor/scte.py similarity index 100% rename from youtube_dl/extractor/scte.py rename to youtube_dlc/extractor/scte.py diff --git a/youtube_dl/extractor/seeker.py b/youtube_dlc/extractor/seeker.py similarity index 100% rename from youtube_dl/extractor/seeker.py rename to youtube_dlc/extractor/seeker.py diff --git a/youtube_dl/extractor/senateisvp.py b/youtube_dlc/extractor/senateisvp.py similarity index 100% rename from youtube_dl/extractor/senateisvp.py rename to youtube_dlc/extractor/senateisvp.py diff --git a/youtube_dl/extractor/sendtonews.py b/youtube_dlc/extractor/sendtonews.py similarity index 100% rename from youtube_dl/extractor/sendtonews.py rename to youtube_dlc/extractor/sendtonews.py diff --git a/youtube_dl/extractor/servus.py b/youtube_dlc/extractor/servus.py similarity index 100% rename from youtube_dl/extractor/servus.py rename to youtube_dlc/extractor/servus.py diff --git a/youtube_dl/extractor/sevenplus.py b/youtube_dlc/extractor/sevenplus.py similarity index 100% rename from youtube_dl/extractor/sevenplus.py rename to youtube_dlc/extractor/sevenplus.py diff --git a/youtube_dl/extractor/sexu.py b/youtube_dlc/extractor/sexu.py similarity index 100% rename from youtube_dl/extractor/sexu.py rename to youtube_dlc/extractor/sexu.py diff --git a/youtube_dl/extractor/seznamzpravy.py b/youtube_dlc/extractor/seznamzpravy.py similarity index 100% rename from youtube_dl/extractor/seznamzpravy.py rename to youtube_dlc/extractor/seznamzpravy.py diff --git a/youtube_dl/extractor/shahid.py b/youtube_dlc/extractor/shahid.py similarity index 100% rename from youtube_dl/extractor/shahid.py rename to youtube_dlc/extractor/shahid.py diff --git a/youtube_dl/extractor/shared.py b/youtube_dlc/extractor/shared.py similarity index 100% rename from youtube_dl/extractor/shared.py rename to youtube_dlc/extractor/shared.py diff --git a/youtube_dl/extractor/showroomlive.py b/youtube_dlc/extractor/showroomlive.py similarity index 100% rename from youtube_dl/extractor/showroomlive.py rename to youtube_dlc/extractor/showroomlive.py diff --git a/youtube_dl/extractor/sina.py b/youtube_dlc/extractor/sina.py similarity index 100% rename from youtube_dl/extractor/sina.py rename to youtube_dlc/extractor/sina.py diff --git a/youtube_dl/extractor/sixplay.py b/youtube_dlc/extractor/sixplay.py similarity index 100% rename from youtube_dl/extractor/sixplay.py rename to youtube_dlc/extractor/sixplay.py diff --git a/youtube_dl/extractor/sky.py b/youtube_dlc/extractor/sky.py similarity index 100% rename from youtube_dl/extractor/sky.py rename to youtube_dlc/extractor/sky.py diff --git a/youtube_dl/extractor/skylinewebcams.py b/youtube_dlc/extractor/skylinewebcams.py similarity index 100% rename from youtube_dl/extractor/skylinewebcams.py rename to youtube_dlc/extractor/skylinewebcams.py diff --git a/youtube_dl/extractor/skynewsarabia.py b/youtube_dlc/extractor/skynewsarabia.py similarity index 100% rename from youtube_dl/extractor/skynewsarabia.py rename to youtube_dlc/extractor/skynewsarabia.py diff --git a/youtube_dl/extractor/slideshare.py b/youtube_dlc/extractor/slideshare.py similarity index 100% rename from youtube_dl/extractor/slideshare.py rename to youtube_dlc/extractor/slideshare.py diff --git a/youtube_dl/extractor/slideslive.py b/youtube_dlc/extractor/slideslive.py similarity index 100% rename from youtube_dl/extractor/slideslive.py rename to youtube_dlc/extractor/slideslive.py diff --git a/youtube_dl/extractor/slutload.py b/youtube_dlc/extractor/slutload.py similarity index 100% rename from youtube_dl/extractor/slutload.py rename to youtube_dlc/extractor/slutload.py diff --git a/youtube_dl/extractor/smotri.py b/youtube_dlc/extractor/smotri.py similarity index 100% rename from youtube_dl/extractor/smotri.py rename to youtube_dlc/extractor/smotri.py diff --git a/youtube_dl/extractor/snotr.py b/youtube_dlc/extractor/snotr.py similarity index 100% rename from youtube_dl/extractor/snotr.py rename to youtube_dlc/extractor/snotr.py diff --git a/youtube_dl/extractor/sohu.py b/youtube_dlc/extractor/sohu.py similarity index 99% rename from youtube_dl/extractor/sohu.py rename to youtube_dlc/extractor/sohu.py index a62ed84f1..76b3cc6b6 100644 --- a/youtube_dl/extractor/sohu.py +++ b/youtube_dlc/extractor/sohu.py @@ -77,7 +77,7 @@ class SohuIE(InfoExtractor): 'info_dict': { 'id': '78932792', 'ext': 'mp4', - 'title': 'youtube-dl testing video', + 'title': 'youtube-dlc testing video', }, 'params': { 'skip_download': True diff --git a/youtube_dl/extractor/sonyliv.py b/youtube_dlc/extractor/sonyliv.py similarity index 100% rename from youtube_dl/extractor/sonyliv.py rename to youtube_dlc/extractor/sonyliv.py diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dlc/extractor/soundcloud.py similarity index 99% rename from youtube_dl/extractor/soundcloud.py rename to youtube_dlc/extractor/soundcloud.py index ac09cb5e6..ae3573680 100644 --- a/youtube_dl/extractor/soundcloud.py +++ b/youtube_dlc/extractor/soundcloud.py @@ -122,7 +122,7 @@ class SoundcloudIE(InfoExtractor): }, # private link { - 'url': 'https://soundcloud.com/jaimemf/youtube-dl-test-video-a-y-baw/s-8Pjrp', + 'url': 'https://soundcloud.com/jaimemf/youtube-dlc-test-video-a-y-baw/s-8Pjrp', 'md5': 'aa0dd32bfea9b0c5ef4f02aacd080604', 'info_dict': { 'id': '123998367', diff --git a/youtube_dl/extractor/soundgasm.py b/youtube_dlc/extractor/soundgasm.py similarity index 100% rename from youtube_dl/extractor/soundgasm.py rename to youtube_dlc/extractor/soundgasm.py diff --git a/youtube_dl/extractor/southpark.py b/youtube_dlc/extractor/southpark.py similarity index 100% rename from youtube_dl/extractor/southpark.py rename to youtube_dlc/extractor/southpark.py diff --git a/youtube_dl/extractor/spankbang.py b/youtube_dlc/extractor/spankbang.py similarity index 100% rename from youtube_dl/extractor/spankbang.py rename to youtube_dlc/extractor/spankbang.py diff --git a/youtube_dl/extractor/spankwire.py b/youtube_dlc/extractor/spankwire.py similarity index 100% rename from youtube_dl/extractor/spankwire.py rename to youtube_dlc/extractor/spankwire.py diff --git a/youtube_dl/extractor/spiegel.py b/youtube_dlc/extractor/spiegel.py similarity index 100% rename from youtube_dl/extractor/spiegel.py rename to youtube_dlc/extractor/spiegel.py diff --git a/youtube_dl/extractor/spiegeltv.py b/youtube_dlc/extractor/spiegeltv.py similarity index 100% rename from youtube_dl/extractor/spiegeltv.py rename to youtube_dlc/extractor/spiegeltv.py diff --git a/youtube_dl/extractor/spike.py b/youtube_dlc/extractor/spike.py similarity index 100% rename from youtube_dl/extractor/spike.py rename to youtube_dlc/extractor/spike.py diff --git a/youtube_dl/extractor/sport5.py b/youtube_dlc/extractor/sport5.py similarity index 100% rename from youtube_dl/extractor/sport5.py rename to youtube_dlc/extractor/sport5.py diff --git a/youtube_dl/extractor/sportbox.py b/youtube_dlc/extractor/sportbox.py similarity index 100% rename from youtube_dl/extractor/sportbox.py rename to youtube_dlc/extractor/sportbox.py diff --git a/youtube_dl/extractor/sportdeutschland.py b/youtube_dlc/extractor/sportdeutschland.py similarity index 100% rename from youtube_dl/extractor/sportdeutschland.py rename to youtube_dlc/extractor/sportdeutschland.py diff --git a/youtube_dl/extractor/springboardplatform.py b/youtube_dlc/extractor/springboardplatform.py similarity index 100% rename from youtube_dl/extractor/springboardplatform.py rename to youtube_dlc/extractor/springboardplatform.py diff --git a/youtube_dl/extractor/sprout.py b/youtube_dlc/extractor/sprout.py similarity index 100% rename from youtube_dl/extractor/sprout.py rename to youtube_dlc/extractor/sprout.py diff --git a/youtube_dl/extractor/srgssr.py b/youtube_dlc/extractor/srgssr.py similarity index 100% rename from youtube_dl/extractor/srgssr.py rename to youtube_dlc/extractor/srgssr.py diff --git a/youtube_dl/extractor/srmediathek.py b/youtube_dlc/extractor/srmediathek.py similarity index 100% rename from youtube_dl/extractor/srmediathek.py rename to youtube_dlc/extractor/srmediathek.py diff --git a/youtube_dl/extractor/stanfordoc.py b/youtube_dlc/extractor/stanfordoc.py similarity index 100% rename from youtube_dl/extractor/stanfordoc.py rename to youtube_dlc/extractor/stanfordoc.py diff --git a/youtube_dl/extractor/steam.py b/youtube_dlc/extractor/steam.py similarity index 100% rename from youtube_dl/extractor/steam.py rename to youtube_dlc/extractor/steam.py diff --git a/youtube_dl/extractor/stitcher.py b/youtube_dlc/extractor/stitcher.py similarity index 100% rename from youtube_dl/extractor/stitcher.py rename to youtube_dlc/extractor/stitcher.py diff --git a/youtube_dl/extractor/storyfire.py b/youtube_dlc/extractor/storyfire.py similarity index 100% rename from youtube_dl/extractor/storyfire.py rename to youtube_dlc/extractor/storyfire.py diff --git a/youtube_dl/extractor/streamable.py b/youtube_dlc/extractor/streamable.py similarity index 100% rename from youtube_dl/extractor/streamable.py rename to youtube_dlc/extractor/streamable.py diff --git a/youtube_dl/extractor/streamcloud.py b/youtube_dlc/extractor/streamcloud.py similarity index 93% rename from youtube_dl/extractor/streamcloud.py rename to youtube_dlc/extractor/streamcloud.py index b97bb4374..32eb2b92d 100644 --- a/youtube_dl/extractor/streamcloud.py +++ b/youtube_dlc/extractor/streamcloud.py @@ -15,12 +15,12 @@ class StreamcloudIE(InfoExtractor): _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?P<fname>[^#?]*)\.html)?' _TESTS = [{ - 'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dl_test_video_____________-BaW_jenozKc.mp4.html', + 'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dlc_test_video_____________-BaW_jenozKc.mp4.html', 'md5': '6bea4c7fa5daaacc2a946b7146286686', 'info_dict': { 'id': 'skp9j99s4bpz', 'ext': 'mp4', - 'title': 'youtube-dl test video \'/\\ ä ↭', + 'title': 'youtube-dlc test video \'/\\ ä ↭', }, 'skip': 'Only available from the EU' }, { diff --git a/youtube_dl/extractor/streamcz.py b/youtube_dlc/extractor/streamcz.py similarity index 100% rename from youtube_dl/extractor/streamcz.py rename to youtube_dlc/extractor/streamcz.py diff --git a/youtube_dl/extractor/streetvoice.py b/youtube_dlc/extractor/streetvoice.py similarity index 100% rename from youtube_dl/extractor/streetvoice.py rename to youtube_dlc/extractor/streetvoice.py diff --git a/youtube_dl/extractor/stretchinternet.py b/youtube_dlc/extractor/stretchinternet.py similarity index 100% rename from youtube_dl/extractor/stretchinternet.py rename to youtube_dlc/extractor/stretchinternet.py diff --git a/youtube_dl/extractor/stv.py b/youtube_dlc/extractor/stv.py similarity index 100% rename from youtube_dl/extractor/stv.py rename to youtube_dlc/extractor/stv.py diff --git a/youtube_dl/extractor/sunporno.py b/youtube_dlc/extractor/sunporno.py similarity index 100% rename from youtube_dl/extractor/sunporno.py rename to youtube_dlc/extractor/sunporno.py diff --git a/youtube_dl/extractor/sverigesradio.py b/youtube_dlc/extractor/sverigesradio.py similarity index 100% rename from youtube_dl/extractor/sverigesradio.py rename to youtube_dlc/extractor/sverigesradio.py diff --git a/youtube_dl/extractor/svt.py b/youtube_dlc/extractor/svt.py similarity index 100% rename from youtube_dl/extractor/svt.py rename to youtube_dlc/extractor/svt.py diff --git a/youtube_dl/extractor/swrmediathek.py b/youtube_dlc/extractor/swrmediathek.py similarity index 100% rename from youtube_dl/extractor/swrmediathek.py rename to youtube_dlc/extractor/swrmediathek.py diff --git a/youtube_dl/extractor/syfy.py b/youtube_dlc/extractor/syfy.py similarity index 100% rename from youtube_dl/extractor/syfy.py rename to youtube_dlc/extractor/syfy.py diff --git a/youtube_dl/extractor/sztvhu.py b/youtube_dlc/extractor/sztvhu.py similarity index 100% rename from youtube_dl/extractor/sztvhu.py rename to youtube_dlc/extractor/sztvhu.py diff --git a/youtube_dl/extractor/tagesschau.py b/youtube_dlc/extractor/tagesschau.py similarity index 100% rename from youtube_dl/extractor/tagesschau.py rename to youtube_dlc/extractor/tagesschau.py diff --git a/youtube_dl/extractor/tass.py b/youtube_dlc/extractor/tass.py similarity index 100% rename from youtube_dl/extractor/tass.py rename to youtube_dlc/extractor/tass.py diff --git a/youtube_dl/extractor/tastytrade.py b/youtube_dlc/extractor/tastytrade.py similarity index 100% rename from youtube_dl/extractor/tastytrade.py rename to youtube_dlc/extractor/tastytrade.py diff --git a/youtube_dl/extractor/tbs.py b/youtube_dlc/extractor/tbs.py similarity index 100% rename from youtube_dl/extractor/tbs.py rename to youtube_dlc/extractor/tbs.py diff --git a/youtube_dl/extractor/tdslifeway.py b/youtube_dlc/extractor/tdslifeway.py similarity index 100% rename from youtube_dl/extractor/tdslifeway.py rename to youtube_dlc/extractor/tdslifeway.py diff --git a/youtube_dl/extractor/teachable.py b/youtube_dlc/extractor/teachable.py similarity index 100% rename from youtube_dl/extractor/teachable.py rename to youtube_dlc/extractor/teachable.py diff --git a/youtube_dl/extractor/teachertube.py b/youtube_dlc/extractor/teachertube.py similarity index 100% rename from youtube_dl/extractor/teachertube.py rename to youtube_dlc/extractor/teachertube.py diff --git a/youtube_dl/extractor/teachingchannel.py b/youtube_dlc/extractor/teachingchannel.py similarity index 100% rename from youtube_dl/extractor/teachingchannel.py rename to youtube_dlc/extractor/teachingchannel.py diff --git a/youtube_dl/extractor/teamcoco.py b/youtube_dlc/extractor/teamcoco.py similarity index 100% rename from youtube_dl/extractor/teamcoco.py rename to youtube_dlc/extractor/teamcoco.py diff --git a/youtube_dl/extractor/teamtreehouse.py b/youtube_dlc/extractor/teamtreehouse.py similarity index 100% rename from youtube_dl/extractor/teamtreehouse.py rename to youtube_dlc/extractor/teamtreehouse.py diff --git a/youtube_dl/extractor/techtalks.py b/youtube_dlc/extractor/techtalks.py similarity index 100% rename from youtube_dl/extractor/techtalks.py rename to youtube_dlc/extractor/techtalks.py diff --git a/youtube_dl/extractor/ted.py b/youtube_dlc/extractor/ted.py similarity index 100% rename from youtube_dl/extractor/ted.py rename to youtube_dlc/extractor/ted.py diff --git a/youtube_dl/extractor/tele13.py b/youtube_dlc/extractor/tele13.py similarity index 100% rename from youtube_dl/extractor/tele13.py rename to youtube_dlc/extractor/tele13.py diff --git a/youtube_dl/extractor/tele5.py b/youtube_dlc/extractor/tele5.py similarity index 100% rename from youtube_dl/extractor/tele5.py rename to youtube_dlc/extractor/tele5.py diff --git a/youtube_dl/extractor/telebruxelles.py b/youtube_dlc/extractor/telebruxelles.py similarity index 100% rename from youtube_dl/extractor/telebruxelles.py rename to youtube_dlc/extractor/telebruxelles.py diff --git a/youtube_dl/extractor/telecinco.py b/youtube_dlc/extractor/telecinco.py similarity index 100% rename from youtube_dl/extractor/telecinco.py rename to youtube_dlc/extractor/telecinco.py diff --git a/youtube_dl/extractor/telegraaf.py b/youtube_dlc/extractor/telegraaf.py similarity index 100% rename from youtube_dl/extractor/telegraaf.py rename to youtube_dlc/extractor/telegraaf.py diff --git a/youtube_dl/extractor/telemb.py b/youtube_dlc/extractor/telemb.py similarity index 100% rename from youtube_dl/extractor/telemb.py rename to youtube_dlc/extractor/telemb.py diff --git a/youtube_dl/extractor/telequebec.py b/youtube_dlc/extractor/telequebec.py similarity index 100% rename from youtube_dl/extractor/telequebec.py rename to youtube_dlc/extractor/telequebec.py diff --git a/youtube_dl/extractor/teletask.py b/youtube_dlc/extractor/teletask.py similarity index 100% rename from youtube_dl/extractor/teletask.py rename to youtube_dlc/extractor/teletask.py diff --git a/youtube_dl/extractor/telewebion.py b/youtube_dlc/extractor/telewebion.py similarity index 100% rename from youtube_dl/extractor/telewebion.py rename to youtube_dlc/extractor/telewebion.py diff --git a/youtube_dl/extractor/tennistv.py b/youtube_dlc/extractor/tennistv.py similarity index 100% rename from youtube_dl/extractor/tennistv.py rename to youtube_dlc/extractor/tennistv.py diff --git a/youtube_dl/extractor/tenplay.py b/youtube_dlc/extractor/tenplay.py similarity index 100% rename from youtube_dl/extractor/tenplay.py rename to youtube_dlc/extractor/tenplay.py diff --git a/youtube_dl/extractor/testurl.py b/youtube_dlc/extractor/testurl.py similarity index 100% rename from youtube_dl/extractor/testurl.py rename to youtube_dlc/extractor/testurl.py diff --git a/youtube_dl/extractor/tf1.py b/youtube_dlc/extractor/tf1.py similarity index 100% rename from youtube_dl/extractor/tf1.py rename to youtube_dlc/extractor/tf1.py diff --git a/youtube_dl/extractor/tfo.py b/youtube_dlc/extractor/tfo.py similarity index 100% rename from youtube_dl/extractor/tfo.py rename to youtube_dlc/extractor/tfo.py diff --git a/youtube_dl/extractor/theintercept.py b/youtube_dlc/extractor/theintercept.py similarity index 100% rename from youtube_dl/extractor/theintercept.py rename to youtube_dlc/extractor/theintercept.py diff --git a/youtube_dl/extractor/theplatform.py b/youtube_dlc/extractor/theplatform.py similarity index 100% rename from youtube_dl/extractor/theplatform.py rename to youtube_dlc/extractor/theplatform.py diff --git a/youtube_dl/extractor/thescene.py b/youtube_dlc/extractor/thescene.py similarity index 100% rename from youtube_dl/extractor/thescene.py rename to youtube_dlc/extractor/thescene.py diff --git a/youtube_dl/extractor/thestar.py b/youtube_dlc/extractor/thestar.py similarity index 100% rename from youtube_dl/extractor/thestar.py rename to youtube_dlc/extractor/thestar.py diff --git a/youtube_dl/extractor/thesun.py b/youtube_dlc/extractor/thesun.py similarity index 100% rename from youtube_dl/extractor/thesun.py rename to youtube_dlc/extractor/thesun.py diff --git a/youtube_dl/extractor/theweatherchannel.py b/youtube_dlc/extractor/theweatherchannel.py similarity index 100% rename from youtube_dl/extractor/theweatherchannel.py rename to youtube_dlc/extractor/theweatherchannel.py diff --git a/youtube_dl/extractor/thisamericanlife.py b/youtube_dlc/extractor/thisamericanlife.py similarity index 100% rename from youtube_dl/extractor/thisamericanlife.py rename to youtube_dlc/extractor/thisamericanlife.py diff --git a/youtube_dl/extractor/thisav.py b/youtube_dlc/extractor/thisav.py similarity index 100% rename from youtube_dl/extractor/thisav.py rename to youtube_dlc/extractor/thisav.py diff --git a/youtube_dl/extractor/thisoldhouse.py b/youtube_dlc/extractor/thisoldhouse.py similarity index 100% rename from youtube_dl/extractor/thisoldhouse.py rename to youtube_dlc/extractor/thisoldhouse.py diff --git a/youtube_dl/extractor/threeqsdn.py b/youtube_dlc/extractor/threeqsdn.py similarity index 100% rename from youtube_dl/extractor/threeqsdn.py rename to youtube_dlc/extractor/threeqsdn.py diff --git a/youtube_dl/extractor/tiktok.py b/youtube_dlc/extractor/tiktok.py similarity index 100% rename from youtube_dl/extractor/tiktok.py rename to youtube_dlc/extractor/tiktok.py diff --git a/youtube_dl/extractor/tinypic.py b/youtube_dlc/extractor/tinypic.py similarity index 100% rename from youtube_dl/extractor/tinypic.py rename to youtube_dlc/extractor/tinypic.py diff --git a/youtube_dl/extractor/tmz.py b/youtube_dlc/extractor/tmz.py similarity index 100% rename from youtube_dl/extractor/tmz.py rename to youtube_dlc/extractor/tmz.py diff --git a/youtube_dl/extractor/tnaflix.py b/youtube_dlc/extractor/tnaflix.py similarity index 100% rename from youtube_dl/extractor/tnaflix.py rename to youtube_dlc/extractor/tnaflix.py diff --git a/youtube_dl/extractor/toggle.py b/youtube_dlc/extractor/toggle.py similarity index 100% rename from youtube_dl/extractor/toggle.py rename to youtube_dlc/extractor/toggle.py diff --git a/youtube_dl/extractor/tonline.py b/youtube_dlc/extractor/tonline.py similarity index 100% rename from youtube_dl/extractor/tonline.py rename to youtube_dlc/extractor/tonline.py diff --git a/youtube_dl/extractor/toongoggles.py b/youtube_dlc/extractor/toongoggles.py similarity index 100% rename from youtube_dl/extractor/toongoggles.py rename to youtube_dlc/extractor/toongoggles.py diff --git a/youtube_dl/extractor/toutv.py b/youtube_dlc/extractor/toutv.py similarity index 100% rename from youtube_dl/extractor/toutv.py rename to youtube_dlc/extractor/toutv.py diff --git a/youtube_dl/extractor/toypics.py b/youtube_dlc/extractor/toypics.py similarity index 100% rename from youtube_dl/extractor/toypics.py rename to youtube_dlc/extractor/toypics.py diff --git a/youtube_dl/extractor/traileraddict.py b/youtube_dlc/extractor/traileraddict.py similarity index 100% rename from youtube_dl/extractor/traileraddict.py rename to youtube_dlc/extractor/traileraddict.py diff --git a/youtube_dl/extractor/trilulilu.py b/youtube_dlc/extractor/trilulilu.py similarity index 100% rename from youtube_dl/extractor/trilulilu.py rename to youtube_dlc/extractor/trilulilu.py diff --git a/youtube_dl/extractor/trunews.py b/youtube_dlc/extractor/trunews.py similarity index 100% rename from youtube_dl/extractor/trunews.py rename to youtube_dlc/extractor/trunews.py diff --git a/youtube_dl/extractor/trutv.py b/youtube_dlc/extractor/trutv.py similarity index 100% rename from youtube_dl/extractor/trutv.py rename to youtube_dlc/extractor/trutv.py diff --git a/youtube_dl/extractor/tube8.py b/youtube_dlc/extractor/tube8.py similarity index 100% rename from youtube_dl/extractor/tube8.py rename to youtube_dlc/extractor/tube8.py diff --git a/youtube_dl/extractor/tubitv.py b/youtube_dlc/extractor/tubitv.py similarity index 100% rename from youtube_dl/extractor/tubitv.py rename to youtube_dlc/extractor/tubitv.py diff --git a/youtube_dl/extractor/tudou.py b/youtube_dlc/extractor/tudou.py similarity index 100% rename from youtube_dl/extractor/tudou.py rename to youtube_dlc/extractor/tudou.py diff --git a/youtube_dl/extractor/tumblr.py b/youtube_dlc/extractor/tumblr.py similarity index 100% rename from youtube_dl/extractor/tumblr.py rename to youtube_dlc/extractor/tumblr.py diff --git a/youtube_dl/extractor/tunein.py b/youtube_dlc/extractor/tunein.py similarity index 100% rename from youtube_dl/extractor/tunein.py rename to youtube_dlc/extractor/tunein.py diff --git a/youtube_dl/extractor/tunepk.py b/youtube_dlc/extractor/tunepk.py similarity index 100% rename from youtube_dl/extractor/tunepk.py rename to youtube_dlc/extractor/tunepk.py diff --git a/youtube_dl/extractor/turbo.py b/youtube_dlc/extractor/turbo.py similarity index 100% rename from youtube_dl/extractor/turbo.py rename to youtube_dlc/extractor/turbo.py diff --git a/youtube_dl/extractor/turner.py b/youtube_dlc/extractor/turner.py similarity index 100% rename from youtube_dl/extractor/turner.py rename to youtube_dlc/extractor/turner.py diff --git a/youtube_dl/extractor/tv2.py b/youtube_dlc/extractor/tv2.py similarity index 100% rename from youtube_dl/extractor/tv2.py rename to youtube_dlc/extractor/tv2.py diff --git a/youtube_dl/extractor/tv2dk.py b/youtube_dlc/extractor/tv2dk.py similarity index 100% rename from youtube_dl/extractor/tv2dk.py rename to youtube_dlc/extractor/tv2dk.py diff --git a/youtube_dl/extractor/tv2hu.py b/youtube_dlc/extractor/tv2hu.py similarity index 100% rename from youtube_dl/extractor/tv2hu.py rename to youtube_dlc/extractor/tv2hu.py diff --git a/youtube_dl/extractor/tv4.py b/youtube_dlc/extractor/tv4.py similarity index 100% rename from youtube_dl/extractor/tv4.py rename to youtube_dlc/extractor/tv4.py diff --git a/youtube_dl/extractor/tv5mondeplus.py b/youtube_dlc/extractor/tv5mondeplus.py similarity index 100% rename from youtube_dl/extractor/tv5mondeplus.py rename to youtube_dlc/extractor/tv5mondeplus.py diff --git a/youtube_dl/extractor/tva.py b/youtube_dlc/extractor/tva.py similarity index 100% rename from youtube_dl/extractor/tva.py rename to youtube_dlc/extractor/tva.py diff --git a/youtube_dl/extractor/tvanouvelles.py b/youtube_dlc/extractor/tvanouvelles.py similarity index 100% rename from youtube_dl/extractor/tvanouvelles.py rename to youtube_dlc/extractor/tvanouvelles.py diff --git a/youtube_dl/extractor/tvc.py b/youtube_dlc/extractor/tvc.py similarity index 100% rename from youtube_dl/extractor/tvc.py rename to youtube_dlc/extractor/tvc.py diff --git a/youtube_dl/extractor/tvigle.py b/youtube_dlc/extractor/tvigle.py similarity index 100% rename from youtube_dl/extractor/tvigle.py rename to youtube_dlc/extractor/tvigle.py diff --git a/youtube_dl/extractor/tvland.py b/youtube_dlc/extractor/tvland.py similarity index 100% rename from youtube_dl/extractor/tvland.py rename to youtube_dlc/extractor/tvland.py diff --git a/youtube_dl/extractor/tvn24.py b/youtube_dlc/extractor/tvn24.py similarity index 100% rename from youtube_dl/extractor/tvn24.py rename to youtube_dlc/extractor/tvn24.py diff --git a/youtube_dl/extractor/tvnet.py b/youtube_dlc/extractor/tvnet.py similarity index 100% rename from youtube_dl/extractor/tvnet.py rename to youtube_dlc/extractor/tvnet.py diff --git a/youtube_dl/extractor/tvnoe.py b/youtube_dlc/extractor/tvnoe.py similarity index 100% rename from youtube_dl/extractor/tvnoe.py rename to youtube_dlc/extractor/tvnoe.py diff --git a/youtube_dl/extractor/tvnow.py b/youtube_dlc/extractor/tvnow.py similarity index 100% rename from youtube_dl/extractor/tvnow.py rename to youtube_dlc/extractor/tvnow.py diff --git a/youtube_dl/extractor/tvp.py b/youtube_dlc/extractor/tvp.py similarity index 100% rename from youtube_dl/extractor/tvp.py rename to youtube_dlc/extractor/tvp.py diff --git a/youtube_dl/extractor/tvplay.py b/youtube_dlc/extractor/tvplay.py similarity index 100% rename from youtube_dl/extractor/tvplay.py rename to youtube_dlc/extractor/tvplay.py diff --git a/youtube_dl/extractor/tvplayer.py b/youtube_dlc/extractor/tvplayer.py similarity index 100% rename from youtube_dl/extractor/tvplayer.py rename to youtube_dlc/extractor/tvplayer.py diff --git a/youtube_dl/extractor/tweakers.py b/youtube_dlc/extractor/tweakers.py similarity index 100% rename from youtube_dl/extractor/tweakers.py rename to youtube_dlc/extractor/tweakers.py diff --git a/youtube_dl/extractor/twentyfourvideo.py b/youtube_dlc/extractor/twentyfourvideo.py similarity index 100% rename from youtube_dl/extractor/twentyfourvideo.py rename to youtube_dlc/extractor/twentyfourvideo.py diff --git a/youtube_dl/extractor/twentymin.py b/youtube_dlc/extractor/twentymin.py similarity index 100% rename from youtube_dl/extractor/twentymin.py rename to youtube_dlc/extractor/twentymin.py diff --git a/youtube_dl/extractor/twentythreevideo.py b/youtube_dlc/extractor/twentythreevideo.py similarity index 100% rename from youtube_dl/extractor/twentythreevideo.py rename to youtube_dlc/extractor/twentythreevideo.py diff --git a/youtube_dl/extractor/twitcasting.py b/youtube_dlc/extractor/twitcasting.py similarity index 100% rename from youtube_dl/extractor/twitcasting.py rename to youtube_dlc/extractor/twitcasting.py diff --git a/youtube_dl/extractor/twitch.py b/youtube_dlc/extractor/twitch.py similarity index 100% rename from youtube_dl/extractor/twitch.py rename to youtube_dlc/extractor/twitch.py diff --git a/youtube_dl/extractor/twitter.py b/youtube_dlc/extractor/twitter.py similarity index 100% rename from youtube_dl/extractor/twitter.py rename to youtube_dlc/extractor/twitter.py diff --git a/youtube_dl/extractor/udemy.py b/youtube_dlc/extractor/udemy.py similarity index 99% rename from youtube_dl/extractor/udemy.py rename to youtube_dlc/extractor/udemy.py index 2a4faecef..60e364d30 100644 --- a/youtube_dl/extractor/udemy.py +++ b/youtube_dlc/extractor/udemy.py @@ -143,7 +143,7 @@ class UdemyIE(InfoExtractor): raise ExtractorError( 'Udemy asks you to solve a CAPTCHA. Login with browser, ' 'solve CAPTCHA, then export cookies and pass cookie file to ' - 'youtube-dl with --cookies.', expected=True) + 'youtube-dlc with --cookies.', expected=True) return ret def _download_json(self, url_or_request, *args, **kwargs): diff --git a/youtube_dl/extractor/udn.py b/youtube_dlc/extractor/udn.py similarity index 100% rename from youtube_dl/extractor/udn.py rename to youtube_dlc/extractor/udn.py diff --git a/youtube_dl/extractor/ufctv.py b/youtube_dlc/extractor/ufctv.py similarity index 100% rename from youtube_dl/extractor/ufctv.py rename to youtube_dlc/extractor/ufctv.py diff --git a/youtube_dl/extractor/uktvplay.py b/youtube_dlc/extractor/uktvplay.py similarity index 100% rename from youtube_dl/extractor/uktvplay.py rename to youtube_dlc/extractor/uktvplay.py diff --git a/youtube_dl/extractor/umg.py b/youtube_dlc/extractor/umg.py similarity index 100% rename from youtube_dl/extractor/umg.py rename to youtube_dlc/extractor/umg.py diff --git a/youtube_dl/extractor/unistra.py b/youtube_dlc/extractor/unistra.py similarity index 100% rename from youtube_dl/extractor/unistra.py rename to youtube_dlc/extractor/unistra.py diff --git a/youtube_dl/extractor/unity.py b/youtube_dlc/extractor/unity.py similarity index 100% rename from youtube_dl/extractor/unity.py rename to youtube_dlc/extractor/unity.py diff --git a/youtube_dl/extractor/uol.py b/youtube_dlc/extractor/uol.py similarity index 100% rename from youtube_dl/extractor/uol.py rename to youtube_dlc/extractor/uol.py diff --git a/youtube_dl/extractor/uplynk.py b/youtube_dlc/extractor/uplynk.py similarity index 100% rename from youtube_dl/extractor/uplynk.py rename to youtube_dlc/extractor/uplynk.py diff --git a/youtube_dl/extractor/urort.py b/youtube_dlc/extractor/urort.py similarity index 100% rename from youtube_dl/extractor/urort.py rename to youtube_dlc/extractor/urort.py diff --git a/youtube_dl/extractor/urplay.py b/youtube_dlc/extractor/urplay.py similarity index 100% rename from youtube_dl/extractor/urplay.py rename to youtube_dlc/extractor/urplay.py diff --git a/youtube_dl/extractor/usanetwork.py b/youtube_dlc/extractor/usanetwork.py similarity index 100% rename from youtube_dl/extractor/usanetwork.py rename to youtube_dlc/extractor/usanetwork.py diff --git a/youtube_dl/extractor/usatoday.py b/youtube_dlc/extractor/usatoday.py similarity index 100% rename from youtube_dl/extractor/usatoday.py rename to youtube_dlc/extractor/usatoday.py diff --git a/youtube_dl/extractor/ustream.py b/youtube_dlc/extractor/ustream.py similarity index 100% rename from youtube_dl/extractor/ustream.py rename to youtube_dlc/extractor/ustream.py diff --git a/youtube_dl/extractor/ustudio.py b/youtube_dlc/extractor/ustudio.py similarity index 100% rename from youtube_dl/extractor/ustudio.py rename to youtube_dlc/extractor/ustudio.py diff --git a/youtube_dl/extractor/varzesh3.py b/youtube_dlc/extractor/varzesh3.py similarity index 100% rename from youtube_dl/extractor/varzesh3.py rename to youtube_dlc/extractor/varzesh3.py diff --git a/youtube_dl/extractor/vbox7.py b/youtube_dlc/extractor/vbox7.py similarity index 100% rename from youtube_dl/extractor/vbox7.py rename to youtube_dlc/extractor/vbox7.py diff --git a/youtube_dl/extractor/veehd.py b/youtube_dlc/extractor/veehd.py similarity index 100% rename from youtube_dl/extractor/veehd.py rename to youtube_dlc/extractor/veehd.py diff --git a/youtube_dl/extractor/veoh.py b/youtube_dlc/extractor/veoh.py similarity index 100% rename from youtube_dl/extractor/veoh.py rename to youtube_dlc/extractor/veoh.py diff --git a/youtube_dl/extractor/vesti.py b/youtube_dlc/extractor/vesti.py similarity index 100% rename from youtube_dl/extractor/vesti.py rename to youtube_dlc/extractor/vesti.py diff --git a/youtube_dl/extractor/vevo.py b/youtube_dlc/extractor/vevo.py similarity index 100% rename from youtube_dl/extractor/vevo.py rename to youtube_dlc/extractor/vevo.py diff --git a/youtube_dl/extractor/vgtv.py b/youtube_dlc/extractor/vgtv.py similarity index 100% rename from youtube_dl/extractor/vgtv.py rename to youtube_dlc/extractor/vgtv.py diff --git a/youtube_dl/extractor/vh1.py b/youtube_dlc/extractor/vh1.py similarity index 100% rename from youtube_dl/extractor/vh1.py rename to youtube_dlc/extractor/vh1.py diff --git a/youtube_dl/extractor/vice.py b/youtube_dlc/extractor/vice.py similarity index 100% rename from youtube_dl/extractor/vice.py rename to youtube_dlc/extractor/vice.py diff --git a/youtube_dl/extractor/vidbit.py b/youtube_dlc/extractor/vidbit.py similarity index 100% rename from youtube_dl/extractor/vidbit.py rename to youtube_dlc/extractor/vidbit.py diff --git a/youtube_dl/extractor/viddler.py b/youtube_dlc/extractor/viddler.py similarity index 100% rename from youtube_dl/extractor/viddler.py rename to youtube_dlc/extractor/viddler.py diff --git a/youtube_dl/extractor/videa.py b/youtube_dlc/extractor/videa.py similarity index 100% rename from youtube_dl/extractor/videa.py rename to youtube_dlc/extractor/videa.py diff --git a/youtube_dl/extractor/videodetective.py b/youtube_dlc/extractor/videodetective.py similarity index 100% rename from youtube_dl/extractor/videodetective.py rename to youtube_dlc/extractor/videodetective.py diff --git a/youtube_dl/extractor/videofyme.py b/youtube_dlc/extractor/videofyme.py similarity index 100% rename from youtube_dl/extractor/videofyme.py rename to youtube_dlc/extractor/videofyme.py diff --git a/youtube_dl/extractor/videomore.py b/youtube_dlc/extractor/videomore.py similarity index 100% rename from youtube_dl/extractor/videomore.py rename to youtube_dlc/extractor/videomore.py diff --git a/youtube_dl/extractor/videopress.py b/youtube_dlc/extractor/videopress.py similarity index 100% rename from youtube_dl/extractor/videopress.py rename to youtube_dlc/extractor/videopress.py diff --git a/youtube_dl/extractor/vidio.py b/youtube_dlc/extractor/vidio.py similarity index 100% rename from youtube_dl/extractor/vidio.py rename to youtube_dlc/extractor/vidio.py diff --git a/youtube_dl/extractor/vidlii.py b/youtube_dlc/extractor/vidlii.py similarity index 100% rename from youtube_dl/extractor/vidlii.py rename to youtube_dlc/extractor/vidlii.py diff --git a/youtube_dl/extractor/vidme.py b/youtube_dlc/extractor/vidme.py similarity index 100% rename from youtube_dl/extractor/vidme.py rename to youtube_dlc/extractor/vidme.py diff --git a/youtube_dl/extractor/vidzi.py b/youtube_dlc/extractor/vidzi.py similarity index 96% rename from youtube_dl/extractor/vidzi.py rename to youtube_dlc/extractor/vidzi.py index 42ea4952c..4e79a0b84 100644 --- a/youtube_dl/extractor/vidzi.py +++ b/youtube_dlc/extractor/vidzi.py @@ -20,7 +20,7 @@ class VidziIE(InfoExtractor): 'info_dict': { 'id': 'cghql9yq6emu', 'ext': 'mp4', - 'title': 'youtube-dl test video 1\\\\2\'3/4<5\\\\6ä7↭', + 'title': 'youtube-dlc test video 1\\\\2\'3/4<5\\\\6ä7↭', }, 'params': { # m3u8 download diff --git a/youtube_dl/extractor/vier.py b/youtube_dlc/extractor/vier.py similarity index 100% rename from youtube_dl/extractor/vier.py rename to youtube_dlc/extractor/vier.py diff --git a/youtube_dl/extractor/viewlift.py b/youtube_dlc/extractor/viewlift.py similarity index 100% rename from youtube_dl/extractor/viewlift.py rename to youtube_dlc/extractor/viewlift.py diff --git a/youtube_dl/extractor/viidea.py b/youtube_dlc/extractor/viidea.py similarity index 100% rename from youtube_dl/extractor/viidea.py rename to youtube_dlc/extractor/viidea.py diff --git a/youtube_dl/extractor/viki.py b/youtube_dlc/extractor/viki.py similarity index 100% rename from youtube_dl/extractor/viki.py rename to youtube_dlc/extractor/viki.py diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dlc/extractor/vimeo.py similarity index 99% rename from youtube_dl/extractor/vimeo.py rename to youtube_dlc/extractor/vimeo.py index 421795b94..bbd7d06db 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dlc/extractor/vimeo.py @@ -287,7 +287,7 @@ class VimeoIE(VimeoBaseInfoExtractor): 'info_dict': { 'id': '56015672', 'ext': 'mp4', - 'title': "youtube-dl test video - \u2605 \" ' \u5e78 / \\ \u00e4 \u21ad \U0001d550", + 'title': "youtube-dlc test video - \u2605 \" ' \u5e78 / \\ \u00e4 \u21ad \U0001d550", 'description': 'md5:2d3305bad981a06ff79f027f19865021', 'timestamp': 1355990239, 'upload_date': '20121220', @@ -347,7 +347,7 @@ class VimeoIE(VimeoBaseInfoExtractor): 'info_dict': { 'id': '68375962', 'ext': 'mp4', - 'title': 'youtube-dl password protected test video', + 'title': 'youtube-dlc password protected test video', 'timestamp': 1371200155, 'upload_date': '20130614', 'uploader_url': r're:https?://(?:www\.)?vimeo\.com/user18948128', @@ -358,7 +358,7 @@ class VimeoIE(VimeoBaseInfoExtractor): }, 'params': { 'format': 'best[protocol=https]', - 'videopassword': 'youtube-dl', + 'videopassword': 'youtube-dlc', }, }, { @@ -473,7 +473,7 @@ class VimeoIE(VimeoBaseInfoExtractor): 'info_dict': { 'id': '68375962', 'ext': 'mp4', - 'title': 'youtube-dl password protected test video', + 'title': 'youtube-dlc password protected test video', 'uploader_url': r're:https?://(?:www\.)?vimeo\.com/user18948128', 'uploader_id': 'user18948128', 'uploader': 'Jaime Marquínez Ferrándiz', @@ -481,7 +481,7 @@ class VimeoIE(VimeoBaseInfoExtractor): }, 'params': { 'format': 'best[protocol=https]', - 'videopassword': 'youtube-dl', + 'videopassword': 'youtube-dlc', }, }, { @@ -600,7 +600,7 @@ class VimeoIE(VimeoBaseInfoExtractor): if b'Because of its privacy settings, this video cannot be played here' in errmsg: raise ExtractorError( 'Cannot download embed-only video without embedding ' - 'URL. Please call youtube-dl with the URL of the page ' + 'URL. Please call youtube-dlc with the URL of the page ' 'that embeds this video.', expected=True) raise @@ -917,7 +917,7 @@ class VimeoAlbumIE(VimeoBaseInfoExtractor): }, 'playlist_count': 1, 'params': { - 'videopassword': 'youtube-dl', + 'videopassword': 'youtube-dlc', } }] _PAGE_SIZE = 100 diff --git a/youtube_dl/extractor/vimple.py b/youtube_dlc/extractor/vimple.py similarity index 100% rename from youtube_dl/extractor/vimple.py rename to youtube_dlc/extractor/vimple.py diff --git a/youtube_dl/extractor/vine.py b/youtube_dlc/extractor/vine.py similarity index 100% rename from youtube_dl/extractor/vine.py rename to youtube_dlc/extractor/vine.py diff --git a/youtube_dl/extractor/viqeo.py b/youtube_dlc/extractor/viqeo.py similarity index 100% rename from youtube_dl/extractor/viqeo.py rename to youtube_dlc/extractor/viqeo.py diff --git a/youtube_dl/extractor/viu.py b/youtube_dlc/extractor/viu.py similarity index 100% rename from youtube_dl/extractor/viu.py rename to youtube_dlc/extractor/viu.py diff --git a/youtube_dl/extractor/vk.py b/youtube_dlc/extractor/vk.py similarity index 100% rename from youtube_dl/extractor/vk.py rename to youtube_dlc/extractor/vk.py diff --git a/youtube_dl/extractor/vlive.py b/youtube_dlc/extractor/vlive.py similarity index 100% rename from youtube_dl/extractor/vlive.py rename to youtube_dlc/extractor/vlive.py diff --git a/youtube_dl/extractor/vodlocker.py b/youtube_dlc/extractor/vodlocker.py similarity index 100% rename from youtube_dl/extractor/vodlocker.py rename to youtube_dlc/extractor/vodlocker.py diff --git a/youtube_dl/extractor/vodpl.py b/youtube_dlc/extractor/vodpl.py similarity index 100% rename from youtube_dl/extractor/vodpl.py rename to youtube_dlc/extractor/vodpl.py diff --git a/youtube_dl/extractor/vodplatform.py b/youtube_dlc/extractor/vodplatform.py similarity index 100% rename from youtube_dl/extractor/vodplatform.py rename to youtube_dlc/extractor/vodplatform.py diff --git a/youtube_dl/extractor/voicerepublic.py b/youtube_dlc/extractor/voicerepublic.py similarity index 100% rename from youtube_dl/extractor/voicerepublic.py rename to youtube_dlc/extractor/voicerepublic.py diff --git a/youtube_dl/extractor/voot.py b/youtube_dlc/extractor/voot.py similarity index 100% rename from youtube_dl/extractor/voot.py rename to youtube_dlc/extractor/voot.py diff --git a/youtube_dl/extractor/voxmedia.py b/youtube_dlc/extractor/voxmedia.py similarity index 100% rename from youtube_dl/extractor/voxmedia.py rename to youtube_dlc/extractor/voxmedia.py diff --git a/youtube_dl/extractor/vrak.py b/youtube_dlc/extractor/vrak.py similarity index 100% rename from youtube_dl/extractor/vrak.py rename to youtube_dlc/extractor/vrak.py diff --git a/youtube_dl/extractor/vrt.py b/youtube_dlc/extractor/vrt.py similarity index 100% rename from youtube_dl/extractor/vrt.py rename to youtube_dlc/extractor/vrt.py diff --git a/youtube_dl/extractor/vrv.py b/youtube_dlc/extractor/vrv.py similarity index 100% rename from youtube_dl/extractor/vrv.py rename to youtube_dlc/extractor/vrv.py diff --git a/youtube_dl/extractor/vshare.py b/youtube_dlc/extractor/vshare.py similarity index 100% rename from youtube_dl/extractor/vshare.py rename to youtube_dlc/extractor/vshare.py diff --git a/youtube_dl/extractor/vube.py b/youtube_dlc/extractor/vube.py similarity index 100% rename from youtube_dl/extractor/vube.py rename to youtube_dlc/extractor/vube.py diff --git a/youtube_dl/extractor/vuclip.py b/youtube_dlc/extractor/vuclip.py similarity index 100% rename from youtube_dl/extractor/vuclip.py rename to youtube_dlc/extractor/vuclip.py diff --git a/youtube_dl/extractor/vvvvid.py b/youtube_dlc/extractor/vvvvid.py similarity index 100% rename from youtube_dl/extractor/vvvvid.py rename to youtube_dlc/extractor/vvvvid.py diff --git a/youtube_dl/extractor/vyborymos.py b/youtube_dlc/extractor/vyborymos.py similarity index 100% rename from youtube_dl/extractor/vyborymos.py rename to youtube_dlc/extractor/vyborymos.py diff --git a/youtube_dl/extractor/vzaar.py b/youtube_dlc/extractor/vzaar.py similarity index 100% rename from youtube_dl/extractor/vzaar.py rename to youtube_dlc/extractor/vzaar.py diff --git a/youtube_dl/extractor/wakanim.py b/youtube_dlc/extractor/wakanim.py similarity index 100% rename from youtube_dl/extractor/wakanim.py rename to youtube_dlc/extractor/wakanim.py diff --git a/youtube_dl/extractor/walla.py b/youtube_dlc/extractor/walla.py similarity index 100% rename from youtube_dl/extractor/walla.py rename to youtube_dlc/extractor/walla.py diff --git a/youtube_dl/extractor/washingtonpost.py b/youtube_dlc/extractor/washingtonpost.py similarity index 100% rename from youtube_dl/extractor/washingtonpost.py rename to youtube_dlc/extractor/washingtonpost.py diff --git a/youtube_dl/extractor/wat.py b/youtube_dlc/extractor/wat.py similarity index 100% rename from youtube_dl/extractor/wat.py rename to youtube_dlc/extractor/wat.py diff --git a/youtube_dl/extractor/watchbox.py b/youtube_dlc/extractor/watchbox.py similarity index 100% rename from youtube_dl/extractor/watchbox.py rename to youtube_dlc/extractor/watchbox.py diff --git a/youtube_dl/extractor/watchindianporn.py b/youtube_dlc/extractor/watchindianporn.py similarity index 100% rename from youtube_dl/extractor/watchindianporn.py rename to youtube_dlc/extractor/watchindianporn.py diff --git a/youtube_dl/extractor/wdr.py b/youtube_dlc/extractor/wdr.py similarity index 100% rename from youtube_dl/extractor/wdr.py rename to youtube_dlc/extractor/wdr.py diff --git a/youtube_dl/extractor/webcaster.py b/youtube_dlc/extractor/webcaster.py similarity index 100% rename from youtube_dl/extractor/webcaster.py rename to youtube_dlc/extractor/webcaster.py diff --git a/youtube_dl/extractor/webofstories.py b/youtube_dlc/extractor/webofstories.py similarity index 100% rename from youtube_dl/extractor/webofstories.py rename to youtube_dlc/extractor/webofstories.py diff --git a/youtube_dl/extractor/weibo.py b/youtube_dlc/extractor/weibo.py similarity index 100% rename from youtube_dl/extractor/weibo.py rename to youtube_dlc/extractor/weibo.py diff --git a/youtube_dl/extractor/weiqitv.py b/youtube_dlc/extractor/weiqitv.py similarity index 100% rename from youtube_dl/extractor/weiqitv.py rename to youtube_dlc/extractor/weiqitv.py diff --git a/youtube_dl/extractor/wistia.py b/youtube_dlc/extractor/wistia.py similarity index 100% rename from youtube_dl/extractor/wistia.py rename to youtube_dlc/extractor/wistia.py diff --git a/youtube_dl/extractor/worldstarhiphop.py b/youtube_dlc/extractor/worldstarhiphop.py similarity index 100% rename from youtube_dl/extractor/worldstarhiphop.py rename to youtube_dlc/extractor/worldstarhiphop.py diff --git a/youtube_dl/extractor/wsj.py b/youtube_dlc/extractor/wsj.py similarity index 100% rename from youtube_dl/extractor/wsj.py rename to youtube_dlc/extractor/wsj.py diff --git a/youtube_dl/extractor/wwe.py b/youtube_dlc/extractor/wwe.py similarity index 100% rename from youtube_dl/extractor/wwe.py rename to youtube_dlc/extractor/wwe.py diff --git a/youtube_dl/extractor/xbef.py b/youtube_dlc/extractor/xbef.py similarity index 100% rename from youtube_dl/extractor/xbef.py rename to youtube_dlc/extractor/xbef.py diff --git a/youtube_dl/extractor/xboxclips.py b/youtube_dlc/extractor/xboxclips.py similarity index 100% rename from youtube_dl/extractor/xboxclips.py rename to youtube_dlc/extractor/xboxclips.py diff --git a/youtube_dl/extractor/xfileshare.py b/youtube_dlc/extractor/xfileshare.py similarity index 100% rename from youtube_dl/extractor/xfileshare.py rename to youtube_dlc/extractor/xfileshare.py diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dlc/extractor/xhamster.py similarity index 100% rename from youtube_dl/extractor/xhamster.py rename to youtube_dlc/extractor/xhamster.py diff --git a/youtube_dl/extractor/xiami.py b/youtube_dlc/extractor/xiami.py similarity index 100% rename from youtube_dl/extractor/xiami.py rename to youtube_dlc/extractor/xiami.py diff --git a/youtube_dl/extractor/ximalaya.py b/youtube_dlc/extractor/ximalaya.py similarity index 100% rename from youtube_dl/extractor/ximalaya.py rename to youtube_dlc/extractor/ximalaya.py diff --git a/youtube_dl/extractor/xminus.py b/youtube_dlc/extractor/xminus.py similarity index 100% rename from youtube_dl/extractor/xminus.py rename to youtube_dlc/extractor/xminus.py diff --git a/youtube_dl/extractor/xnxx.py b/youtube_dlc/extractor/xnxx.py similarity index 100% rename from youtube_dl/extractor/xnxx.py rename to youtube_dlc/extractor/xnxx.py diff --git a/youtube_dl/extractor/xstream.py b/youtube_dlc/extractor/xstream.py similarity index 100% rename from youtube_dl/extractor/xstream.py rename to youtube_dlc/extractor/xstream.py diff --git a/youtube_dl/extractor/xtube.py b/youtube_dlc/extractor/xtube.py similarity index 100% rename from youtube_dl/extractor/xtube.py rename to youtube_dlc/extractor/xtube.py diff --git a/youtube_dl/extractor/xuite.py b/youtube_dlc/extractor/xuite.py similarity index 100% rename from youtube_dl/extractor/xuite.py rename to youtube_dlc/extractor/xuite.py diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dlc/extractor/xvideos.py similarity index 100% rename from youtube_dl/extractor/xvideos.py rename to youtube_dlc/extractor/xvideos.py diff --git a/youtube_dl/extractor/xxxymovies.py b/youtube_dlc/extractor/xxxymovies.py similarity index 100% rename from youtube_dl/extractor/xxxymovies.py rename to youtube_dlc/extractor/xxxymovies.py diff --git a/youtube_dl/extractor/yahoo.py b/youtube_dlc/extractor/yahoo.py similarity index 100% rename from youtube_dl/extractor/yahoo.py rename to youtube_dlc/extractor/yahoo.py diff --git a/youtube_dl/extractor/yandexdisk.py b/youtube_dlc/extractor/yandexdisk.py similarity index 100% rename from youtube_dl/extractor/yandexdisk.py rename to youtube_dlc/extractor/yandexdisk.py diff --git a/youtube_dl/extractor/yandexmusic.py b/youtube_dlc/extractor/yandexmusic.py similarity index 99% rename from youtube_dl/extractor/yandexmusic.py rename to youtube_dlc/extractor/yandexmusic.py index 08d35e04c..4358bc836 100644 --- a/youtube_dl/extractor/yandexmusic.py +++ b/youtube_dlc/extractor/yandexmusic.py @@ -27,12 +27,12 @@ class YandexMusicBaseIE(InfoExtractor): @staticmethod def _raise_captcha(): raise ExtractorError( - 'YandexMusic has considered youtube-dl requests automated and ' + 'YandexMusic has considered youtube-dlc requests automated and ' 'asks you to solve a CAPTCHA. You can either wait for some ' 'time until unblocked and optionally use --sleep-interval ' 'in future or alternatively you can go to https://music.yandex.ru/ ' 'solve CAPTCHA, then export cookies and pass cookie file to ' - 'youtube-dl with --cookies', + 'youtube-dlc with --cookies', expected=True) def _download_webpage_handle(self, *args, **kwargs): diff --git a/youtube_dl/extractor/yandexvideo.py b/youtube_dlc/extractor/yandexvideo.py similarity index 100% rename from youtube_dl/extractor/yandexvideo.py rename to youtube_dlc/extractor/yandexvideo.py diff --git a/youtube_dl/extractor/yapfiles.py b/youtube_dlc/extractor/yapfiles.py similarity index 100% rename from youtube_dl/extractor/yapfiles.py rename to youtube_dlc/extractor/yapfiles.py diff --git a/youtube_dl/extractor/yesjapan.py b/youtube_dlc/extractor/yesjapan.py similarity index 100% rename from youtube_dl/extractor/yesjapan.py rename to youtube_dlc/extractor/yesjapan.py diff --git a/youtube_dl/extractor/yinyuetai.py b/youtube_dlc/extractor/yinyuetai.py similarity index 100% rename from youtube_dl/extractor/yinyuetai.py rename to youtube_dlc/extractor/yinyuetai.py diff --git a/youtube_dl/extractor/ynet.py b/youtube_dlc/extractor/ynet.py similarity index 100% rename from youtube_dl/extractor/ynet.py rename to youtube_dlc/extractor/ynet.py diff --git a/youtube_dl/extractor/youjizz.py b/youtube_dlc/extractor/youjizz.py similarity index 100% rename from youtube_dl/extractor/youjizz.py rename to youtube_dlc/extractor/youjizz.py diff --git a/youtube_dl/extractor/youku.py b/youtube_dlc/extractor/youku.py similarity index 100% rename from youtube_dl/extractor/youku.py rename to youtube_dlc/extractor/youku.py diff --git a/youtube_dl/extractor/younow.py b/youtube_dlc/extractor/younow.py similarity index 100% rename from youtube_dl/extractor/younow.py rename to youtube_dlc/extractor/younow.py diff --git a/youtube_dl/extractor/youporn.py b/youtube_dlc/extractor/youporn.py similarity index 100% rename from youtube_dl/extractor/youporn.py rename to youtube_dlc/extractor/youporn.py diff --git a/youtube_dl/extractor/yourporn.py b/youtube_dlc/extractor/yourporn.py similarity index 100% rename from youtube_dl/extractor/yourporn.py rename to youtube_dlc/extractor/yourporn.py diff --git a/youtube_dl/extractor/yourupload.py b/youtube_dlc/extractor/yourupload.py similarity index 100% rename from youtube_dl/extractor/yourupload.py rename to youtube_dlc/extractor/yourupload.py diff --git a/youtube_dl/extractor/youtube.py b/youtube_dlc/extractor/youtube.py similarity index 99% rename from youtube_dl/extractor/youtube.py rename to youtube_dlc/extractor/youtube.py index 70a5bd3b0..395cbf6a2 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -560,16 +560,16 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'info_dict': { 'id': 'BaW_jenozKc', 'ext': 'mp4', - 'title': 'youtube-dl test video "\'/\\ä↭𝕐', + 'title': 'youtube-dlc test video "\'/\\ä↭𝕐', 'uploader': 'Philipp Hagemeister', 'uploader_id': 'phihag', 'uploader_url': r're:https?://(?:www\.)?youtube\.com/user/phihag', 'channel_id': 'UCLqxVugv74EIW3VWh2NOa3Q', 'channel_url': r're:https?://(?:www\.)?youtube\.com/channel/UCLqxVugv74EIW3VWh2NOa3Q', 'upload_date': '20121002', - 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de .', + 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dlc.\n\nFor more information, contact phihag@phihag.de .', 'categories': ['Science & Technology'], - 'tags': ['youtube-dl'], + 'tags': ['youtube-dlc'], 'duration': 10, 'view_count': int, 'like_count': int, @@ -641,14 +641,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'info_dict': { 'id': 'BaW_jenozKc', 'ext': 'mp4', - 'title': 'youtube-dl test video "\'/\\ä↭𝕐', + 'title': 'youtube-dlc test video "\'/\\ä↭𝕐', 'uploader': 'Philipp Hagemeister', 'uploader_id': 'phihag', 'uploader_url': r're:https?://(?:www\.)?youtube\.com/user/phihag', 'upload_date': '20121002', - 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de .', + 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dlc.\n\nFor more information, contact phihag@phihag.de .', 'categories': ['Science & Technology'], - 'tags': ['youtube-dl'], + 'tags': ['youtube-dlc'], 'duration': 10, 'view_count': int, 'like_count': int, @@ -2600,7 +2600,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor): 'uploader_id': 'UCmlqkdCBesrv2Lak1mF_MxA', 'uploader': 'Sergey M.', 'id': 'PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc', - 'title': 'youtube-dl public playlist', + 'title': 'youtube-dlc public playlist', }, 'playlist_count': 1, }, { @@ -2609,7 +2609,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor): 'uploader_id': 'UCmlqkdCBesrv2Lak1mF_MxA', 'uploader': 'Sergey M.', 'id': 'PL4lCao7KL_QFodcLWhDpGCYnngnHtQ-Xf', - 'title': 'youtube-dl empty playlist', + 'title': 'youtube-dlc empty playlist', }, 'playlist_count': 0, }, { @@ -3235,10 +3235,10 @@ class YoutubeSearchURLIE(YoutubeSearchBaseInfoExtractor): IE_NAME = 'youtube:search_url' _VALID_URL = r'https?://(?:www\.)?youtube\.com/results\?(.*?&)?(?:search_query|q)=(?P<query>[^&]+)(?:[&]|$)' _TESTS = [{ - 'url': 'https://www.youtube.com/results?baz=bar&search_query=youtube-dl+test+video&filters=video&lclk=video', + 'url': 'https://www.youtube.com/results?baz=bar&search_query=youtube-dlc+test+video&filters=video&lclk=video', 'playlist_mincount': 5, 'info_dict': { - 'title': 'youtube-dl test video', + 'title': 'youtube-dlc test video', } }, { 'url': 'https://www.youtube.com/results?q=test&sp=EgQIBBgB', @@ -3422,9 +3422,9 @@ class YoutubeTruncatedURLIE(InfoExtractor): raise ExtractorError( 'Did you forget to quote the URL? Remember that & is a meta ' 'character in most shells, so you want to put the URL in quotes, ' - 'like youtube-dl ' + 'like youtube-dlc ' '"https://www.youtube.com/watch?feature=foo&v=BaW_jenozKc" ' - ' or simply youtube-dl BaW_jenozKc .', + ' or simply youtube-dlc BaW_jenozKc .', expected=True) diff --git a/youtube_dl/extractor/zapiks.py b/youtube_dlc/extractor/zapiks.py similarity index 100% rename from youtube_dl/extractor/zapiks.py rename to youtube_dlc/extractor/zapiks.py diff --git a/youtube_dl/extractor/zaq1.py b/youtube_dlc/extractor/zaq1.py similarity index 100% rename from youtube_dl/extractor/zaq1.py rename to youtube_dlc/extractor/zaq1.py diff --git a/youtube_dl/extractor/zattoo.py b/youtube_dlc/extractor/zattoo.py similarity index 100% rename from youtube_dl/extractor/zattoo.py rename to youtube_dlc/extractor/zattoo.py diff --git a/youtube_dl/extractor/zdf.py b/youtube_dlc/extractor/zdf.py similarity index 100% rename from youtube_dl/extractor/zdf.py rename to youtube_dlc/extractor/zdf.py diff --git a/youtube_dl/extractor/zingmp3.py b/youtube_dlc/extractor/zingmp3.py similarity index 100% rename from youtube_dl/extractor/zingmp3.py rename to youtube_dlc/extractor/zingmp3.py diff --git a/youtube_dl/extractor/zype.py b/youtube_dlc/extractor/zype.py similarity index 100% rename from youtube_dl/extractor/zype.py rename to youtube_dlc/extractor/zype.py diff --git a/youtube_dl/jsinterp.py b/youtube_dlc/jsinterp.py similarity index 100% rename from youtube_dl/jsinterp.py rename to youtube_dlc/jsinterp.py diff --git a/youtube_dl/options.py b/youtube_dlc/options.py similarity index 96% rename from youtube_dl/options.py rename to youtube_dlc/options.py index 6d5ac62b3..2cc5eee74 100644 --- a/youtube_dl/options.py +++ b/youtube_dlc/options.py @@ -57,33 +57,33 @@ def parseOpts(overrideArguments=None): def _readUserConf(): xdg_config_home = compat_getenv('XDG_CONFIG_HOME') if xdg_config_home: - userConfFile = os.path.join(xdg_config_home, 'youtube-dl', 'config') + userConfFile = os.path.join(xdg_config_home, 'youtube-dlc', 'config') if not os.path.isfile(userConfFile): - userConfFile = os.path.join(xdg_config_home, 'youtube-dl.conf') + userConfFile = os.path.join(xdg_config_home, 'youtube-dlc.conf') else: - userConfFile = os.path.join(compat_expanduser('~'), '.config', 'youtube-dl', 'config') + userConfFile = os.path.join(compat_expanduser('~'), '.config', 'youtube-dlc', 'config') if not os.path.isfile(userConfFile): - userConfFile = os.path.join(compat_expanduser('~'), '.config', 'youtube-dl.conf') + userConfFile = os.path.join(compat_expanduser('~'), '.config', 'youtube-dlc.conf') userConf = _readOptions(userConfFile, None) if userConf is None: appdata_dir = compat_getenv('appdata') if appdata_dir: userConf = _readOptions( - os.path.join(appdata_dir, 'youtube-dl', 'config'), + os.path.join(appdata_dir, 'youtube-dlc', 'config'), default=None) if userConf is None: userConf = _readOptions( - os.path.join(appdata_dir, 'youtube-dl', 'config.txt'), + os.path.join(appdata_dir, 'youtube-dlc', 'config.txt'), default=None) if userConf is None: userConf = _readOptions( - os.path.join(compat_expanduser('~'), 'youtube-dl.conf'), + os.path.join(compat_expanduser('~'), 'youtube-dlc.conf'), default=None) if userConf is None: userConf = _readOptions( - os.path.join(compat_expanduser('~'), 'youtube-dl.conf.txt'), + os.path.join(compat_expanduser('~'), 'youtube-dlc.conf.txt'), default=None) if userConf is None: @@ -168,14 +168,14 @@ def parseOpts(overrideArguments=None): general.add_option( '--default-search', dest='default_search', metavar='PREFIX', - help='Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for youtube-dl "large apple". Use the value "auto" to let youtube-dl guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching.') + help='Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for youtube-dlc "large apple". Use the value "auto" to let youtube-dlc guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken URLs, but emits an error if this is not possible instead of searching.') general.add_option( '--ignore-config', action='store_true', help='Do not read configuration files. ' - 'When given in the global configuration file /etc/youtube-dl.conf: ' - 'Do not read the user configuration in ~/.config/youtube-dl/config ' - '(%APPDATA%/youtube-dl/config.txt on Windows)') + 'When given in the global configuration file /etc/youtube-dlc.conf: ' + 'Do not read the user configuration in ~/.config/youtube-dlc/config ' + '(%APPDATA%/youtube-dlc/config.txt on Windows)') general.add_option( '--config-location', dest='config_location', metavar='PATH', @@ -357,7 +357,7 @@ def parseOpts(overrideArguments=None): authentication.add_option( '-p', '--password', dest='password', metavar='PASSWORD', - help='Account password. If this option is left out, youtube-dl will ask interactively.') + help='Account password. If this option is left out, youtube-dlc will ask interactively.') authentication.add_option( '-2', '--twofactor', dest='twofactor', metavar='TWOFACTOR', @@ -383,7 +383,7 @@ def parseOpts(overrideArguments=None): adobe_pass.add_option( '--ap-password', dest='ap_password', metavar='PASSWORD', - help='Multiple-system operator account password. If this option is left out, youtube-dl will ask interactively.') + help='Multiple-system operator account password. If this option is left out, youtube-dlc will ask interactively.') adobe_pass.add_option( '--ap-list-mso', action='store_true', dest='ap_list_mso', default=False, @@ -670,11 +670,11 @@ def parseOpts(overrideArguments=None): verbosity.add_option( '-C', '--call-home', dest='call_home', action='store_true', default=False, - help='Contact the youtube-dl server for debugging') + help='Contact the youtube-dlc server for debugging') verbosity.add_option( '--no-call-home', dest='call_home', action='store_false', default=False, - help='Do NOT contact the youtube-dl server for debugging') + help='Do NOT contact the youtube-dlc server for debugging') filesystem = optparse.OptionGroup(parser, 'Filesystem Options') filesystem.add_option( @@ -720,7 +720,7 @@ def parseOpts(overrideArguments=None): filesystem.add_option( '-c', '--continue', action='store_true', dest='continue_dl', default=True, - help='Force resume of partially downloaded files. By default, youtube-dl will resume downloads if possible.') + help='Force resume of partially downloaded files. By default, youtube-dlc will resume downloads if possible.') filesystem.add_option( '--no-continue', action='store_false', dest='continue_dl', @@ -755,7 +755,7 @@ def parseOpts(overrideArguments=None): help='File to read cookies from and dump cookie jar in') filesystem.add_option( '--cache-dir', dest='cachedir', default=None, metavar='DIR', - help='Location in the filesystem where youtube-dl can store some downloaded information permanently. By default $XDG_CACHE_HOME/youtube-dl or ~/.cache/youtube-dl . At the moment, only YouTube player files (for videos with obfuscated signatures) are cached, but that may change.') + help='Location in the filesystem where youtube-dlc can store some downloaded information permanently. By default $XDG_CACHE_HOME/youtube-dlc or ~/.cache/youtube-dlc . At the moment, only YouTube player files (for videos with obfuscated signatures) are cached, but that may change.') filesystem.add_option( '--no-cache-dir', action='store_const', const=False, dest='cachedir', help='Disable filesystem caching') @@ -892,14 +892,14 @@ def parseOpts(overrideArguments=None): if '--config-location' in command_line_conf: location = compat_expanduser(opts.config_location) if os.path.isdir(location): - location = os.path.join(location, 'youtube-dl.conf') + location = os.path.join(location, 'youtube-dlc.conf') if not os.path.exists(location): parser.error('config-location %s does not exist.' % location) custom_conf = _readOptions(location) elif '--ignore-config' in command_line_conf: pass else: - system_conf = _readOptions('/etc/youtube-dl.conf') + system_conf = _readOptions('/etc/youtube-dlc.conf') if '--ignore-config' not in system_conf: user_conf = _readUserConf() diff --git a/youtube_dl/postprocessor/__init__.py b/youtube_dlc/postprocessor/__init__.py similarity index 100% rename from youtube_dl/postprocessor/__init__.py rename to youtube_dlc/postprocessor/__init__.py diff --git a/youtube_dl/postprocessor/common.py b/youtube_dlc/postprocessor/common.py similarity index 100% rename from youtube_dl/postprocessor/common.py rename to youtube_dlc/postprocessor/common.py diff --git a/youtube_dl/postprocessor/embedthumbnail.py b/youtube_dlc/postprocessor/embedthumbnail.py similarity index 100% rename from youtube_dl/postprocessor/embedthumbnail.py rename to youtube_dlc/postprocessor/embedthumbnail.py diff --git a/youtube_dl/postprocessor/execafterdownload.py b/youtube_dlc/postprocessor/execafterdownload.py similarity index 100% rename from youtube_dl/postprocessor/execafterdownload.py rename to youtube_dlc/postprocessor/execafterdownload.py diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dlc/postprocessor/ffmpeg.py similarity index 99% rename from youtube_dl/postprocessor/ffmpeg.py rename to youtube_dlc/postprocessor/ffmpeg.py index 5f7298345..dbc736c50 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dlc/postprocessor/ffmpeg.py @@ -533,7 +533,7 @@ class FFmpegMergerPP(FFmpegPostProcessor): if is_outdated_version( self._versions[self.basename], required_version): warning = ('Your copy of %s is outdated and unable to properly mux separate video and audio files, ' - 'youtube-dl will download single file media. ' + 'youtube-dlc will download single file media. ' 'Update %s to version %s or newer to fix this.') % ( self.basename, self.basename, required_version) if self._downloader: diff --git a/youtube_dl/postprocessor/metadatafromtitle.py b/youtube_dlc/postprocessor/metadatafromtitle.py similarity index 100% rename from youtube_dl/postprocessor/metadatafromtitle.py rename to youtube_dlc/postprocessor/metadatafromtitle.py diff --git a/youtube_dl/postprocessor/xattrpp.py b/youtube_dlc/postprocessor/xattrpp.py similarity index 100% rename from youtube_dl/postprocessor/xattrpp.py rename to youtube_dlc/postprocessor/xattrpp.py diff --git a/youtube_dl/socks.py b/youtube_dlc/socks.py similarity index 100% rename from youtube_dl/socks.py rename to youtube_dlc/socks.py diff --git a/youtube_dl/swfinterp.py b/youtube_dlc/swfinterp.py similarity index 100% rename from youtube_dl/swfinterp.py rename to youtube_dlc/swfinterp.py diff --git a/youtube_dl/update.py b/youtube_dlc/update.py similarity index 93% rename from youtube_dl/update.py rename to youtube_dlc/update.py index 84c964617..d95a07c0c 100644 --- a/youtube_dl/update.py +++ b/youtube_dlc/update.py @@ -38,7 +38,7 @@ def update_self(to_screen, verbose, opener): UPDATES_RSA_KEY = (0x9d60ee4d8f805312fdb15a62f87b95bd66177b91df176765d13514a0f1754bcd2057295c5b6f1d35daa6742c3ffc9a82d3e118861c207995a8031e151d863c9927e304576bc80692bc8e094896fcf11b66f3e29e04e3a71e9a11558558acea1840aec37fc396fb6b65dc81a1c4144e03bd1c011de62e3f1357b327d08426fe93, 65537) if not isinstance(globals().get('__loader__'), zipimporter) and not hasattr(sys, 'frozen'): - to_screen('It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.') + to_screen('It looks like you installed youtube-dlc with a package manager, pip, setup.py or a tarball. Please use that to update.') return # Check if there is a new version @@ -50,7 +50,7 @@ def update_self(to_screen, verbose, opener): to_screen('ERROR: can\'t find the current version. Please try again later.') return if newversion == __version__: - to_screen('youtube-dl is up-to-date (' + __version__ + ')') + to_screen('youtube-dlc is up-to-date (' + __version__ + ')') return # Download and check versions info @@ -76,7 +76,7 @@ def update_self(to_screen, verbose, opener): def version_tuple(version_str): return tuple(map(int, version_str.split('.'))) if version_tuple(__version__) >= version_tuple(version_id): - to_screen('youtube-dl is up to date (%s)' % __version__) + to_screen('youtube-dlc is up to date (%s)' % __version__) return to_screen('Updating to version ' + version_id + ' ...') @@ -126,14 +126,14 @@ def update_self(to_screen, verbose, opener): return try: - bat = os.path.join(directory, 'youtube-dl-updater.bat') + bat = os.path.join(directory, 'youtube-dlc-updater.bat') with io.open(bat, 'w') as batfile: batfile.write(''' @echo off echo Waiting for file handle to be closed ... ping 127.0.0.1 -n 5 -w 1000 > NUL move /Y "%s.new" "%s" > NUL -echo Updated youtube-dl to version %s. +echo Updated youtube-dlc to version %s. start /b "" cmd /c del "%%~f0"&exit /b" \n''' % (exe, exe, version_id)) @@ -171,7 +171,7 @@ start /b "" cmd /c del "%%~f0"&exit /b" to_screen('ERROR: unable to overwrite current version') return - to_screen('Updated youtube-dl. Restart youtube-dl to use the new version.') + to_screen('Updated youtube-dlc. Restart youtube-dlc to use the new version.') def get_notes(versions, fromVersion): diff --git a/youtube_dl/utils.py b/youtube_dlc/utils.py similarity index 99% rename from youtube_dl/utils.py rename to youtube_dlc/utils.py index c73f5e0ca..7dafacac2 100644 --- a/youtube_dl/utils.py +++ b/youtube_dlc/utils.py @@ -2317,12 +2317,12 @@ def make_HTTPS_handler(params, **kwargs): def bug_reports_message(): if ytdl_is_updateable(): - update_cmd = 'type youtube-dl -U to update' + update_cmd = 'type youtube-dlc -U to update' else: update_cmd = 'see https://yt-dl.org/update on how to update' msg = '; please report this issue on https://yt-dl.org/bug .' msg += ' Make sure you are using the latest version; %s.' % update_cmd - msg += ' Be sure to call youtube-dl with the --verbose flag and include its complete output.' + msg += ' Be sure to call youtube-dlc with the --verbose flag and include its complete output.' return msg @@ -2336,7 +2336,7 @@ class ExtractorError(YoutubeDLError): def __init__(self, msg, tb=None, expected=False, cause=None, video_id=None): """ tb, if given, is the original traceback (so that it can be printed out). - If expected is set, this is a normal error message and most likely not a bug in youtube-dl. + If expected is set, this is a normal error message and most likely not a bug in youtube-dlc. """ if sys.exc_info()[0] in (compat_urllib_error.URLError, socket.timeout, UnavailableVideoError): @@ -2745,7 +2745,7 @@ class YoutubeDLCookieJar(compat_cookiejar.MozillaCookieJar): _HTTPONLY_PREFIX = '#HttpOnly_' _ENTRY_LEN = 7 _HEADER = '''# Netscape HTTP Cookie File -# This file is generated by youtube-dl. Do not edit. +# This file is generated by youtube-dlc. Do not edit. ''' _CookieFileEntry = collections.namedtuple( @@ -3732,7 +3732,7 @@ def get_exe_version(exe, args=['--version'], or False if the executable is not present """ try: # STDIN should be redirected too. On UNIX-like systems, ffmpeg triggers - # SIGTTOU if youtube-dl is run in the background. + # SIGTTOU if youtube-dlc is run in the background. # See https://github.com/ytdl-org/youtube-dl/issues/955#issuecomment-209789656 out, _ = subprocess.Popen( [encodeArgument(exe)] + args, @@ -4144,7 +4144,7 @@ def is_outdated_version(version, limit, assume_new=True): def ytdl_is_updateable(): - """ Returns if youtube-dl can be updated with -U """ + """ Returns if youtube-dlc can be updated with -U """ from zipimport import zipimporter return isinstance(globals().get('__loader__'), zipimporter) or hasattr(sys, 'frozen') @@ -5353,7 +5353,7 @@ class PerRequestProxyHandler(compat_urllib_request.ProxyHandler): return None # No Proxy if compat_urlparse.urlparse(proxy).scheme.lower() in ('socks', 'socks4', 'socks4a', 'socks5'): req.add_header('Ytdl-socks-proxy', proxy) - # youtube-dl's http/https handlers do wrapping the socket with socks + # youtube-dlc's http/https handlers do wrapping the socket with socks return None return compat_urllib_request.ProxyHandler.proxy_open( self, req, proxy, type) @@ -5626,7 +5626,7 @@ def write_xattr(path, key, value): # TODO: fallback to CLI tools raise XAttrUnavailableError( 'python-pyxattr is detected but is too old. ' - 'youtube-dl requires %s or above while your version is %s. ' + 'youtube-dlc requires %s or above while your version is %s. ' 'Falling back to other xattr implementations' % ( pyxattr_required_version, xattr.__version__)) diff --git a/youtube_dl/version.py b/youtube_dlc/version.py similarity index 100% rename from youtube_dl/version.py rename to youtube_dlc/version.py From 3fba00811122c06778d14ccd0e27fa8f32e89fb1 Mon Sep 17 00:00:00 2001 From: Unknown <blackjack4494@web.de> Date: Wed, 2 Sep 2020 22:03:33 +0200 Subject: [PATCH 025/112] [skip travis] tweaks --- bin/youtube-dl | 6 ------ devscripts/make_contributing.py | 4 ++-- docs/supportedsites.md | 5 +++++ setup.py | 10 +++++----- youtube-dl.plugin.zsh | 24 ------------------------ 5 files changed, 12 insertions(+), 37 deletions(-) delete mode 100755 bin/youtube-dl delete mode 100644 youtube-dl.plugin.zsh diff --git a/bin/youtube-dl b/bin/youtube-dl deleted file mode 100755 index fc3cc8ad8..000000000 --- a/bin/youtube-dl +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import youtube_dl - -if __name__ == '__main__': - youtube_dl.main() diff --git a/devscripts/make_contributing.py b/devscripts/make_contributing.py index f18de0560..5a068c90c 100755 --- a/devscripts/make_contributing.py +++ b/devscripts/make_contributing.py @@ -11,7 +11,7 @@ def main(): options, args = parser.parse_args() if len(args) != 2: parser.error('Expected an input and an output filename') - +''' infile, outfile = args with io.open(infile, encoding='utf-8') as inf: @@ -27,7 +27,7 @@ def main(): with io.open(outfile, 'w', encoding='utf-8') as outf: outf.write(out) - +''' if __name__ == '__main__': main() diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 35c1050e5..e42498b2d 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -224,6 +224,7 @@ - **Disney** - **dlive:stream** - **dlive:vod** + - **DoodStream** - **Dotsub** - **DouyuShow** - **DouyuTV**: 斗鱼 @@ -352,6 +353,7 @@ - **hotstar:playlist** - **Howcast** - **HowStuffWorks** + - **hrfernsehen** - **HRTi** - **HRTiPlaylist** - **Huajiao**: 花椒直播 @@ -835,6 +837,9 @@ - **stanfordoc**: Stanford Open ClassRoom - **Steam** - **Stitcher** + - **StoryFire** + - **StoryFireSeries** + - **StoryFireUser** - **Streamable** - **streamcloud.eu** - **StreamCZ** diff --git a/setup.py b/setup.py index 083f9b0f8..81e22e891 100644 --- a/setup.py +++ b/setup.py @@ -67,11 +67,11 @@ setup( long_description=LONG_DESCRIPTION, # long_description_content_type="text/markdown", url="https://github.com/blackjack4494/youtube-dlc", - # packages=setuptools.find_packages(), - packages=[ - 'youtube_dlc', - 'youtube_dlc.extractor', 'youtube_dlc.downloader', - 'youtube_dlc.postprocessor'], + packages=setuptools.find_packages(), + #packages=[ + # 'youtube_dlc', + # 'youtube_dlc.extractor', 'youtube_dlc.downloader', + # 'youtube_dlc.postprocessor'], classifiers=[ "Topic :: Multimedia :: Video", "Development Status :: 5 - Production/Stable", diff --git a/youtube-dl.plugin.zsh b/youtube-dl.plugin.zsh deleted file mode 100644 index 27537ee11..000000000 --- a/youtube-dl.plugin.zsh +++ /dev/null @@ -1,24 +0,0 @@ -# This allows the youtube-dlc command to be installed in ZSH using antigen. -# Antigen is a bundle manager. It allows you to enhance the functionality of -# your zsh session by installing bundles and themes easily. - -# Antigen documentation: -# http://antigen.sharats.me/ -# https://github.com/zsh-users/antigen - -# Install youtube-dlc: -# antigen bundle ytdl-org/youtube-dl -# Bundles installed by antigen are available for use immediately. - -# Update youtube-dlc (and all other antigen bundles): -# antigen update - -# The antigen command will download the git repository to a folder and then -# execute an enabling script (this file). The complete process for loading the -# code is documented here: -# https://github.com/zsh-users/antigen#notes-on-writing-plugins - -# This specific script just aliases youtube-dlc to the python script that this -# library provides. This requires updating the PYTHONPATH to ensure that the -# full set of code can be located. -alias youtube-dlc="PYTHONPATH=$(dirname $0) $(dirname $0)/bin/youtube-dlc" From 66f4ffbbad34cf7cc6ccba9f9c836800c3f9cefe Mon Sep 17 00:00:00 2001 From: Unknown <blackjack4494@web.de> Date: Wed, 2 Sep 2020 22:06:45 +0200 Subject: [PATCH 026/112] [skip travis] update version to dev --- youtube_dlc/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dlc/version.py b/youtube_dlc/version.py index aea708f45..d344afcd6 100644 --- a/youtube_dlc/version.py +++ b/youtube_dlc/version.py @@ -1,3 +1,3 @@ from __future__ import unicode_literals -__version__ = '2020.09.01' +__version__ = '2020.09.02-dev1' From 58ac65e7ed04d8f5cc76da16169828064cd9c5cb Mon Sep 17 00:00:00 2001 From: Unknown <blackjack4494@web.de> Date: Wed, 2 Sep 2020 22:14:59 +0200 Subject: [PATCH 027/112] [skip travis] fix broken setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 81e22e891..ac56e4995 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 -from setuptools import setup, Command +from setuptools import setup, Command, find_packages import os.path import warnings import sys @@ -67,7 +67,7 @@ setup( long_description=LONG_DESCRIPTION, # long_description_content_type="text/markdown", url="https://github.com/blackjack4494/youtube-dlc", - packages=setuptools.find_packages(), + packages=find_packages(), #packages=[ # 'youtube_dlc', # 'youtube_dlc.extractor', 'youtube_dlc.downloader', From 3867038a06bbd17d7d832d93495280b52c2f84f2 Mon Sep 17 00:00:00 2001 From: Unknown <blackjack4494@web.de> Date: Wed, 2 Sep 2020 22:37:35 +0200 Subject: [PATCH 028/112] renaming issues resolved --- test/test_utils.py | 4 ++-- youtube_dlc/extractor/vimeo.py | 12 ++++++------ youtube_dlc/extractor/youtube.py | 24 ++++++++++++------------ youtube_dlc/version.py | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/test_utils.py b/test/test_utils.py index 663a34e07..80c06db7e 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1388,8 +1388,8 @@ Line 1 self.assertEqual(caesar('ebg', 'acegik', -2), 'abc') def test_rot47(self): - self.assertEqual(rot47('youtube-dlc'), r'J@FEF36\5=') - self.assertEqual(rot47('youtube-dlc'), r'*~&%&qt\s{') + self.assertEqual(rot47('youtube-dlc'), r'J@FEF36\5=4') + self.assertEqual(rot47('youtube-dlc'), r'*~&%&qt\s{r') def test_urshift(self): self.assertEqual(urshift(3, 1), 1) diff --git a/youtube_dlc/extractor/vimeo.py b/youtube_dlc/extractor/vimeo.py index bbd7d06db..9839657ca 100644 --- a/youtube_dlc/extractor/vimeo.py +++ b/youtube_dlc/extractor/vimeo.py @@ -287,7 +287,7 @@ class VimeoIE(VimeoBaseInfoExtractor): 'info_dict': { 'id': '56015672', 'ext': 'mp4', - 'title': "youtube-dlc test video - \u2605 \" ' \u5e78 / \\ \u00e4 \u21ad \U0001d550", + 'title': "youtube-dl test video - \u2605 \" ' \u5e78 / \\ \u00e4 \u21ad \U0001d550", 'description': 'md5:2d3305bad981a06ff79f027f19865021', 'timestamp': 1355990239, 'upload_date': '20121220', @@ -347,7 +347,7 @@ class VimeoIE(VimeoBaseInfoExtractor): 'info_dict': { 'id': '68375962', 'ext': 'mp4', - 'title': 'youtube-dlc password protected test video', + 'title': 'youtube-dl password protected test video', 'timestamp': 1371200155, 'upload_date': '20130614', 'uploader_url': r're:https?://(?:www\.)?vimeo\.com/user18948128', @@ -358,7 +358,7 @@ class VimeoIE(VimeoBaseInfoExtractor): }, 'params': { 'format': 'best[protocol=https]', - 'videopassword': 'youtube-dlc', + 'videopassword': 'youtube-dl', }, }, { @@ -473,7 +473,7 @@ class VimeoIE(VimeoBaseInfoExtractor): 'info_dict': { 'id': '68375962', 'ext': 'mp4', - 'title': 'youtube-dlc password protected test video', + 'title': 'youtube-dl password protected test video', 'uploader_url': r're:https?://(?:www\.)?vimeo\.com/user18948128', 'uploader_id': 'user18948128', 'uploader': 'Jaime Marquínez Ferrándiz', @@ -481,7 +481,7 @@ class VimeoIE(VimeoBaseInfoExtractor): }, 'params': { 'format': 'best[protocol=https]', - 'videopassword': 'youtube-dlc', + 'videopassword': 'youtube-dl', }, }, { @@ -917,7 +917,7 @@ class VimeoAlbumIE(VimeoBaseInfoExtractor): }, 'playlist_count': 1, 'params': { - 'videopassword': 'youtube-dlc', + 'videopassword': 'youtube-dl', } }] _PAGE_SIZE = 100 diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index 395cbf6a2..70a5bd3b0 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -560,16 +560,16 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'info_dict': { 'id': 'BaW_jenozKc', 'ext': 'mp4', - 'title': 'youtube-dlc test video "\'/\\ä↭𝕐', + 'title': 'youtube-dl test video "\'/\\ä↭𝕐', 'uploader': 'Philipp Hagemeister', 'uploader_id': 'phihag', 'uploader_url': r're:https?://(?:www\.)?youtube\.com/user/phihag', 'channel_id': 'UCLqxVugv74EIW3VWh2NOa3Q', 'channel_url': r're:https?://(?:www\.)?youtube\.com/channel/UCLqxVugv74EIW3VWh2NOa3Q', 'upload_date': '20121002', - 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dlc.\n\nFor more information, contact phihag@phihag.de .', + 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de .', 'categories': ['Science & Technology'], - 'tags': ['youtube-dlc'], + 'tags': ['youtube-dl'], 'duration': 10, 'view_count': int, 'like_count': int, @@ -641,14 +641,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor): 'info_dict': { 'id': 'BaW_jenozKc', 'ext': 'mp4', - 'title': 'youtube-dlc test video "\'/\\ä↭𝕐', + 'title': 'youtube-dl test video "\'/\\ä↭𝕐', 'uploader': 'Philipp Hagemeister', 'uploader_id': 'phihag', 'uploader_url': r're:https?://(?:www\.)?youtube\.com/user/phihag', 'upload_date': '20121002', - 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dlc.\n\nFor more information, contact phihag@phihag.de .', + 'description': 'test chars: "\'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de .', 'categories': ['Science & Technology'], - 'tags': ['youtube-dlc'], + 'tags': ['youtube-dl'], 'duration': 10, 'view_count': int, 'like_count': int, @@ -2600,7 +2600,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor): 'uploader_id': 'UCmlqkdCBesrv2Lak1mF_MxA', 'uploader': 'Sergey M.', 'id': 'PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc', - 'title': 'youtube-dlc public playlist', + 'title': 'youtube-dl public playlist', }, 'playlist_count': 1, }, { @@ -2609,7 +2609,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor): 'uploader_id': 'UCmlqkdCBesrv2Lak1mF_MxA', 'uploader': 'Sergey M.', 'id': 'PL4lCao7KL_QFodcLWhDpGCYnngnHtQ-Xf', - 'title': 'youtube-dlc empty playlist', + 'title': 'youtube-dl empty playlist', }, 'playlist_count': 0, }, { @@ -3235,10 +3235,10 @@ class YoutubeSearchURLIE(YoutubeSearchBaseInfoExtractor): IE_NAME = 'youtube:search_url' _VALID_URL = r'https?://(?:www\.)?youtube\.com/results\?(.*?&)?(?:search_query|q)=(?P<query>[^&]+)(?:[&]|$)' _TESTS = [{ - 'url': 'https://www.youtube.com/results?baz=bar&search_query=youtube-dlc+test+video&filters=video&lclk=video', + 'url': 'https://www.youtube.com/results?baz=bar&search_query=youtube-dl+test+video&filters=video&lclk=video', 'playlist_mincount': 5, 'info_dict': { - 'title': 'youtube-dlc test video', + 'title': 'youtube-dl test video', } }, { 'url': 'https://www.youtube.com/results?q=test&sp=EgQIBBgB', @@ -3422,9 +3422,9 @@ class YoutubeTruncatedURLIE(InfoExtractor): raise ExtractorError( 'Did you forget to quote the URL? Remember that & is a meta ' 'character in most shells, so you want to put the URL in quotes, ' - 'like youtube-dlc ' + 'like youtube-dl ' '"https://www.youtube.com/watch?feature=foo&v=BaW_jenozKc" ' - ' or simply youtube-dlc BaW_jenozKc .', + ' or simply youtube-dl BaW_jenozKc .', expected=True) diff --git a/youtube_dlc/version.py b/youtube_dlc/version.py index d344afcd6..2d5d94649 100644 --- a/youtube_dlc/version.py +++ b/youtube_dlc/version.py @@ -1,3 +1,3 @@ from __future__ import unicode_literals -__version__ = '2020.09.02-dev1' +__version__ = '2020.09.02-dev2' From 8ef153ee6ff58ae3c2075d50a4a132e9ecd898b1 Mon Sep 17 00:00:00 2001 From: Unknown <blackjack4494@web.de> Date: Wed, 2 Sep 2020 22:57:46 +0200 Subject: [PATCH 029/112] rot47 capital letters. --- test/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_utils.py b/test/test_utils.py index 80c06db7e..5914d4fd6 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1389,7 +1389,7 @@ Line 1 def test_rot47(self): self.assertEqual(rot47('youtube-dlc'), r'J@FEF36\5=4') - self.assertEqual(rot47('youtube-dlc'), r'*~&%&qt\s{r') + self.assertEqual(rot47('YOUTUBE-DLC'), r'*~&%&qt\s{r') def test_urshift(self): self.assertEqual(urshift(3, 1), 1) From 3ca3f77f9ce9dd504dc6af4ef605c245c31ff860 Mon Sep 17 00:00:00 2001 From: Unknown <blackjack4494@web.de> Date: Wed, 2 Sep 2020 23:33:41 +0200 Subject: [PATCH 030/112] [skip travis] adding automerge support basically copying content of youtube_dl folder to youtube_dlc and excluding the youtube_dl folder when compiling --- .travis.yml | 3 + setup.py | 2 +- youtube-dlc.spec | 33 + youtube_dl/YoutubeDL.py | 2417 +++++++ youtube_dl/__init__.py | 483 ++ youtube_dl/__main__.py | 19 + youtube_dl/aes.py | 361 ++ youtube_dl/cache.py | 96 + youtube_dl/compat.py | 3050 +++++++++ youtube_dl/downloader/__init__.py | 63 + youtube_dl/downloader/common.py | 391 ++ youtube_dl/downloader/dash.py | 80 + youtube_dl/downloader/external.py | 371 ++ youtube_dl/downloader/f4m.py | 438 ++ youtube_dl/downloader/fragment.py | 269 + youtube_dl/downloader/hls.py | 210 + youtube_dl/downloader/http.py | 354 + youtube_dl/downloader/ism.py | 259 + youtube_dl/downloader/rtmp.py | 214 + youtube_dl/downloader/rtsp.py | 47 + youtube_dl/downloader/youtube_live_chat.py | 94 + youtube_dl/extractor/__init__.py | 46 + youtube_dl/extractor/abc.py | 193 + youtube_dl/extractor/abcnews.py | 148 + youtube_dl/extractor/abcotvs.py | 137 + youtube_dl/extractor/academicearth.py | 41 + youtube_dl/extractor/acast.py | 135 + youtube_dl/extractor/adn.py | 207 + youtube_dl/extractor/adobeconnect.py | 37 + youtube_dl/extractor/adobepass.py | 1572 +++++ youtube_dl/extractor/adobetv.py | 288 + youtube_dl/extractor/adultswim.py | 202 + youtube_dl/extractor/aenetworks.py | 247 + youtube_dl/extractor/afreecatv.py | 367 ++ youtube_dl/extractor/airmozilla.py | 66 + youtube_dl/extractor/aliexpress.py | 53 + youtube_dl/extractor/aljazeera.py | 33 + youtube_dl/extractor/allocine.py | 132 + youtube_dl/extractor/alphaporno.py | 77 + youtube_dl/extractor/amcnetworks.py | 118 + youtube_dl/extractor/americastestkitchen.py | 82 + youtube_dl/extractor/amp.py | 102 + youtube_dl/extractor/animeondemand.py | 293 + youtube_dl/extractor/anvato.py | 314 + youtube_dl/extractor/aol.py | 133 + youtube_dl/extractor/apa.py | 94 + youtube_dl/extractor/aparat.py | 95 + youtube_dl/extractor/appleconnect.py | 50 + youtube_dl/extractor/appletrailers.py | 283 + youtube_dl/extractor/archiveorg.py | 65 + youtube_dl/extractor/ard.py | 422 ++ youtube_dl/extractor/arkena.py | 133 + youtube_dl/extractor/arte.py | 201 + youtube_dl/extractor/asiancrush.py | 145 + youtube_dl/extractor/atresplayer.py | 118 + youtube_dl/extractor/atttechchannel.py | 55 + youtube_dl/extractor/atvat.py | 75 + youtube_dl/extractor/audimedia.py | 93 + youtube_dl/extractor/audioboom.py | 73 + youtube_dl/extractor/audiomack.py | 145 + youtube_dl/extractor/awaan.py | 185 + youtube_dl/extractor/aws.py | 78 + youtube_dl/extractor/azmedien.py | 66 + youtube_dl/extractor/baidu.py | 56 + youtube_dl/extractor/bandcamp.py | 417 ++ youtube_dl/extractor/bbc.py | 1359 ++++ youtube_dl/extractor/beampro.py | 194 + youtube_dl/extractor/beatport.py | 103 + youtube_dl/extractor/beeg.py | 116 + youtube_dl/extractor/behindkink.py | 46 + youtube_dl/extractor/bellmedia.py | 88 + youtube_dl/extractor/bet.py | 80 + youtube_dl/extractor/bfi.py | 37 + youtube_dl/extractor/bigflix.py | 78 + youtube_dl/extractor/bild.py | 40 + youtube_dl/extractor/bilibili.py | 450 ++ youtube_dl/extractor/biobiochiletv.py | 86 + youtube_dl/extractor/biqle.py | 105 + youtube_dl/extractor/bitchute.py | 142 + youtube_dl/extractor/bleacherreport.py | 106 + youtube_dl/extractor/blinkx.py | 86 + youtube_dl/extractor/bloomberg.py | 83 + youtube_dl/extractor/bokecc.py | 60 + youtube_dl/extractor/bostonglobe.py | 72 + youtube_dl/extractor/bpb.py | 62 + youtube_dl/extractor/br.py | 311 + youtube_dl/extractor/bravotv.py | 84 + youtube_dl/extractor/breakcom.py | 91 + youtube_dl/extractor/brightcove.py | 677 ++ youtube_dl/extractor/businessinsider.py | 48 + youtube_dl/extractor/buzzfeed.py | 98 + youtube_dl/extractor/byutv.py | 117 + youtube_dl/extractor/c56.py | 65 + youtube_dl/extractor/camdemy.py | 161 + youtube_dl/extractor/cammodels.py | 98 + youtube_dl/extractor/camtube.py | 71 + youtube_dl/extractor/camwithher.py | 89 + youtube_dl/extractor/canalc2.py | 73 + youtube_dl/extractor/canalplus.py | 116 + youtube_dl/extractor/canvas.py | 368 ++ youtube_dl/extractor/carambatv.py | 108 + youtube_dl/extractor/cartoonnetwork.py | 62 + youtube_dl/extractor/cbc.py | 497 ++ youtube_dl/extractor/cbs.py | 112 + youtube_dl/extractor/cbsinteractive.py | 103 + youtube_dl/extractor/cbslocal.py | 104 + youtube_dl/extractor/cbsnews.py | 147 + youtube_dl/extractor/cbssports.py | 38 + youtube_dl/extractor/ccc.py | 111 + youtube_dl/extractor/ccma.py | 109 + youtube_dl/extractor/cctv.py | 191 + youtube_dl/extractor/cda.py | 182 + youtube_dl/extractor/ceskatelevize.py | 289 + youtube_dl/extractor/channel9.py | 262 + youtube_dl/extractor/charlierose.py | 54 + youtube_dl/extractor/chaturbate.py | 109 + youtube_dl/extractor/chilloutzone.py | 96 + youtube_dl/extractor/chirbit.py | 91 + youtube_dl/extractor/cinchcast.py | 58 + youtube_dl/extractor/cinemax.py | 29 + youtube_dl/extractor/ciscolive.py | 151 + youtube_dl/extractor/cjsw.py | 72 + youtube_dl/extractor/cliphunter.py | 79 + youtube_dl/extractor/clippit.py | 74 + youtube_dl/extractor/cliprs.py | 33 + youtube_dl/extractor/clipsyndicate.py | 54 + youtube_dl/extractor/closertotruth.py | 92 + youtube_dl/extractor/cloudflarestream.py | 72 + youtube_dl/extractor/cloudy.py | 60 + youtube_dl/extractor/clubic.py | 56 + youtube_dl/extractor/clyp.py | 82 + youtube_dl/extractor/cmt.py | 54 + youtube_dl/extractor/cnbc.py | 66 + youtube_dl/extractor/cnn.py | 144 + youtube_dl/extractor/comedycentral.py | 142 + youtube_dl/extractor/common.py | 3013 +++++++++ youtube_dl/extractor/commonmistakes.py | 50 + youtube_dl/extractor/commonprotocols.py | 60 + youtube_dl/extractor/condenast.py | 232 + youtube_dl/extractor/contv.py | 118 + youtube_dl/extractor/corus.py | 160 + youtube_dl/extractor/coub.py | 140 + youtube_dl/extractor/cracked.py | 90 + youtube_dl/extractor/crackle.py | 200 + youtube_dl/extractor/crooksandliars.py | 60 + youtube_dl/extractor/crunchyroll.py | 686 ++ youtube_dl/extractor/cspan.py | 196 + youtube_dl/extractor/ctsnews.py | 87 + youtube_dl/extractor/ctvnews.py | 68 + youtube_dl/extractor/cultureunplugged.py | 70 + youtube_dl/extractor/curiositystream.py | 161 + youtube_dl/extractor/cwtv.py | 97 + youtube_dl/extractor/dailymail.py | 84 + youtube_dl/extractor/dailymotion.py | 393 ++ youtube_dl/extractor/daum.py | 266 + youtube_dl/extractor/dbtv.py | 57 + youtube_dl/extractor/dctp.py | 105 + youtube_dl/extractor/deezer.py | 91 + youtube_dl/extractor/defense.py | 39 + youtube_dl/extractor/democracynow.py | 96 + youtube_dl/extractor/dfb.py | 57 + youtube_dl/extractor/dhm.py | 59 + youtube_dl/extractor/digg.py | 56 + youtube_dl/extractor/digiteka.py | 112 + youtube_dl/extractor/discovery.py | 118 + youtube_dl/extractor/discoverygo.py | 175 + youtube_dl/extractor/discoverynetworks.py | 40 + youtube_dl/extractor/discoveryvr.py | 59 + youtube_dl/extractor/disney.py | 170 + youtube_dl/extractor/dispeak.py | 125 + youtube_dl/extractor/dlive.py | 97 + youtube_dl/extractor/doodstream.py | 71 + youtube_dl/extractor/dotsub.py | 83 + youtube_dl/extractor/douyutv.py | 201 + youtube_dl/extractor/dplay.py | 247 + youtube_dl/extractor/drbonanza.py | 59 + youtube_dl/extractor/dropbox.py | 40 + youtube_dl/extractor/drtuber.py | 112 + youtube_dl/extractor/drtv.py | 352 + youtube_dl/extractor/dtube.py | 83 + youtube_dl/extractor/dumpert.py | 80 + youtube_dl/extractor/dvtv.py | 184 + youtube_dl/extractor/dw.py | 108 + youtube_dl/extractor/eagleplatform.py | 206 + youtube_dl/extractor/ebaumsworld.py | 33 + youtube_dl/extractor/echomsk.py | 46 + youtube_dl/extractor/egghead.py | 129 + youtube_dl/extractor/ehow.py | 38 + youtube_dl/extractor/eighttracks.py | 164 + youtube_dl/extractor/einthusan.py | 111 + youtube_dl/extractor/eitb.py | 88 + youtube_dl/extractor/ellentube.py | 133 + youtube_dl/extractor/elpais.py | 95 + youtube_dl/extractor/embedly.py | 16 + youtube_dl/extractor/engadget.py | 27 + youtube_dl/extractor/eporner.py | 129 + youtube_dl/extractor/eroprofile.py | 95 + youtube_dl/extractor/escapist.py | 111 + youtube_dl/extractor/espn.py | 238 + youtube_dl/extractor/esri.py | 74 + youtube_dl/extractor/europa.py | 93 + youtube_dl/extractor/everyonesmixtape.py | 77 + youtube_dl/extractor/expotv.py | 77 + youtube_dl/extractor/expressen.py | 98 + youtube_dl/extractor/extractors.py | 1524 +++++ youtube_dl/extractor/extremetube.py | 50 + youtube_dl/extractor/eyedotv.py | 64 + youtube_dl/extractor/facebook.py | 514 ++ youtube_dl/extractor/faz.py | 93 + youtube_dl/extractor/fc2.py | 160 + youtube_dl/extractor/fczenit.py | 56 + youtube_dl/extractor/filmon.py | 178 + youtube_dl/extractor/filmweb.py | 42 + youtube_dl/extractor/firsttv.py | 156 + youtube_dl/extractor/fivemin.py | 54 + youtube_dl/extractor/fivetv.py | 91 + youtube_dl/extractor/flickr.py | 116 + youtube_dl/extractor/folketinget.py | 77 + youtube_dl/extractor/footyroom.py | 56 + youtube_dl/extractor/formula1.py | 33 + youtube_dl/extractor/fourtube.py | 309 + youtube_dl/extractor/fox.py | 150 + youtube_dl/extractor/fox9.py | 41 + youtube_dl/extractor/foxgay.py | 63 + youtube_dl/extractor/foxnews.py | 127 + youtube_dl/extractor/foxsports.py | 33 + youtube_dl/extractor/franceculture.py | 69 + youtube_dl/extractor/franceinter.py | 56 + youtube_dl/extractor/francetv.py | 518 ++ youtube_dl/extractor/freesound.py | 79 + youtube_dl/extractor/freespeech.py | 31 + youtube_dl/extractor/freshlive.py | 83 + youtube_dl/extractor/frontendmasters.py | 263 + youtube_dl/extractor/funimation.py | 154 + youtube_dl/extractor/funk.py | 49 + youtube_dl/extractor/fusion.py | 84 + youtube_dl/extractor/fxnetworks.py | 77 + youtube_dl/extractor/gaia.py | 130 + youtube_dl/extractor/gameinformer.py | 49 + youtube_dl/extractor/gamespot.py | 139 + youtube_dl/extractor/gamestar.py | 65 + youtube_dl/extractor/gaskrank.py | 101 + youtube_dl/extractor/gazeta.py | 48 + youtube_dl/extractor/gdcvault.py | 188 + youtube_dl/extractor/generic.py | 3459 ++++++++++ youtube_dl/extractor/gfycat.py | 125 + youtube_dl/extractor/giantbomb.py | 90 + youtube_dl/extractor/giga.py | 102 + youtube_dl/extractor/gigya.py | 22 + youtube_dl/extractor/glide.py | 43 + youtube_dl/extractor/globo.py | 240 + youtube_dl/extractor/go.py | 268 + youtube_dl/extractor/godtube.py | 58 + youtube_dl/extractor/golem.py | 72 + youtube_dl/extractor/googledrive.py | 277 + youtube_dl/extractor/googleplus.py | 73 + youtube_dl/extractor/googlesearch.py | 59 + youtube_dl/extractor/goshgay.py | 51 + youtube_dl/extractor/gputechconf.py | 35 + youtube_dl/extractor/groupon.py | 67 + youtube_dl/extractor/hbo.py | 175 + youtube_dl/extractor/hearthisat.py | 135 + youtube_dl/extractor/heise.py | 172 + youtube_dl/extractor/hellporno.py | 76 + youtube_dl/extractor/helsinki.py | 43 + youtube_dl/extractor/hentaistigma.py | 39 + youtube_dl/extractor/hgtv.py | 40 + youtube_dl/extractor/hidive.py | 118 + youtube_dl/extractor/historicfilms.py | 47 + youtube_dl/extractor/hitbox.py | 214 + youtube_dl/extractor/hitrecord.py | 68 + youtube_dl/extractor/hketv.py | 191 + youtube_dl/extractor/hornbunny.py | 49 + youtube_dl/extractor/hotnewhiphop.py | 66 + youtube_dl/extractor/hotstar.py | 210 + youtube_dl/extractor/howcast.py | 43 + youtube_dl/extractor/howstuffworks.py | 90 + youtube_dl/extractor/hrfensehen.py | 102 + youtube_dl/extractor/hrti.py | 208 + youtube_dl/extractor/huajiao.py | 56 + youtube_dl/extractor/huffpost.py | 96 + youtube_dl/extractor/hungama.py | 117 + youtube_dl/extractor/hypem.py | 49 + youtube_dl/extractor/ign.py | 232 + youtube_dl/extractor/imdb.py | 147 + youtube_dl/extractor/imggaming.py | 133 + youtube_dl/extractor/imgur.py | 154 + youtube_dl/extractor/ina.py | 83 + youtube_dl/extractor/inc.py | 59 + youtube_dl/extractor/indavideo.py | 128 + youtube_dl/extractor/infoq.py | 136 + youtube_dl/extractor/instagram.py | 428 ++ youtube_dl/extractor/internazionale.py | 85 + youtube_dl/extractor/internetvideoarchive.py | 64 + youtube_dl/extractor/iprima.py | 148 + youtube_dl/extractor/iqiyi.py | 394 ++ youtube_dl/extractor/ir90tv.py | 42 + youtube_dl/extractor/itv.py | 312 + youtube_dl/extractor/ivi.py | 271 + youtube_dl/extractor/ivideon.py | 83 + youtube_dl/extractor/iwara.py | 99 + youtube_dl/extractor/izlesene.py | 117 + youtube_dl/extractor/jamendo.py | 187 + youtube_dl/extractor/jeuxvideo.py | 56 + youtube_dl/extractor/joj.py | 108 + youtube_dl/extractor/jove.py | 80 + youtube_dl/extractor/jwplatform.py | 46 + youtube_dl/extractor/kakao.py | 147 + youtube_dl/extractor/kaltura.py | 377 ++ youtube_dl/extractor/kanalplay.py | 97 + youtube_dl/extractor/kankan.py | 48 + youtube_dl/extractor/karaoketv.py | 64 + youtube_dl/extractor/karrierevideos.py | 99 + youtube_dl/extractor/keezmovies.py | 133 + youtube_dl/extractor/ketnet.py | 93 + youtube_dl/extractor/khanacademy.py | 82 + youtube_dl/extractor/kickstarter.py | 71 + youtube_dl/extractor/kinja.py | 221 + youtube_dl/extractor/kinopoisk.py | 70 + youtube_dl/extractor/konserthusetplay.py | 124 + youtube_dl/extractor/krasview.py | 60 + youtube_dl/extractor/ku6.py | 32 + youtube_dl/extractor/kusi.py | 88 + youtube_dl/extractor/kuwo.py | 352 + youtube_dl/extractor/la7.py | 67 + youtube_dl/extractor/laola1tv.py | 265 + youtube_dl/extractor/lci.py | 26 + youtube_dl/extractor/lcp.py | 90 + youtube_dl/extractor/lecture2go.py | 71 + youtube_dl/extractor/lecturio.py | 243 + youtube_dl/extractor/leeco.py | 368 ++ youtube_dl/extractor/lego.py | 149 + youtube_dl/extractor/lemonde.py | 58 + youtube_dl/extractor/lenta.py | 53 + youtube_dl/extractor/libraryofcongress.py | 153 + youtube_dl/extractor/libsyn.py | 93 + youtube_dl/extractor/lifenews.py | 239 + youtube_dl/extractor/limelight.py | 358 ++ youtube_dl/extractor/line.py | 90 + youtube_dl/extractor/linkedin.py | 182 + youtube_dl/extractor/linuxacademy.py | 173 + youtube_dl/extractor/litv.py | 148 + youtube_dl/extractor/livejournal.py | 42 + youtube_dl/extractor/liveleak.py | 191 + youtube_dl/extractor/livestream.py | 366 ++ youtube_dl/extractor/lnkgo.py | 88 + youtube_dl/extractor/localnews8.py | 47 + youtube_dl/extractor/lovehomeporn.py | 37 + youtube_dl/extractor/lrt.py | 94 + youtube_dl/extractor/lynda.py | 341 + youtube_dl/extractor/m6.py | 25 + youtube_dl/extractor/mailru.py | 329 + youtube_dl/extractor/malltv.py | 56 + youtube_dl/extractor/mangomolo.py | 58 + youtube_dl/extractor/manyvids.py | 92 + youtube_dl/extractor/markiza.py | 125 + youtube_dl/extractor/massengeschmacktv.py | 77 + youtube_dl/extractor/matchtv.py | 55 + youtube_dl/extractor/mdr.py | 184 + youtube_dl/extractor/medialaan.py | 269 + youtube_dl/extractor/mediaset.py | 179 + youtube_dl/extractor/mediasite.py | 366 ++ youtube_dl/extractor/medici.py | 70 + youtube_dl/extractor/megaphone.py | 55 + youtube_dl/extractor/meipai.py | 104 + youtube_dl/extractor/melonvod.py | 72 + youtube_dl/extractor/meta.py | 73 + youtube_dl/extractor/metacafe.py | 287 + youtube_dl/extractor/metacritic.py | 65 + youtube_dl/extractor/mgoon.py | 87 + youtube_dl/extractor/mgtv.py | 96 + youtube_dl/extractor/miaopai.py | 40 + .../extractor/microsoftvirtualacademy.py | 195 + youtube_dl/extractor/ministrygrid.py | 57 + youtube_dl/extractor/minoto.py | 51 + youtube_dl/extractor/miomio.py | 141 + youtube_dl/extractor/mit.py | 132 + youtube_dl/extractor/mitele.py | 93 + youtube_dl/extractor/mixcloud.py | 351 + youtube_dl/extractor/mlb.py | 120 + youtube_dl/extractor/mnet.py | 89 + youtube_dl/extractor/moevideo.py | 79 + youtube_dl/extractor/mofosex.py | 79 + youtube_dl/extractor/mojvideo.py | 58 + youtube_dl/extractor/morningstar.py | 50 + youtube_dl/extractor/motherless.py | 207 + youtube_dl/extractor/motorsport.py | 49 + youtube_dl/extractor/movieclips.py | 49 + youtube_dl/extractor/moviezine.py | 45 + youtube_dl/extractor/movingimage.py | 52 + youtube_dl/extractor/msn.py | 171 + youtube_dl/extractor/mtv.py | 474 ++ youtube_dl/extractor/muenchentv.py | 75 + youtube_dl/extractor/mwave.py | 90 + youtube_dl/extractor/mychannels.py | 40 + youtube_dl/extractor/myspace.py | 212 + youtube_dl/extractor/myspass.py | 56 + youtube_dl/extractor/myvi.py | 111 + youtube_dl/extractor/myvidster.py | 29 + youtube_dl/extractor/nationalgeographic.py | 82 + youtube_dl/extractor/naver.py | 166 + youtube_dl/extractor/nba.py | 154 + youtube_dl/extractor/nbc.py | 541 ++ youtube_dl/extractor/ndr.py | 402 ++ youtube_dl/extractor/ndtv.py | 115 + youtube_dl/extractor/nerdcubed.py | 36 + youtube_dl/extractor/neteasemusic.py | 485 ++ youtube_dl/extractor/netzkino.py | 89 + youtube_dl/extractor/newgrounds.py | 168 + youtube_dl/extractor/newstube.py | 83 + youtube_dl/extractor/nextmedia.py | 238 + youtube_dl/extractor/nexx.py | 453 ++ youtube_dl/extractor/nfl.py | 231 + youtube_dl/extractor/nhk.py | 93 + youtube_dl/extractor/nhl.py | 128 + youtube_dl/extractor/nick.py | 249 + youtube_dl/extractor/niconico.py | 470 ++ youtube_dl/extractor/ninecninemedia.py | 102 + youtube_dl/extractor/ninegag.py | 104 + youtube_dl/extractor/ninenow.py | 93 + youtube_dl/extractor/nintendo.py | 60 + youtube_dl/extractor/njpwworld.py | 98 + youtube_dl/extractor/nobelprize.py | 62 + youtube_dl/extractor/noco.py | 235 + youtube_dl/extractor/nonktube.py | 38 + youtube_dl/extractor/noovo.py | 104 + youtube_dl/extractor/normalboots.py | 54 + youtube_dl/extractor/nosvideo.py | 75 + youtube_dl/extractor/nova.py | 305 + youtube_dl/extractor/nowness.py | 147 + youtube_dl/extractor/noz.py | 89 + youtube_dl/extractor/npo.py | 767 +++ youtube_dl/extractor/npr.py | 124 + youtube_dl/extractor/nrk.py | 717 +++ youtube_dl/extractor/nrl.py | 30 + youtube_dl/extractor/ntvcojp.py | 49 + youtube_dl/extractor/ntvde.py | 77 + youtube_dl/extractor/ntvru.py | 131 + youtube_dl/extractor/nuevo.py | 39 + youtube_dl/extractor/nuvid.py | 71 + youtube_dl/extractor/nytimes.py | 223 + youtube_dl/extractor/nzz.py | 43 + youtube_dl/extractor/odatv.py | 50 + youtube_dl/extractor/odnoklassniki.py | 268 + youtube_dl/extractor/oktoberfesttv.py | 47 + youtube_dl/extractor/once.py | 43 + youtube_dl/extractor/ondemandkorea.py | 62 + youtube_dl/extractor/onet.py | 268 + youtube_dl/extractor/onionstudios.py | 53 + youtube_dl/extractor/ooyala.py | 210 + youtube_dl/extractor/openload.py | 238 + youtube_dl/extractor/ora.py | 75 + youtube_dl/extractor/orf.py | 570 ++ youtube_dl/extractor/outsidetv.py | 28 + youtube_dl/extractor/packtpub.py | 164 + youtube_dl/extractor/pandoratv.py | 134 + youtube_dl/extractor/parliamentliveuk.py | 43 + youtube_dl/extractor/patreon.py | 156 + youtube_dl/extractor/pbs.py | 710 ++ youtube_dl/extractor/pearvideo.py | 63 + youtube_dl/extractor/peertube.py | 600 ++ youtube_dl/extractor/people.py | 32 + youtube_dl/extractor/performgroup.py | 83 + youtube_dl/extractor/periscope.py | 189 + youtube_dl/extractor/philharmoniedeparis.py | 106 + youtube_dl/extractor/phoenix.py | 52 + youtube_dl/extractor/photobucket.py | 46 + youtube_dl/extractor/picarto.py | 153 + youtube_dl/extractor/piksel.py | 138 + youtube_dl/extractor/pinkbike.py | 97 + youtube_dl/extractor/pladform.py | 125 + youtube_dl/extractor/platzi.py | 224 + youtube_dl/extractor/playfm.py | 75 + youtube_dl/extractor/playplustv.py | 109 + youtube_dl/extractor/plays.py | 53 + youtube_dl/extractor/playtvak.py | 191 + youtube_dl/extractor/playvid.py | 99 + youtube_dl/extractor/playwire.py | 75 + youtube_dl/extractor/pluralsight.py | 501 ++ youtube_dl/extractor/podomatic.py | 76 + youtube_dl/extractor/pokemon.py | 71 + youtube_dl/extractor/polskieradio.py | 180 + youtube_dl/extractor/popcorntimes.py | 99 + youtube_dl/extractor/popcorntv.py | 76 + youtube_dl/extractor/porn91.py | 63 + youtube_dl/extractor/porncom.py | 103 + youtube_dl/extractor/pornhd.py | 121 + youtube_dl/extractor/pornhub.py | 611 ++ youtube_dl/extractor/pornotube.py | 85 + youtube_dl/extractor/pornovoisines.py | 108 + youtube_dl/extractor/pornoxo.py | 58 + youtube_dl/extractor/presstv.py | 74 + youtube_dl/extractor/prosiebensat1.py | 500 ++ youtube_dl/extractor/puhutv.py | 239 + youtube_dl/extractor/puls4.py | 57 + youtube_dl/extractor/pyvideo.py | 72 + youtube_dl/extractor/qqmusic.py | 369 ++ youtube_dl/extractor/r7.py | 112 + youtube_dl/extractor/radiobremen.py | 63 + youtube_dl/extractor/radiocanada.py | 171 + youtube_dl/extractor/radiode.py | 52 + youtube_dl/extractor/radiofrance.py | 59 + youtube_dl/extractor/radiojavan.py | 83 + youtube_dl/extractor/rai.py | 502 ++ youtube_dl/extractor/raywenderlich.py | 179 + youtube_dl/extractor/rbmaradio.py | 72 + youtube_dl/extractor/rds.py | 70 + youtube_dl/extractor/redbulltv.py | 128 + youtube_dl/extractor/reddit.py | 130 + youtube_dl/extractor/redtube.py | 133 + youtube_dl/extractor/regiotv.py | 62 + youtube_dl/extractor/rentv.py | 106 + youtube_dl/extractor/restudy.py | 44 + youtube_dl/extractor/reuters.py | 69 + youtube_dl/extractor/reverbnation.py | 53 + youtube_dl/extractor/rice.py | 116 + youtube_dl/extractor/rmcdecouverte.py | 55 + youtube_dl/extractor/ro220.py | 43 + youtube_dl/extractor/rockstargames.py | 69 + youtube_dl/extractor/roosterteeth.py | 137 + youtube_dl/extractor/rottentomatoes.py | 32 + youtube_dl/extractor/roxwel.py | 53 + youtube_dl/extractor/rozhlas.py | 50 + youtube_dl/extractor/rtbf.py | 161 + youtube_dl/extractor/rte.py | 167 + youtube_dl/extractor/rtl2.py | 207 + youtube_dl/extractor/rtlnl.py | 126 + youtube_dl/extractor/rtp.py | 66 + youtube_dl/extractor/rts.py | 230 + youtube_dl/extractor/rtve.py | 292 + youtube_dl/extractor/rtvnh.py | 62 + youtube_dl/extractor/rtvs.py | 47 + youtube_dl/extractor/ruhd.py | 45 + youtube_dl/extractor/rutube.py | 313 + youtube_dl/extractor/rutv.py | 211 + youtube_dl/extractor/ruutu.py | 153 + youtube_dl/extractor/ruv.py | 101 + youtube_dl/extractor/safari.py | 264 + youtube_dl/extractor/sapo.py | 119 + youtube_dl/extractor/savefrom.py | 34 + youtube_dl/extractor/sbs.py | 66 + youtube_dl/extractor/screencast.py | 123 + youtube_dl/extractor/screencastomatic.py | 37 + youtube_dl/extractor/scrippsnetworks.py | 152 + youtube_dl/extractor/scte.py | 144 + youtube_dl/extractor/seeker.py | 58 + youtube_dl/extractor/senateisvp.py | 153 + youtube_dl/extractor/sendtonews.py | 105 + youtube_dl/extractor/servus.py | 69 + youtube_dl/extractor/sevenplus.py | 84 + youtube_dl/extractor/sexu.py | 63 + youtube_dl/extractor/seznamzpravy.py | 169 + youtube_dl/extractor/shahid.py | 215 + youtube_dl/extractor/shared.py | 138 + youtube_dl/extractor/showroomlive.py | 84 + youtube_dl/extractor/sina.py | 115 + youtube_dl/extractor/sixplay.py | 129 + youtube_dl/extractor/sky.py | 70 + youtube_dl/extractor/skylinewebcams.py | 42 + youtube_dl/extractor/skynewsarabia.py | 117 + youtube_dl/extractor/slideshare.py | 56 + youtube_dl/extractor/slideslive.py | 61 + youtube_dl/extractor/slutload.py | 65 + youtube_dl/extractor/smotri.py | 416 ++ youtube_dl/extractor/snotr.py | 73 + youtube_dl/extractor/sohu.py | 202 + youtube_dl/extractor/sonyliv.py | 40 + youtube_dl/extractor/soundcloud.py | 890 +++ youtube_dl/extractor/soundgasm.py | 77 + youtube_dl/extractor/southpark.py | 115 + youtube_dl/extractor/spankbang.py | 184 + youtube_dl/extractor/spankwire.py | 182 + youtube_dl/extractor/spiegel.py | 159 + youtube_dl/extractor/spiegeltv.py | 17 + youtube_dl/extractor/spike.py | 55 + youtube_dl/extractor/sport5.py | 92 + youtube_dl/extractor/sportbox.py | 99 + youtube_dl/extractor/sportdeutschland.py | 82 + youtube_dl/extractor/springboardplatform.py | 125 + youtube_dl/extractor/sprout.py | 52 + youtube_dl/extractor/srgssr.py | 186 + youtube_dl/extractor/srmediathek.py | 59 + youtube_dl/extractor/stanfordoc.py | 91 + youtube_dl/extractor/steam.py | 149 + youtube_dl/extractor/stitcher.py | 81 + youtube_dl/extractor/storyfire.py | 255 + youtube_dl/extractor/streamable.py | 112 + youtube_dl/extractor/streamcloud.py | 78 + youtube_dl/extractor/streamcz.py | 105 + youtube_dl/extractor/streetvoice.py | 49 + youtube_dl/extractor/stretchinternet.py | 32 + youtube_dl/extractor/stv.py | 67 + youtube_dl/extractor/sunporno.py | 79 + youtube_dl/extractor/sverigesradio.py | 115 + youtube_dl/extractor/svt.py | 380 ++ youtube_dl/extractor/swrmediathek.py | 115 + youtube_dl/extractor/syfy.py | 58 + youtube_dl/extractor/sztvhu.py | 41 + youtube_dl/extractor/tagesschau.py | 311 + youtube_dl/extractor/tass.py | 62 + youtube_dl/extractor/tastytrade.py | 43 + youtube_dl/extractor/tbs.py | 89 + youtube_dl/extractor/tdslifeway.py | 33 + youtube_dl/extractor/teachable.py | 298 + youtube_dl/extractor/teachertube.py | 129 + youtube_dl/extractor/teachingchannel.py | 33 + youtube_dl/extractor/teamcoco.py | 205 + youtube_dl/extractor/teamtreehouse.py | 140 + youtube_dl/extractor/techtalks.py | 82 + youtube_dl/extractor/ted.py | 363 ++ youtube_dl/extractor/tele13.py | 88 + youtube_dl/extractor/tele5.py | 108 + youtube_dl/extractor/telebruxelles.py | 76 + youtube_dl/extractor/telecinco.py | 188 + youtube_dl/extractor/telegraaf.py | 89 + youtube_dl/extractor/telemb.py | 78 + youtube_dl/extractor/telequebec.py | 205 + youtube_dl/extractor/teletask.py | 53 + youtube_dl/extractor/telewebion.py | 55 + youtube_dl/extractor/tennistv.py | 112 + youtube_dl/extractor/tenplay.py | 58 + youtube_dl/extractor/testurl.py | 64 + youtube_dl/extractor/tf1.py | 92 + youtube_dl/extractor/tfo.py | 55 + youtube_dl/extractor/theintercept.py | 49 + youtube_dl/extractor/theplatform.py | 411 ++ youtube_dl/extractor/thescene.py | 44 + youtube_dl/extractor/thestar.py | 36 + youtube_dl/extractor/thesun.py | 38 + youtube_dl/extractor/theweatherchannel.py | 79 + youtube_dl/extractor/thisamericanlife.py | 40 + youtube_dl/extractor/thisav.py | 73 + youtube_dl/extractor/thisoldhouse.py | 47 + youtube_dl/extractor/threeqsdn.py | 142 + youtube_dl/extractor/tiktok.py | 138 + youtube_dl/extractor/tinypic.py | 56 + youtube_dl/extractor/tmz.py | 56 + youtube_dl/extractor/tnaflix.py | 327 + youtube_dl/extractor/toggle.py | 213 + youtube_dl/extractor/tonline.py | 59 + youtube_dl/extractor/toongoggles.py | 81 + youtube_dl/extractor/toutv.py | 93 + youtube_dl/extractor/toypics.py | 90 + youtube_dl/extractor/traileraddict.py | 64 + youtube_dl/extractor/trilulilu.py | 103 + youtube_dl/extractor/trunews.py | 34 + youtube_dl/extractor/trutv.py | 75 + youtube_dl/extractor/tube8.py | 86 + youtube_dl/extractor/tubitv.py | 96 + youtube_dl/extractor/tudou.py | 49 + youtube_dl/extractor/tumblr.py | 213 + youtube_dl/extractor/tunein.py | 183 + youtube_dl/extractor/tunepk.py | 90 + youtube_dl/extractor/turbo.py | 68 + youtube_dl/extractor/turner.py | 234 + youtube_dl/extractor/tv2.py | 192 + youtube_dl/extractor/tv2dk.py | 154 + youtube_dl/extractor/tv2hu.py | 62 + youtube_dl/extractor/tv4.py | 124 + youtube_dl/extractor/tv5mondeplus.py | 117 + youtube_dl/extractor/tva.py | 57 + youtube_dl/extractor/tvanouvelles.py | 65 + youtube_dl/extractor/tvc.py | 109 + youtube_dl/extractor/tvigle.py | 138 + youtube_dl/extractor/tvland.py | 37 + youtube_dl/extractor/tvn24.py | 103 + youtube_dl/extractor/tvnet.py | 147 + youtube_dl/extractor/tvnoe.py | 48 + youtube_dl/extractor/tvnow.py | 486 ++ youtube_dl/extractor/tvp.py | 252 + youtube_dl/extractor/tvplay.py | 512 ++ youtube_dl/extractor/tvplayer.py | 86 + youtube_dl/extractor/tweakers.py | 62 + youtube_dl/extractor/twentyfourvideo.py | 133 + youtube_dl/extractor/twentymin.py | 91 + youtube_dl/extractor/twentythreevideo.py | 77 + youtube_dl/extractor/twitcasting.py | 81 + youtube_dl/extractor/twitch.py | 798 +++ youtube_dl/extractor/twitter.py | 610 ++ youtube_dl/extractor/udemy.py | 481 ++ youtube_dl/extractor/udn.py | 102 + youtube_dl/extractor/ufctv.py | 16 + youtube_dl/extractor/uktvplay.py | 33 + youtube_dl/extractor/umg.py | 103 + youtube_dl/extractor/unistra.py | 67 + youtube_dl/extractor/unity.py | 32 + youtube_dl/extractor/uol.py | 144 + youtube_dl/extractor/uplynk.py | 70 + youtube_dl/extractor/urort.py | 66 + youtube_dl/extractor/urplay.py | 71 + youtube_dl/extractor/usanetwork.py | 74 + youtube_dl/extractor/usatoday.py | 63 + youtube_dl/extractor/ustream.py | 281 + youtube_dl/extractor/ustudio.py | 125 + youtube_dl/extractor/varzesh3.py | 79 + youtube_dl/extractor/vbox7.py | 105 + youtube_dl/extractor/veehd.py | 118 + youtube_dl/extractor/veoh.py | 103 + youtube_dl/extractor/vesti.py | 121 + youtube_dl/extractor/vevo.py | 374 ++ youtube_dl/extractor/vgtv.py | 307 + youtube_dl/extractor/vh1.py | 41 + youtube_dl/extractor/vice.py | 337 + youtube_dl/extractor/vidbit.py | 84 + youtube_dl/extractor/viddler.py | 138 + youtube_dl/extractor/videa.py | 164 + youtube_dl/extractor/videodetective.py | 29 + youtube_dl/extractor/videofyme.py | 52 + youtube_dl/extractor/videomore.py | 307 + youtube_dl/extractor/videopress.py | 96 + youtube_dl/extractor/vidio.py | 77 + youtube_dl/extractor/vidlii.py | 125 + youtube_dl/extractor/vidme.py | 295 + youtube_dl/extractor/vidzi.py | 68 + youtube_dl/extractor/vier.py | 264 + youtube_dl/extractor/viewlift.py | 250 + youtube_dl/extractor/viidea.py | 202 + youtube_dl/extractor/viki.py | 384 ++ youtube_dl/extractor/vimeo.py | 1128 ++++ youtube_dl/extractor/vimple.py | 61 + youtube_dl/extractor/vine.py | 154 + youtube_dl/extractor/viqeo.py | 99 + youtube_dl/extractor/viu.py | 272 + youtube_dl/extractor/vk.py | 678 ++ youtube_dl/extractor/vlive.py | 367 ++ youtube_dl/extractor/vodlocker.py | 80 + youtube_dl/extractor/vodpl.py | 32 + youtube_dl/extractor/vodplatform.py | 40 + youtube_dl/extractor/voicerepublic.py | 62 + youtube_dl/extractor/voot.py | 100 + youtube_dl/extractor/voxmedia.py | 215 + youtube_dl/extractor/vrak.py | 80 + youtube_dl/extractor/vrt.py | 87 + youtube_dl/extractor/vrv.py | 277 + youtube_dl/extractor/vshare.py | 74 + youtube_dl/extractor/vube.py | 172 + youtube_dl/extractor/vuclip.py | 70 + youtube_dl/extractor/vvvvid.py | 158 + youtube_dl/extractor/vyborymos.py | 55 + youtube_dl/extractor/vzaar.py | 112 + youtube_dl/extractor/wakanim.py | 66 + youtube_dl/extractor/walla.py | 86 + youtube_dl/extractor/washingtonpost.py | 183 + youtube_dl/extractor/wat.py | 157 + youtube_dl/extractor/watchbox.py | 161 + youtube_dl/extractor/watchindianporn.py | 68 + youtube_dl/extractor/wdr.py | 330 + youtube_dl/extractor/webcaster.py | 102 + youtube_dl/extractor/webofstories.py | 160 + youtube_dl/extractor/weibo.py | 140 + youtube_dl/extractor/weiqitv.py | 52 + youtube_dl/extractor/wistia.py | 162 + youtube_dl/extractor/worldstarhiphop.py | 40 + youtube_dl/extractor/wsj.py | 123 + youtube_dl/extractor/wwe.py | 140 + youtube_dl/extractor/xbef.py | 44 + youtube_dl/extractor/xboxclips.py | 53 + youtube_dl/extractor/xfileshare.py | 193 + youtube_dl/extractor/xhamster.py | 393 ++ youtube_dl/extractor/xiami.py | 201 + youtube_dl/extractor/ximalaya.py | 233 + youtube_dl/extractor/xminus.py | 79 + youtube_dl/extractor/xnxx.py | 84 + youtube_dl/extractor/xstream.py | 119 + youtube_dl/extractor/xtube.py | 200 + youtube_dl/extractor/xuite.py | 153 + youtube_dl/extractor/xvideos.py | 147 + youtube_dl/extractor/xxxymovies.py | 81 + youtube_dl/extractor/yahoo.py | 569 ++ youtube_dl/extractor/yandexdisk.py | 118 + youtube_dl/extractor/yandexmusic.py | 313 + youtube_dl/extractor/yandexvideo.py | 104 + youtube_dl/extractor/yapfiles.py | 101 + youtube_dl/extractor/yesjapan.py | 62 + youtube_dl/extractor/yinyuetai.py | 56 + youtube_dl/extractor/ynet.py | 52 + youtube_dl/extractor/youjizz.py | 95 + youtube_dl/extractor/youku.py | 309 + youtube_dl/extractor/younow.py | 202 + youtube_dl/extractor/youporn.py | 203 + youtube_dl/extractor/yourporn.py | 67 + youtube_dl/extractor/yourupload.py | 46 + youtube_dl/extractor/youtube.py | 3445 ++++++++++ youtube_dl/extractor/zapiks.py | 109 + youtube_dl/extractor/zaq1.py | 101 + youtube_dl/extractor/zattoo.py | 433 ++ youtube_dl/extractor/zdf.py | 332 + youtube_dl/extractor/zingmp3.py | 143 + youtube_dl/extractor/zype.py | 134 + youtube_dl/jsinterp.py | 262 + youtube_dl/options.py | 916 +++ youtube_dl/postprocessor/__init__.py | 40 + youtube_dl/postprocessor/common.py | 69 + youtube_dl/postprocessor/embedthumbnail.py | 115 + youtube_dl/postprocessor/execafterdownload.py | 31 + youtube_dl/postprocessor/ffmpeg.py | 657 ++ youtube_dl/postprocessor/metadatafromtitle.py | 48 + youtube_dl/postprocessor/xattrpp.py | 79 + youtube_dl/socks.py | 273 + youtube_dl/swfinterp.py | 834 +++ youtube_dl/update.py | 190 + youtube_dl/utils.py | 5707 +++++++++++++++++ youtube_dl/version.py | 3 + youtube_dlc/version.py | 2 +- 804 files changed, 138656 insertions(+), 2 deletions(-) create mode 100644 youtube-dlc.spec create mode 100644 youtube_dl/YoutubeDL.py create mode 100644 youtube_dl/__init__.py create mode 100644 youtube_dl/__main__.py create mode 100644 youtube_dl/aes.py create mode 100644 youtube_dl/cache.py create mode 100644 youtube_dl/compat.py create mode 100644 youtube_dl/downloader/__init__.py create mode 100644 youtube_dl/downloader/common.py create mode 100644 youtube_dl/downloader/dash.py create mode 100644 youtube_dl/downloader/external.py create mode 100644 youtube_dl/downloader/f4m.py create mode 100644 youtube_dl/downloader/fragment.py create mode 100644 youtube_dl/downloader/hls.py create mode 100644 youtube_dl/downloader/http.py create mode 100644 youtube_dl/downloader/ism.py create mode 100644 youtube_dl/downloader/rtmp.py create mode 100644 youtube_dl/downloader/rtsp.py create mode 100644 youtube_dl/downloader/youtube_live_chat.py create mode 100644 youtube_dl/extractor/__init__.py create mode 100644 youtube_dl/extractor/abc.py create mode 100644 youtube_dl/extractor/abcnews.py create mode 100644 youtube_dl/extractor/abcotvs.py create mode 100644 youtube_dl/extractor/academicearth.py create mode 100644 youtube_dl/extractor/acast.py create mode 100644 youtube_dl/extractor/adn.py create mode 100644 youtube_dl/extractor/adobeconnect.py create mode 100644 youtube_dl/extractor/adobepass.py create mode 100644 youtube_dl/extractor/adobetv.py create mode 100644 youtube_dl/extractor/adultswim.py create mode 100644 youtube_dl/extractor/aenetworks.py create mode 100644 youtube_dl/extractor/afreecatv.py create mode 100644 youtube_dl/extractor/airmozilla.py create mode 100644 youtube_dl/extractor/aliexpress.py create mode 100644 youtube_dl/extractor/aljazeera.py create mode 100644 youtube_dl/extractor/allocine.py create mode 100644 youtube_dl/extractor/alphaporno.py create mode 100644 youtube_dl/extractor/amcnetworks.py create mode 100644 youtube_dl/extractor/americastestkitchen.py create mode 100644 youtube_dl/extractor/amp.py create mode 100644 youtube_dl/extractor/animeondemand.py create mode 100644 youtube_dl/extractor/anvato.py create mode 100644 youtube_dl/extractor/aol.py create mode 100644 youtube_dl/extractor/apa.py create mode 100644 youtube_dl/extractor/aparat.py create mode 100644 youtube_dl/extractor/appleconnect.py create mode 100644 youtube_dl/extractor/appletrailers.py create mode 100644 youtube_dl/extractor/archiveorg.py create mode 100644 youtube_dl/extractor/ard.py create mode 100644 youtube_dl/extractor/arkena.py create mode 100644 youtube_dl/extractor/arte.py create mode 100644 youtube_dl/extractor/asiancrush.py create mode 100644 youtube_dl/extractor/atresplayer.py create mode 100644 youtube_dl/extractor/atttechchannel.py create mode 100644 youtube_dl/extractor/atvat.py create mode 100644 youtube_dl/extractor/audimedia.py create mode 100644 youtube_dl/extractor/audioboom.py create mode 100644 youtube_dl/extractor/audiomack.py create mode 100644 youtube_dl/extractor/awaan.py create mode 100644 youtube_dl/extractor/aws.py create mode 100644 youtube_dl/extractor/azmedien.py create mode 100644 youtube_dl/extractor/baidu.py create mode 100644 youtube_dl/extractor/bandcamp.py create mode 100644 youtube_dl/extractor/bbc.py create mode 100644 youtube_dl/extractor/beampro.py create mode 100644 youtube_dl/extractor/beatport.py create mode 100644 youtube_dl/extractor/beeg.py create mode 100644 youtube_dl/extractor/behindkink.py create mode 100644 youtube_dl/extractor/bellmedia.py create mode 100644 youtube_dl/extractor/bet.py create mode 100644 youtube_dl/extractor/bfi.py create mode 100644 youtube_dl/extractor/bigflix.py create mode 100644 youtube_dl/extractor/bild.py create mode 100644 youtube_dl/extractor/bilibili.py create mode 100644 youtube_dl/extractor/biobiochiletv.py create mode 100644 youtube_dl/extractor/biqle.py create mode 100644 youtube_dl/extractor/bitchute.py create mode 100644 youtube_dl/extractor/bleacherreport.py create mode 100644 youtube_dl/extractor/blinkx.py create mode 100644 youtube_dl/extractor/bloomberg.py create mode 100644 youtube_dl/extractor/bokecc.py create mode 100644 youtube_dl/extractor/bostonglobe.py create mode 100644 youtube_dl/extractor/bpb.py create mode 100644 youtube_dl/extractor/br.py create mode 100644 youtube_dl/extractor/bravotv.py create mode 100644 youtube_dl/extractor/breakcom.py create mode 100644 youtube_dl/extractor/brightcove.py create mode 100644 youtube_dl/extractor/businessinsider.py create mode 100644 youtube_dl/extractor/buzzfeed.py create mode 100644 youtube_dl/extractor/byutv.py create mode 100644 youtube_dl/extractor/c56.py create mode 100644 youtube_dl/extractor/camdemy.py create mode 100644 youtube_dl/extractor/cammodels.py create mode 100644 youtube_dl/extractor/camtube.py create mode 100644 youtube_dl/extractor/camwithher.py create mode 100644 youtube_dl/extractor/canalc2.py create mode 100644 youtube_dl/extractor/canalplus.py create mode 100644 youtube_dl/extractor/canvas.py create mode 100644 youtube_dl/extractor/carambatv.py create mode 100644 youtube_dl/extractor/cartoonnetwork.py create mode 100644 youtube_dl/extractor/cbc.py create mode 100644 youtube_dl/extractor/cbs.py create mode 100644 youtube_dl/extractor/cbsinteractive.py create mode 100644 youtube_dl/extractor/cbslocal.py create mode 100644 youtube_dl/extractor/cbsnews.py create mode 100644 youtube_dl/extractor/cbssports.py create mode 100644 youtube_dl/extractor/ccc.py create mode 100644 youtube_dl/extractor/ccma.py create mode 100644 youtube_dl/extractor/cctv.py create mode 100644 youtube_dl/extractor/cda.py create mode 100644 youtube_dl/extractor/ceskatelevize.py create mode 100644 youtube_dl/extractor/channel9.py create mode 100644 youtube_dl/extractor/charlierose.py create mode 100644 youtube_dl/extractor/chaturbate.py create mode 100644 youtube_dl/extractor/chilloutzone.py create mode 100644 youtube_dl/extractor/chirbit.py create mode 100644 youtube_dl/extractor/cinchcast.py create mode 100644 youtube_dl/extractor/cinemax.py create mode 100644 youtube_dl/extractor/ciscolive.py create mode 100644 youtube_dl/extractor/cjsw.py create mode 100644 youtube_dl/extractor/cliphunter.py create mode 100644 youtube_dl/extractor/clippit.py create mode 100644 youtube_dl/extractor/cliprs.py create mode 100644 youtube_dl/extractor/clipsyndicate.py create mode 100644 youtube_dl/extractor/closertotruth.py create mode 100644 youtube_dl/extractor/cloudflarestream.py create mode 100644 youtube_dl/extractor/cloudy.py create mode 100644 youtube_dl/extractor/clubic.py create mode 100644 youtube_dl/extractor/clyp.py create mode 100644 youtube_dl/extractor/cmt.py create mode 100644 youtube_dl/extractor/cnbc.py create mode 100644 youtube_dl/extractor/cnn.py create mode 100644 youtube_dl/extractor/comedycentral.py create mode 100644 youtube_dl/extractor/common.py create mode 100644 youtube_dl/extractor/commonmistakes.py create mode 100644 youtube_dl/extractor/commonprotocols.py create mode 100644 youtube_dl/extractor/condenast.py create mode 100644 youtube_dl/extractor/contv.py create mode 100644 youtube_dl/extractor/corus.py create mode 100644 youtube_dl/extractor/coub.py create mode 100644 youtube_dl/extractor/cracked.py create mode 100644 youtube_dl/extractor/crackle.py create mode 100644 youtube_dl/extractor/crooksandliars.py create mode 100644 youtube_dl/extractor/crunchyroll.py create mode 100644 youtube_dl/extractor/cspan.py create mode 100644 youtube_dl/extractor/ctsnews.py create mode 100644 youtube_dl/extractor/ctvnews.py create mode 100644 youtube_dl/extractor/cultureunplugged.py create mode 100644 youtube_dl/extractor/curiositystream.py create mode 100644 youtube_dl/extractor/cwtv.py create mode 100644 youtube_dl/extractor/dailymail.py create mode 100644 youtube_dl/extractor/dailymotion.py create mode 100644 youtube_dl/extractor/daum.py create mode 100644 youtube_dl/extractor/dbtv.py create mode 100644 youtube_dl/extractor/dctp.py create mode 100644 youtube_dl/extractor/deezer.py create mode 100644 youtube_dl/extractor/defense.py create mode 100644 youtube_dl/extractor/democracynow.py create mode 100644 youtube_dl/extractor/dfb.py create mode 100644 youtube_dl/extractor/dhm.py create mode 100644 youtube_dl/extractor/digg.py create mode 100644 youtube_dl/extractor/digiteka.py create mode 100644 youtube_dl/extractor/discovery.py create mode 100644 youtube_dl/extractor/discoverygo.py create mode 100644 youtube_dl/extractor/discoverynetworks.py create mode 100644 youtube_dl/extractor/discoveryvr.py create mode 100644 youtube_dl/extractor/disney.py create mode 100644 youtube_dl/extractor/dispeak.py create mode 100644 youtube_dl/extractor/dlive.py create mode 100644 youtube_dl/extractor/doodstream.py create mode 100644 youtube_dl/extractor/dotsub.py create mode 100644 youtube_dl/extractor/douyutv.py create mode 100644 youtube_dl/extractor/dplay.py create mode 100644 youtube_dl/extractor/drbonanza.py create mode 100644 youtube_dl/extractor/dropbox.py create mode 100644 youtube_dl/extractor/drtuber.py create mode 100644 youtube_dl/extractor/drtv.py create mode 100644 youtube_dl/extractor/dtube.py create mode 100644 youtube_dl/extractor/dumpert.py create mode 100644 youtube_dl/extractor/dvtv.py create mode 100644 youtube_dl/extractor/dw.py create mode 100644 youtube_dl/extractor/eagleplatform.py create mode 100644 youtube_dl/extractor/ebaumsworld.py create mode 100644 youtube_dl/extractor/echomsk.py create mode 100644 youtube_dl/extractor/egghead.py create mode 100644 youtube_dl/extractor/ehow.py create mode 100644 youtube_dl/extractor/eighttracks.py create mode 100644 youtube_dl/extractor/einthusan.py create mode 100644 youtube_dl/extractor/eitb.py create mode 100644 youtube_dl/extractor/ellentube.py create mode 100644 youtube_dl/extractor/elpais.py create mode 100644 youtube_dl/extractor/embedly.py create mode 100644 youtube_dl/extractor/engadget.py create mode 100644 youtube_dl/extractor/eporner.py create mode 100644 youtube_dl/extractor/eroprofile.py create mode 100644 youtube_dl/extractor/escapist.py create mode 100644 youtube_dl/extractor/espn.py create mode 100644 youtube_dl/extractor/esri.py create mode 100644 youtube_dl/extractor/europa.py create mode 100644 youtube_dl/extractor/everyonesmixtape.py create mode 100644 youtube_dl/extractor/expotv.py create mode 100644 youtube_dl/extractor/expressen.py create mode 100644 youtube_dl/extractor/extractors.py create mode 100644 youtube_dl/extractor/extremetube.py create mode 100644 youtube_dl/extractor/eyedotv.py create mode 100644 youtube_dl/extractor/facebook.py create mode 100644 youtube_dl/extractor/faz.py create mode 100644 youtube_dl/extractor/fc2.py create mode 100644 youtube_dl/extractor/fczenit.py create mode 100644 youtube_dl/extractor/filmon.py create mode 100644 youtube_dl/extractor/filmweb.py create mode 100644 youtube_dl/extractor/firsttv.py create mode 100644 youtube_dl/extractor/fivemin.py create mode 100644 youtube_dl/extractor/fivetv.py create mode 100644 youtube_dl/extractor/flickr.py create mode 100644 youtube_dl/extractor/folketinget.py create mode 100644 youtube_dl/extractor/footyroom.py create mode 100644 youtube_dl/extractor/formula1.py create mode 100644 youtube_dl/extractor/fourtube.py create mode 100644 youtube_dl/extractor/fox.py create mode 100644 youtube_dl/extractor/fox9.py create mode 100644 youtube_dl/extractor/foxgay.py create mode 100644 youtube_dl/extractor/foxnews.py create mode 100644 youtube_dl/extractor/foxsports.py create mode 100644 youtube_dl/extractor/franceculture.py create mode 100644 youtube_dl/extractor/franceinter.py create mode 100644 youtube_dl/extractor/francetv.py create mode 100644 youtube_dl/extractor/freesound.py create mode 100644 youtube_dl/extractor/freespeech.py create mode 100644 youtube_dl/extractor/freshlive.py create mode 100644 youtube_dl/extractor/frontendmasters.py create mode 100644 youtube_dl/extractor/funimation.py create mode 100644 youtube_dl/extractor/funk.py create mode 100644 youtube_dl/extractor/fusion.py create mode 100644 youtube_dl/extractor/fxnetworks.py create mode 100644 youtube_dl/extractor/gaia.py create mode 100644 youtube_dl/extractor/gameinformer.py create mode 100644 youtube_dl/extractor/gamespot.py create mode 100644 youtube_dl/extractor/gamestar.py create mode 100644 youtube_dl/extractor/gaskrank.py create mode 100644 youtube_dl/extractor/gazeta.py create mode 100644 youtube_dl/extractor/gdcvault.py create mode 100644 youtube_dl/extractor/generic.py create mode 100644 youtube_dl/extractor/gfycat.py create mode 100644 youtube_dl/extractor/giantbomb.py create mode 100644 youtube_dl/extractor/giga.py create mode 100644 youtube_dl/extractor/gigya.py create mode 100644 youtube_dl/extractor/glide.py create mode 100644 youtube_dl/extractor/globo.py create mode 100644 youtube_dl/extractor/go.py create mode 100644 youtube_dl/extractor/godtube.py create mode 100644 youtube_dl/extractor/golem.py create mode 100644 youtube_dl/extractor/googledrive.py create mode 100644 youtube_dl/extractor/googleplus.py create mode 100644 youtube_dl/extractor/googlesearch.py create mode 100644 youtube_dl/extractor/goshgay.py create mode 100644 youtube_dl/extractor/gputechconf.py create mode 100644 youtube_dl/extractor/groupon.py create mode 100644 youtube_dl/extractor/hbo.py create mode 100644 youtube_dl/extractor/hearthisat.py create mode 100644 youtube_dl/extractor/heise.py create mode 100644 youtube_dl/extractor/hellporno.py create mode 100644 youtube_dl/extractor/helsinki.py create mode 100644 youtube_dl/extractor/hentaistigma.py create mode 100644 youtube_dl/extractor/hgtv.py create mode 100644 youtube_dl/extractor/hidive.py create mode 100644 youtube_dl/extractor/historicfilms.py create mode 100644 youtube_dl/extractor/hitbox.py create mode 100644 youtube_dl/extractor/hitrecord.py create mode 100644 youtube_dl/extractor/hketv.py create mode 100644 youtube_dl/extractor/hornbunny.py create mode 100644 youtube_dl/extractor/hotnewhiphop.py create mode 100644 youtube_dl/extractor/hotstar.py create mode 100644 youtube_dl/extractor/howcast.py create mode 100644 youtube_dl/extractor/howstuffworks.py create mode 100644 youtube_dl/extractor/hrfensehen.py create mode 100644 youtube_dl/extractor/hrti.py create mode 100644 youtube_dl/extractor/huajiao.py create mode 100644 youtube_dl/extractor/huffpost.py create mode 100644 youtube_dl/extractor/hungama.py create mode 100644 youtube_dl/extractor/hypem.py create mode 100644 youtube_dl/extractor/ign.py create mode 100644 youtube_dl/extractor/imdb.py create mode 100644 youtube_dl/extractor/imggaming.py create mode 100644 youtube_dl/extractor/imgur.py create mode 100644 youtube_dl/extractor/ina.py create mode 100644 youtube_dl/extractor/inc.py create mode 100644 youtube_dl/extractor/indavideo.py create mode 100644 youtube_dl/extractor/infoq.py create mode 100644 youtube_dl/extractor/instagram.py create mode 100644 youtube_dl/extractor/internazionale.py create mode 100644 youtube_dl/extractor/internetvideoarchive.py create mode 100644 youtube_dl/extractor/iprima.py create mode 100644 youtube_dl/extractor/iqiyi.py create mode 100644 youtube_dl/extractor/ir90tv.py create mode 100644 youtube_dl/extractor/itv.py create mode 100644 youtube_dl/extractor/ivi.py create mode 100644 youtube_dl/extractor/ivideon.py create mode 100644 youtube_dl/extractor/iwara.py create mode 100644 youtube_dl/extractor/izlesene.py create mode 100644 youtube_dl/extractor/jamendo.py create mode 100644 youtube_dl/extractor/jeuxvideo.py create mode 100644 youtube_dl/extractor/joj.py create mode 100644 youtube_dl/extractor/jove.py create mode 100644 youtube_dl/extractor/jwplatform.py create mode 100644 youtube_dl/extractor/kakao.py create mode 100644 youtube_dl/extractor/kaltura.py create mode 100644 youtube_dl/extractor/kanalplay.py create mode 100644 youtube_dl/extractor/kankan.py create mode 100644 youtube_dl/extractor/karaoketv.py create mode 100644 youtube_dl/extractor/karrierevideos.py create mode 100644 youtube_dl/extractor/keezmovies.py create mode 100644 youtube_dl/extractor/ketnet.py create mode 100644 youtube_dl/extractor/khanacademy.py create mode 100644 youtube_dl/extractor/kickstarter.py create mode 100644 youtube_dl/extractor/kinja.py create mode 100644 youtube_dl/extractor/kinopoisk.py create mode 100644 youtube_dl/extractor/konserthusetplay.py create mode 100644 youtube_dl/extractor/krasview.py create mode 100644 youtube_dl/extractor/ku6.py create mode 100644 youtube_dl/extractor/kusi.py create mode 100644 youtube_dl/extractor/kuwo.py create mode 100644 youtube_dl/extractor/la7.py create mode 100644 youtube_dl/extractor/laola1tv.py create mode 100644 youtube_dl/extractor/lci.py create mode 100644 youtube_dl/extractor/lcp.py create mode 100644 youtube_dl/extractor/lecture2go.py create mode 100644 youtube_dl/extractor/lecturio.py create mode 100644 youtube_dl/extractor/leeco.py create mode 100644 youtube_dl/extractor/lego.py create mode 100644 youtube_dl/extractor/lemonde.py create mode 100644 youtube_dl/extractor/lenta.py create mode 100644 youtube_dl/extractor/libraryofcongress.py create mode 100644 youtube_dl/extractor/libsyn.py create mode 100644 youtube_dl/extractor/lifenews.py create mode 100644 youtube_dl/extractor/limelight.py create mode 100644 youtube_dl/extractor/line.py create mode 100644 youtube_dl/extractor/linkedin.py create mode 100644 youtube_dl/extractor/linuxacademy.py create mode 100644 youtube_dl/extractor/litv.py create mode 100644 youtube_dl/extractor/livejournal.py create mode 100644 youtube_dl/extractor/liveleak.py create mode 100644 youtube_dl/extractor/livestream.py create mode 100644 youtube_dl/extractor/lnkgo.py create mode 100644 youtube_dl/extractor/localnews8.py create mode 100644 youtube_dl/extractor/lovehomeporn.py create mode 100644 youtube_dl/extractor/lrt.py create mode 100644 youtube_dl/extractor/lynda.py create mode 100644 youtube_dl/extractor/m6.py create mode 100644 youtube_dl/extractor/mailru.py create mode 100644 youtube_dl/extractor/malltv.py create mode 100644 youtube_dl/extractor/mangomolo.py create mode 100644 youtube_dl/extractor/manyvids.py create mode 100644 youtube_dl/extractor/markiza.py create mode 100644 youtube_dl/extractor/massengeschmacktv.py create mode 100644 youtube_dl/extractor/matchtv.py create mode 100644 youtube_dl/extractor/mdr.py create mode 100644 youtube_dl/extractor/medialaan.py create mode 100644 youtube_dl/extractor/mediaset.py create mode 100644 youtube_dl/extractor/mediasite.py create mode 100644 youtube_dl/extractor/medici.py create mode 100644 youtube_dl/extractor/megaphone.py create mode 100644 youtube_dl/extractor/meipai.py create mode 100644 youtube_dl/extractor/melonvod.py create mode 100644 youtube_dl/extractor/meta.py create mode 100644 youtube_dl/extractor/metacafe.py create mode 100644 youtube_dl/extractor/metacritic.py create mode 100644 youtube_dl/extractor/mgoon.py create mode 100644 youtube_dl/extractor/mgtv.py create mode 100644 youtube_dl/extractor/miaopai.py create mode 100644 youtube_dl/extractor/microsoftvirtualacademy.py create mode 100644 youtube_dl/extractor/ministrygrid.py create mode 100644 youtube_dl/extractor/minoto.py create mode 100644 youtube_dl/extractor/miomio.py create mode 100644 youtube_dl/extractor/mit.py create mode 100644 youtube_dl/extractor/mitele.py create mode 100644 youtube_dl/extractor/mixcloud.py create mode 100644 youtube_dl/extractor/mlb.py create mode 100644 youtube_dl/extractor/mnet.py create mode 100644 youtube_dl/extractor/moevideo.py create mode 100644 youtube_dl/extractor/mofosex.py create mode 100644 youtube_dl/extractor/mojvideo.py create mode 100644 youtube_dl/extractor/morningstar.py create mode 100644 youtube_dl/extractor/motherless.py create mode 100644 youtube_dl/extractor/motorsport.py create mode 100644 youtube_dl/extractor/movieclips.py create mode 100644 youtube_dl/extractor/moviezine.py create mode 100644 youtube_dl/extractor/movingimage.py create mode 100644 youtube_dl/extractor/msn.py create mode 100644 youtube_dl/extractor/mtv.py create mode 100644 youtube_dl/extractor/muenchentv.py create mode 100644 youtube_dl/extractor/mwave.py create mode 100644 youtube_dl/extractor/mychannels.py create mode 100644 youtube_dl/extractor/myspace.py create mode 100644 youtube_dl/extractor/myspass.py create mode 100644 youtube_dl/extractor/myvi.py create mode 100644 youtube_dl/extractor/myvidster.py create mode 100644 youtube_dl/extractor/nationalgeographic.py create mode 100644 youtube_dl/extractor/naver.py create mode 100644 youtube_dl/extractor/nba.py create mode 100644 youtube_dl/extractor/nbc.py create mode 100644 youtube_dl/extractor/ndr.py create mode 100644 youtube_dl/extractor/ndtv.py create mode 100644 youtube_dl/extractor/nerdcubed.py create mode 100644 youtube_dl/extractor/neteasemusic.py create mode 100644 youtube_dl/extractor/netzkino.py create mode 100644 youtube_dl/extractor/newgrounds.py create mode 100644 youtube_dl/extractor/newstube.py create mode 100644 youtube_dl/extractor/nextmedia.py create mode 100644 youtube_dl/extractor/nexx.py create mode 100644 youtube_dl/extractor/nfl.py create mode 100644 youtube_dl/extractor/nhk.py create mode 100644 youtube_dl/extractor/nhl.py create mode 100644 youtube_dl/extractor/nick.py create mode 100644 youtube_dl/extractor/niconico.py create mode 100644 youtube_dl/extractor/ninecninemedia.py create mode 100644 youtube_dl/extractor/ninegag.py create mode 100644 youtube_dl/extractor/ninenow.py create mode 100644 youtube_dl/extractor/nintendo.py create mode 100644 youtube_dl/extractor/njpwworld.py create mode 100644 youtube_dl/extractor/nobelprize.py create mode 100644 youtube_dl/extractor/noco.py create mode 100644 youtube_dl/extractor/nonktube.py create mode 100644 youtube_dl/extractor/noovo.py create mode 100644 youtube_dl/extractor/normalboots.py create mode 100644 youtube_dl/extractor/nosvideo.py create mode 100644 youtube_dl/extractor/nova.py create mode 100644 youtube_dl/extractor/nowness.py create mode 100644 youtube_dl/extractor/noz.py create mode 100644 youtube_dl/extractor/npo.py create mode 100644 youtube_dl/extractor/npr.py create mode 100644 youtube_dl/extractor/nrk.py create mode 100644 youtube_dl/extractor/nrl.py create mode 100644 youtube_dl/extractor/ntvcojp.py create mode 100644 youtube_dl/extractor/ntvde.py create mode 100644 youtube_dl/extractor/ntvru.py create mode 100644 youtube_dl/extractor/nuevo.py create mode 100644 youtube_dl/extractor/nuvid.py create mode 100644 youtube_dl/extractor/nytimes.py create mode 100644 youtube_dl/extractor/nzz.py create mode 100644 youtube_dl/extractor/odatv.py create mode 100644 youtube_dl/extractor/odnoklassniki.py create mode 100644 youtube_dl/extractor/oktoberfesttv.py create mode 100644 youtube_dl/extractor/once.py create mode 100644 youtube_dl/extractor/ondemandkorea.py create mode 100644 youtube_dl/extractor/onet.py create mode 100644 youtube_dl/extractor/onionstudios.py create mode 100644 youtube_dl/extractor/ooyala.py create mode 100644 youtube_dl/extractor/openload.py create mode 100644 youtube_dl/extractor/ora.py create mode 100644 youtube_dl/extractor/orf.py create mode 100644 youtube_dl/extractor/outsidetv.py create mode 100644 youtube_dl/extractor/packtpub.py create mode 100644 youtube_dl/extractor/pandoratv.py create mode 100644 youtube_dl/extractor/parliamentliveuk.py create mode 100644 youtube_dl/extractor/patreon.py create mode 100644 youtube_dl/extractor/pbs.py create mode 100644 youtube_dl/extractor/pearvideo.py create mode 100644 youtube_dl/extractor/peertube.py create mode 100644 youtube_dl/extractor/people.py create mode 100644 youtube_dl/extractor/performgroup.py create mode 100644 youtube_dl/extractor/periscope.py create mode 100644 youtube_dl/extractor/philharmoniedeparis.py create mode 100644 youtube_dl/extractor/phoenix.py create mode 100644 youtube_dl/extractor/photobucket.py create mode 100644 youtube_dl/extractor/picarto.py create mode 100644 youtube_dl/extractor/piksel.py create mode 100644 youtube_dl/extractor/pinkbike.py create mode 100644 youtube_dl/extractor/pladform.py create mode 100644 youtube_dl/extractor/platzi.py create mode 100644 youtube_dl/extractor/playfm.py create mode 100644 youtube_dl/extractor/playplustv.py create mode 100644 youtube_dl/extractor/plays.py create mode 100644 youtube_dl/extractor/playtvak.py create mode 100644 youtube_dl/extractor/playvid.py create mode 100644 youtube_dl/extractor/playwire.py create mode 100644 youtube_dl/extractor/pluralsight.py create mode 100644 youtube_dl/extractor/podomatic.py create mode 100644 youtube_dl/extractor/pokemon.py create mode 100644 youtube_dl/extractor/polskieradio.py create mode 100644 youtube_dl/extractor/popcorntimes.py create mode 100644 youtube_dl/extractor/popcorntv.py create mode 100644 youtube_dl/extractor/porn91.py create mode 100644 youtube_dl/extractor/porncom.py create mode 100644 youtube_dl/extractor/pornhd.py create mode 100644 youtube_dl/extractor/pornhub.py create mode 100644 youtube_dl/extractor/pornotube.py create mode 100644 youtube_dl/extractor/pornovoisines.py create mode 100644 youtube_dl/extractor/pornoxo.py create mode 100644 youtube_dl/extractor/presstv.py create mode 100644 youtube_dl/extractor/prosiebensat1.py create mode 100644 youtube_dl/extractor/puhutv.py create mode 100644 youtube_dl/extractor/puls4.py create mode 100644 youtube_dl/extractor/pyvideo.py create mode 100644 youtube_dl/extractor/qqmusic.py create mode 100644 youtube_dl/extractor/r7.py create mode 100644 youtube_dl/extractor/radiobremen.py create mode 100644 youtube_dl/extractor/radiocanada.py create mode 100644 youtube_dl/extractor/radiode.py create mode 100644 youtube_dl/extractor/radiofrance.py create mode 100644 youtube_dl/extractor/radiojavan.py create mode 100644 youtube_dl/extractor/rai.py create mode 100644 youtube_dl/extractor/raywenderlich.py create mode 100644 youtube_dl/extractor/rbmaradio.py create mode 100644 youtube_dl/extractor/rds.py create mode 100644 youtube_dl/extractor/redbulltv.py create mode 100644 youtube_dl/extractor/reddit.py create mode 100644 youtube_dl/extractor/redtube.py create mode 100644 youtube_dl/extractor/regiotv.py create mode 100644 youtube_dl/extractor/rentv.py create mode 100644 youtube_dl/extractor/restudy.py create mode 100644 youtube_dl/extractor/reuters.py create mode 100644 youtube_dl/extractor/reverbnation.py create mode 100644 youtube_dl/extractor/rice.py create mode 100644 youtube_dl/extractor/rmcdecouverte.py create mode 100644 youtube_dl/extractor/ro220.py create mode 100644 youtube_dl/extractor/rockstargames.py create mode 100644 youtube_dl/extractor/roosterteeth.py create mode 100644 youtube_dl/extractor/rottentomatoes.py create mode 100644 youtube_dl/extractor/roxwel.py create mode 100644 youtube_dl/extractor/rozhlas.py create mode 100644 youtube_dl/extractor/rtbf.py create mode 100644 youtube_dl/extractor/rte.py create mode 100644 youtube_dl/extractor/rtl2.py create mode 100644 youtube_dl/extractor/rtlnl.py create mode 100644 youtube_dl/extractor/rtp.py create mode 100644 youtube_dl/extractor/rts.py create mode 100644 youtube_dl/extractor/rtve.py create mode 100644 youtube_dl/extractor/rtvnh.py create mode 100644 youtube_dl/extractor/rtvs.py create mode 100644 youtube_dl/extractor/ruhd.py create mode 100644 youtube_dl/extractor/rutube.py create mode 100644 youtube_dl/extractor/rutv.py create mode 100644 youtube_dl/extractor/ruutu.py create mode 100644 youtube_dl/extractor/ruv.py create mode 100644 youtube_dl/extractor/safari.py create mode 100644 youtube_dl/extractor/sapo.py create mode 100644 youtube_dl/extractor/savefrom.py create mode 100644 youtube_dl/extractor/sbs.py create mode 100644 youtube_dl/extractor/screencast.py create mode 100644 youtube_dl/extractor/screencastomatic.py create mode 100644 youtube_dl/extractor/scrippsnetworks.py create mode 100644 youtube_dl/extractor/scte.py create mode 100644 youtube_dl/extractor/seeker.py create mode 100644 youtube_dl/extractor/senateisvp.py create mode 100644 youtube_dl/extractor/sendtonews.py create mode 100644 youtube_dl/extractor/servus.py create mode 100644 youtube_dl/extractor/sevenplus.py create mode 100644 youtube_dl/extractor/sexu.py create mode 100644 youtube_dl/extractor/seznamzpravy.py create mode 100644 youtube_dl/extractor/shahid.py create mode 100644 youtube_dl/extractor/shared.py create mode 100644 youtube_dl/extractor/showroomlive.py create mode 100644 youtube_dl/extractor/sina.py create mode 100644 youtube_dl/extractor/sixplay.py create mode 100644 youtube_dl/extractor/sky.py create mode 100644 youtube_dl/extractor/skylinewebcams.py create mode 100644 youtube_dl/extractor/skynewsarabia.py create mode 100644 youtube_dl/extractor/slideshare.py create mode 100644 youtube_dl/extractor/slideslive.py create mode 100644 youtube_dl/extractor/slutload.py create mode 100644 youtube_dl/extractor/smotri.py create mode 100644 youtube_dl/extractor/snotr.py create mode 100644 youtube_dl/extractor/sohu.py create mode 100644 youtube_dl/extractor/sonyliv.py create mode 100644 youtube_dl/extractor/soundcloud.py create mode 100644 youtube_dl/extractor/soundgasm.py create mode 100644 youtube_dl/extractor/southpark.py create mode 100644 youtube_dl/extractor/spankbang.py create mode 100644 youtube_dl/extractor/spankwire.py create mode 100644 youtube_dl/extractor/spiegel.py create mode 100644 youtube_dl/extractor/spiegeltv.py create mode 100644 youtube_dl/extractor/spike.py create mode 100644 youtube_dl/extractor/sport5.py create mode 100644 youtube_dl/extractor/sportbox.py create mode 100644 youtube_dl/extractor/sportdeutschland.py create mode 100644 youtube_dl/extractor/springboardplatform.py create mode 100644 youtube_dl/extractor/sprout.py create mode 100644 youtube_dl/extractor/srgssr.py create mode 100644 youtube_dl/extractor/srmediathek.py create mode 100644 youtube_dl/extractor/stanfordoc.py create mode 100644 youtube_dl/extractor/steam.py create mode 100644 youtube_dl/extractor/stitcher.py create mode 100644 youtube_dl/extractor/storyfire.py create mode 100644 youtube_dl/extractor/streamable.py create mode 100644 youtube_dl/extractor/streamcloud.py create mode 100644 youtube_dl/extractor/streamcz.py create mode 100644 youtube_dl/extractor/streetvoice.py create mode 100644 youtube_dl/extractor/stretchinternet.py create mode 100644 youtube_dl/extractor/stv.py create mode 100644 youtube_dl/extractor/sunporno.py create mode 100644 youtube_dl/extractor/sverigesradio.py create mode 100644 youtube_dl/extractor/svt.py create mode 100644 youtube_dl/extractor/swrmediathek.py create mode 100644 youtube_dl/extractor/syfy.py create mode 100644 youtube_dl/extractor/sztvhu.py create mode 100644 youtube_dl/extractor/tagesschau.py create mode 100644 youtube_dl/extractor/tass.py create mode 100644 youtube_dl/extractor/tastytrade.py create mode 100644 youtube_dl/extractor/tbs.py create mode 100644 youtube_dl/extractor/tdslifeway.py create mode 100644 youtube_dl/extractor/teachable.py create mode 100644 youtube_dl/extractor/teachertube.py create mode 100644 youtube_dl/extractor/teachingchannel.py create mode 100644 youtube_dl/extractor/teamcoco.py create mode 100644 youtube_dl/extractor/teamtreehouse.py create mode 100644 youtube_dl/extractor/techtalks.py create mode 100644 youtube_dl/extractor/ted.py create mode 100644 youtube_dl/extractor/tele13.py create mode 100644 youtube_dl/extractor/tele5.py create mode 100644 youtube_dl/extractor/telebruxelles.py create mode 100644 youtube_dl/extractor/telecinco.py create mode 100644 youtube_dl/extractor/telegraaf.py create mode 100644 youtube_dl/extractor/telemb.py create mode 100644 youtube_dl/extractor/telequebec.py create mode 100644 youtube_dl/extractor/teletask.py create mode 100644 youtube_dl/extractor/telewebion.py create mode 100644 youtube_dl/extractor/tennistv.py create mode 100644 youtube_dl/extractor/tenplay.py create mode 100644 youtube_dl/extractor/testurl.py create mode 100644 youtube_dl/extractor/tf1.py create mode 100644 youtube_dl/extractor/tfo.py create mode 100644 youtube_dl/extractor/theintercept.py create mode 100644 youtube_dl/extractor/theplatform.py create mode 100644 youtube_dl/extractor/thescene.py create mode 100644 youtube_dl/extractor/thestar.py create mode 100644 youtube_dl/extractor/thesun.py create mode 100644 youtube_dl/extractor/theweatherchannel.py create mode 100644 youtube_dl/extractor/thisamericanlife.py create mode 100644 youtube_dl/extractor/thisav.py create mode 100644 youtube_dl/extractor/thisoldhouse.py create mode 100644 youtube_dl/extractor/threeqsdn.py create mode 100644 youtube_dl/extractor/tiktok.py create mode 100644 youtube_dl/extractor/tinypic.py create mode 100644 youtube_dl/extractor/tmz.py create mode 100644 youtube_dl/extractor/tnaflix.py create mode 100644 youtube_dl/extractor/toggle.py create mode 100644 youtube_dl/extractor/tonline.py create mode 100644 youtube_dl/extractor/toongoggles.py create mode 100644 youtube_dl/extractor/toutv.py create mode 100644 youtube_dl/extractor/toypics.py create mode 100644 youtube_dl/extractor/traileraddict.py create mode 100644 youtube_dl/extractor/trilulilu.py create mode 100644 youtube_dl/extractor/trunews.py create mode 100644 youtube_dl/extractor/trutv.py create mode 100644 youtube_dl/extractor/tube8.py create mode 100644 youtube_dl/extractor/tubitv.py create mode 100644 youtube_dl/extractor/tudou.py create mode 100644 youtube_dl/extractor/tumblr.py create mode 100644 youtube_dl/extractor/tunein.py create mode 100644 youtube_dl/extractor/tunepk.py create mode 100644 youtube_dl/extractor/turbo.py create mode 100644 youtube_dl/extractor/turner.py create mode 100644 youtube_dl/extractor/tv2.py create mode 100644 youtube_dl/extractor/tv2dk.py create mode 100644 youtube_dl/extractor/tv2hu.py create mode 100644 youtube_dl/extractor/tv4.py create mode 100644 youtube_dl/extractor/tv5mondeplus.py create mode 100644 youtube_dl/extractor/tva.py create mode 100644 youtube_dl/extractor/tvanouvelles.py create mode 100644 youtube_dl/extractor/tvc.py create mode 100644 youtube_dl/extractor/tvigle.py create mode 100644 youtube_dl/extractor/tvland.py create mode 100644 youtube_dl/extractor/tvn24.py create mode 100644 youtube_dl/extractor/tvnet.py create mode 100644 youtube_dl/extractor/tvnoe.py create mode 100644 youtube_dl/extractor/tvnow.py create mode 100644 youtube_dl/extractor/tvp.py create mode 100644 youtube_dl/extractor/tvplay.py create mode 100644 youtube_dl/extractor/tvplayer.py create mode 100644 youtube_dl/extractor/tweakers.py create mode 100644 youtube_dl/extractor/twentyfourvideo.py create mode 100644 youtube_dl/extractor/twentymin.py create mode 100644 youtube_dl/extractor/twentythreevideo.py create mode 100644 youtube_dl/extractor/twitcasting.py create mode 100644 youtube_dl/extractor/twitch.py create mode 100644 youtube_dl/extractor/twitter.py create mode 100644 youtube_dl/extractor/udemy.py create mode 100644 youtube_dl/extractor/udn.py create mode 100644 youtube_dl/extractor/ufctv.py create mode 100644 youtube_dl/extractor/uktvplay.py create mode 100644 youtube_dl/extractor/umg.py create mode 100644 youtube_dl/extractor/unistra.py create mode 100644 youtube_dl/extractor/unity.py create mode 100644 youtube_dl/extractor/uol.py create mode 100644 youtube_dl/extractor/uplynk.py create mode 100644 youtube_dl/extractor/urort.py create mode 100644 youtube_dl/extractor/urplay.py create mode 100644 youtube_dl/extractor/usanetwork.py create mode 100644 youtube_dl/extractor/usatoday.py create mode 100644 youtube_dl/extractor/ustream.py create mode 100644 youtube_dl/extractor/ustudio.py create mode 100644 youtube_dl/extractor/varzesh3.py create mode 100644 youtube_dl/extractor/vbox7.py create mode 100644 youtube_dl/extractor/veehd.py create mode 100644 youtube_dl/extractor/veoh.py create mode 100644 youtube_dl/extractor/vesti.py create mode 100644 youtube_dl/extractor/vevo.py create mode 100644 youtube_dl/extractor/vgtv.py create mode 100644 youtube_dl/extractor/vh1.py create mode 100644 youtube_dl/extractor/vice.py create mode 100644 youtube_dl/extractor/vidbit.py create mode 100644 youtube_dl/extractor/viddler.py create mode 100644 youtube_dl/extractor/videa.py create mode 100644 youtube_dl/extractor/videodetective.py create mode 100644 youtube_dl/extractor/videofyme.py create mode 100644 youtube_dl/extractor/videomore.py create mode 100644 youtube_dl/extractor/videopress.py create mode 100644 youtube_dl/extractor/vidio.py create mode 100644 youtube_dl/extractor/vidlii.py create mode 100644 youtube_dl/extractor/vidme.py create mode 100644 youtube_dl/extractor/vidzi.py create mode 100644 youtube_dl/extractor/vier.py create mode 100644 youtube_dl/extractor/viewlift.py create mode 100644 youtube_dl/extractor/viidea.py create mode 100644 youtube_dl/extractor/viki.py create mode 100644 youtube_dl/extractor/vimeo.py create mode 100644 youtube_dl/extractor/vimple.py create mode 100644 youtube_dl/extractor/vine.py create mode 100644 youtube_dl/extractor/viqeo.py create mode 100644 youtube_dl/extractor/viu.py create mode 100644 youtube_dl/extractor/vk.py create mode 100644 youtube_dl/extractor/vlive.py create mode 100644 youtube_dl/extractor/vodlocker.py create mode 100644 youtube_dl/extractor/vodpl.py create mode 100644 youtube_dl/extractor/vodplatform.py create mode 100644 youtube_dl/extractor/voicerepublic.py create mode 100644 youtube_dl/extractor/voot.py create mode 100644 youtube_dl/extractor/voxmedia.py create mode 100644 youtube_dl/extractor/vrak.py create mode 100644 youtube_dl/extractor/vrt.py create mode 100644 youtube_dl/extractor/vrv.py create mode 100644 youtube_dl/extractor/vshare.py create mode 100644 youtube_dl/extractor/vube.py create mode 100644 youtube_dl/extractor/vuclip.py create mode 100644 youtube_dl/extractor/vvvvid.py create mode 100644 youtube_dl/extractor/vyborymos.py create mode 100644 youtube_dl/extractor/vzaar.py create mode 100644 youtube_dl/extractor/wakanim.py create mode 100644 youtube_dl/extractor/walla.py create mode 100644 youtube_dl/extractor/washingtonpost.py create mode 100644 youtube_dl/extractor/wat.py create mode 100644 youtube_dl/extractor/watchbox.py create mode 100644 youtube_dl/extractor/watchindianporn.py create mode 100644 youtube_dl/extractor/wdr.py create mode 100644 youtube_dl/extractor/webcaster.py create mode 100644 youtube_dl/extractor/webofstories.py create mode 100644 youtube_dl/extractor/weibo.py create mode 100644 youtube_dl/extractor/weiqitv.py create mode 100644 youtube_dl/extractor/wistia.py create mode 100644 youtube_dl/extractor/worldstarhiphop.py create mode 100644 youtube_dl/extractor/wsj.py create mode 100644 youtube_dl/extractor/wwe.py create mode 100644 youtube_dl/extractor/xbef.py create mode 100644 youtube_dl/extractor/xboxclips.py create mode 100644 youtube_dl/extractor/xfileshare.py create mode 100644 youtube_dl/extractor/xhamster.py create mode 100644 youtube_dl/extractor/xiami.py create mode 100644 youtube_dl/extractor/ximalaya.py create mode 100644 youtube_dl/extractor/xminus.py create mode 100644 youtube_dl/extractor/xnxx.py create mode 100644 youtube_dl/extractor/xstream.py create mode 100644 youtube_dl/extractor/xtube.py create mode 100644 youtube_dl/extractor/xuite.py create mode 100644 youtube_dl/extractor/xvideos.py create mode 100644 youtube_dl/extractor/xxxymovies.py create mode 100644 youtube_dl/extractor/yahoo.py create mode 100644 youtube_dl/extractor/yandexdisk.py create mode 100644 youtube_dl/extractor/yandexmusic.py create mode 100644 youtube_dl/extractor/yandexvideo.py create mode 100644 youtube_dl/extractor/yapfiles.py create mode 100644 youtube_dl/extractor/yesjapan.py create mode 100644 youtube_dl/extractor/yinyuetai.py create mode 100644 youtube_dl/extractor/ynet.py create mode 100644 youtube_dl/extractor/youjizz.py create mode 100644 youtube_dl/extractor/youku.py create mode 100644 youtube_dl/extractor/younow.py create mode 100644 youtube_dl/extractor/youporn.py create mode 100644 youtube_dl/extractor/yourporn.py create mode 100644 youtube_dl/extractor/yourupload.py create mode 100644 youtube_dl/extractor/youtube.py create mode 100644 youtube_dl/extractor/zapiks.py create mode 100644 youtube_dl/extractor/zaq1.py create mode 100644 youtube_dl/extractor/zattoo.py create mode 100644 youtube_dl/extractor/zdf.py create mode 100644 youtube_dl/extractor/zingmp3.py create mode 100644 youtube_dl/extractor/zype.py create mode 100644 youtube_dl/jsinterp.py create mode 100644 youtube_dl/options.py create mode 100644 youtube_dl/postprocessor/__init__.py create mode 100644 youtube_dl/postprocessor/common.py create mode 100644 youtube_dl/postprocessor/embedthumbnail.py create mode 100644 youtube_dl/postprocessor/execafterdownload.py create mode 100644 youtube_dl/postprocessor/ffmpeg.py create mode 100644 youtube_dl/postprocessor/metadatafromtitle.py create mode 100644 youtube_dl/postprocessor/xattrpp.py create mode 100644 youtube_dl/socks.py create mode 100644 youtube_dl/swfinterp.py create mode 100644 youtube_dl/update.py create mode 100644 youtube_dl/utils.py create mode 100644 youtube_dl/version.py diff --git a/.travis.yml b/.travis.yml index fb499845e..c53c77e07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,4 +35,7 @@ jobs: - env: JYTHON=true; YTDL_TEST_SET=core before_install: - if [ "$JYTHON" == "true" ]; then ./devscripts/install_jython.sh; export PATH="$HOME/jython/bin:$PATH"; fi +before_script: + - rm -rf /youtube_dlc/* + - cp /youtube_dl/* /youtube_dlc script: ./devscripts/run_tests.sh diff --git a/setup.py b/setup.py index ac56e4995..f5f0bae62 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ setup( long_description=LONG_DESCRIPTION, # long_description_content_type="text/markdown", url="https://github.com/blackjack4494/youtube-dlc", - packages=find_packages(), + packages=find_packages(exclude=("youtube_dl",)), #packages=[ # 'youtube_dlc', # 'youtube_dlc.extractor', 'youtube_dlc.downloader', diff --git a/youtube-dlc.spec b/youtube-dlc.spec new file mode 100644 index 000000000..d2f4ca453 --- /dev/null +++ b/youtube-dlc.spec @@ -0,0 +1,33 @@ +# -*- mode: python ; coding: utf-8 -*- + +block_cipher = None + + +a = Analysis(['youtube_dlc\\__main__.py'], + pathex=['D:\\gitkraken\\youtube-dl'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='youtube-dlc', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True ) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py new file mode 100644 index 000000000..f79d31deb --- /dev/null +++ b/youtube_dl/YoutubeDL.py @@ -0,0 +1,2417 @@ +#!/usr/bin/env python +# coding: utf-8 + +from __future__ import absolute_import, unicode_literals + +import collections +import contextlib +import copy +import datetime +import errno +import fileinput +import io +import itertools +import json +import locale +import operator +import os +import platform +import re +import shutil +import subprocess +import socket +import sys +import time +import tokenize +import traceback +import random + +from string import ascii_letters + +from .compat import ( + compat_basestring, + compat_cookiejar, + compat_get_terminal_size, + compat_http_client, + compat_kwargs, + compat_numeric_types, + compat_os_name, + compat_str, + compat_tokenize_tokenize, + compat_urllib_error, + compat_urllib_request, + compat_urllib_request_DataHandler, +) +from .utils import ( + age_restricted, + args_to_str, + ContentTooShortError, + date_from_str, + DateRange, + DEFAULT_OUTTMPL, + determine_ext, + determine_protocol, + DownloadError, + encode_compat_str, + encodeFilename, + error_to_compat_str, + expand_path, + ExtractorError, + format_bytes, + formatSeconds, + GeoRestrictedError, + int_or_none, + ISO3166Utils, + locked_file, + make_HTTPS_handler, + MaxDownloadsReached, + orderedSet, + PagedList, + parse_filesize, + PerRequestProxyHandler, + platform_name, + PostProcessingError, + preferredencoding, + prepend_extension, + register_socks_protocols, + render_table, + replace_extension, + SameFileError, + sanitize_filename, + sanitize_path, + sanitize_url, + sanitized_Request, + std_headers, + str_or_none, + subtitles_filename, + UnavailableVideoError, + url_basename, + version_tuple, + write_json_file, + write_string, + YoutubeDLCookieJar, + YoutubeDLCookieProcessor, + YoutubeDLHandler, + YoutubeDLRedirectHandler, +) +from .cache import Cache +from .extractor import get_info_extractor, gen_extractor_classes, _LAZY_LOADER +from .extractor.openload import PhantomJSwrapper +from .downloader import get_suitable_downloader +from .downloader.rtmp import rtmpdump_version +from .postprocessor import ( + FFmpegFixupM3u8PP, + FFmpegFixupM4aPP, + FFmpegFixupStretchedPP, + FFmpegMergerPP, + FFmpegPostProcessor, + get_postprocessor, +) +from .version import __version__ + +if compat_os_name == 'nt': + import ctypes + + +class YoutubeDL(object): + """YoutubeDL class. + + YoutubeDL objects are the ones responsible of downloading the + actual video file and writing it to disk if the user has requested + it, among some other tasks. In most cases there should be one per + program. As, given a video URL, the downloader doesn't know how to + extract all the needed information, task that InfoExtractors do, it + has to pass the URL to one of them. + + For this, YoutubeDL objects have a method that allows + InfoExtractors to be registered in a given order. When it is passed + a URL, the YoutubeDL object handles it to the first InfoExtractor it + finds that reports being able to handle it. The InfoExtractor extracts + all the information about the video or videos the URL refers to, and + YoutubeDL process the extracted information, possibly using a File + Downloader to download the video. + + YoutubeDL objects accept a lot of parameters. In order not to saturate + the object constructor with arguments, it receives a dictionary of + options instead. These options are available through the params + attribute for the InfoExtractors to use. The YoutubeDL also + registers itself as the downloader in charge for the InfoExtractors + that are added to it, so this is a "mutual registration". + + Available options: + + username: Username for authentication purposes. + password: Password for authentication purposes. + videopassword: Password for accessing a video. + ap_mso: Adobe Pass multiple-system operator identifier. + ap_username: Multiple-system operator account username. + ap_password: Multiple-system operator account password. + usenetrc: Use netrc for authentication instead. + verbose: Print additional info to stdout. + quiet: Do not print messages to stdout. + no_warnings: Do not print out anything for warnings. + forceurl: Force printing final URL. + forcetitle: Force printing title. + forceid: Force printing ID. + forcethumbnail: Force printing thumbnail URL. + forcedescription: Force printing description. + forcefilename: Force printing final filename. + forceduration: Force printing duration. + forcejson: Force printing info_dict as JSON. + dump_single_json: Force printing the info_dict of the whole playlist + (or video) as a single JSON line. + simulate: Do not download the video files. + format: Video format code. See options.py for more information. + outtmpl: Template for output names. + restrictfilenames: Do not allow "&" and spaces in file names + ignoreerrors: Do not stop on download errors. + force_generic_extractor: Force downloader to use the generic extractor + nooverwrites: Prevent overwriting files. + playliststart: Playlist item to start at. + playlistend: Playlist item to end at. + playlist_items: Specific indices of playlist to download. + playlistreverse: Download playlist items in reverse order. + playlistrandom: Download playlist items in random order. + matchtitle: Download only matching titles. + rejecttitle: Reject downloads for matching titles. + logger: Log messages to a logging.Logger instance. + logtostderr: Log messages to stderr instead of stdout. + writedescription: Write the video description to a .description file + writeinfojson: Write the video description to a .info.json file + writeannotations: Write the video annotations to a .annotations.xml file + writethumbnail: Write the thumbnail image to a file + write_all_thumbnails: Write all thumbnail formats to files + writesubtitles: Write the video subtitles to a file + writeautomaticsub: Write the automatically generated subtitles to a file + allsubtitles: Downloads all the subtitles of the video + (requires writesubtitles or writeautomaticsub) + listsubtitles: Lists all available subtitles for the video + subtitlesformat: The format code for subtitles + subtitleslangs: List of languages of the subtitles to download + keepvideo: Keep the video file after post-processing + daterange: A DateRange object, download only if the upload_date is in the range. + skip_download: Skip the actual download of the video file + cachedir: Location of the cache files in the filesystem. + False to disable filesystem cache. + noplaylist: Download single video instead of a playlist if in doubt. + age_limit: An integer representing the user's age in years. + Unsuitable videos for the given age are skipped. + min_views: An integer representing the minimum view count the video + must have in order to not be skipped. + Videos without view count information are always + downloaded. None for no limit. + max_views: An integer representing the maximum view count. + Videos that are more popular than that are not + downloaded. + Videos without view count information are always + downloaded. None for no limit. + download_archive: File name of a file where all downloads are recorded. + Videos already present in the file are not downloaded + again. + cookiefile: File name where cookies should be read from and dumped to. + nocheckcertificate:Do not verify SSL certificates + prefer_insecure: Use HTTP instead of HTTPS to retrieve information. + At the moment, this is only supported by YouTube. + proxy: URL of the proxy server to use + geo_verification_proxy: URL of the proxy to use for IP address verification + on geo-restricted sites. + socket_timeout: Time to wait for unresponsive hosts, in seconds + bidi_workaround: Work around buggy terminals without bidirectional text + support, using fridibi + debug_printtraffic:Print out sent and received HTTP traffic + include_ads: Download ads as well + default_search: Prepend this string if an input url is not valid. + 'auto' for elaborate guessing + encoding: Use this encoding instead of the system-specified. + extract_flat: Do not resolve URLs, return the immediate result. + Pass in 'in_playlist' to only show this behavior for + playlist items. + postprocessors: A list of dictionaries, each with an entry + * key: The name of the postprocessor. See + youtube_dlc/postprocessor/__init__.py for a list. + as well as any further keyword arguments for the + postprocessor. + progress_hooks: A list of functions that get called on download + progress, with a dictionary with the entries + * status: One of "downloading", "error", or "finished". + Check this first and ignore unknown values. + + If status is one of "downloading", or "finished", the + following properties may also be present: + * filename: The final filename (always present) + * tmpfilename: The filename we're currently writing to + * downloaded_bytes: Bytes on disk + * total_bytes: Size of the whole file, None if unknown + * total_bytes_estimate: Guess of the eventual file size, + None if unavailable. + * elapsed: The number of seconds since download started. + * eta: The estimated time in seconds, None if unknown + * speed: The download speed in bytes/second, None if + unknown + * fragment_index: The counter of the currently + downloaded video fragment. + * fragment_count: The number of fragments (= individual + files that will be merged) + + Progress hooks are guaranteed to be called at least once + (with status "finished") if the download is successful. + merge_output_format: Extension to use when merging formats. + fixup: Automatically correct known faults of the file. + One of: + - "never": do nothing + - "warn": only emit a warning + - "detect_or_warn": check whether we can do anything + about it, warn otherwise (default) + source_address: Client-side IP address to bind to. + call_home: Boolean, true iff we are allowed to contact the + youtube-dlc servers for debugging. + sleep_interval: Number of seconds to sleep before each download when + used alone or a lower bound of a range for randomized + sleep before each download (minimum possible number + of seconds to sleep) when used along with + max_sleep_interval. + max_sleep_interval:Upper bound of a range for randomized sleep before each + download (maximum possible number of seconds to sleep). + Must only be used along with sleep_interval. + Actual sleep time will be a random float from range + [sleep_interval; max_sleep_interval]. + listformats: Print an overview of available video formats and exit. + list_thumbnails: Print a table of all thumbnails and exit. + match_filter: A function that gets called with the info_dict of + every video. + If it returns a message, the video is ignored. + If it returns None, the video is downloaded. + match_filter_func in utils.py is one example for this. + no_color: Do not emit color codes in output. + geo_bypass: Bypass geographic restriction via faking X-Forwarded-For + HTTP header + geo_bypass_country: + Two-letter ISO 3166-2 country code that will be used for + explicit geographic restriction bypassing via faking + X-Forwarded-For HTTP header + geo_bypass_ip_block: + IP range in CIDR notation that will be used similarly to + geo_bypass_country + + The following options determine which downloader is picked: + external_downloader: Executable of the external downloader to call. + None or unset for standard (built-in) downloader. + hls_prefer_native: Use the native HLS downloader instead of ffmpeg/avconv + if True, otherwise use ffmpeg/avconv if False, otherwise + use downloader suggested by extractor if None. + + The following parameters are not used by YoutubeDL itself, they are used by + the downloader (see youtube_dlc/downloader/common.py): + nopart, updatetime, buffersize, ratelimit, min_filesize, max_filesize, test, + noresizebuffer, retries, continuedl, noprogress, consoletitle, + xattr_set_filesize, external_downloader_args, hls_use_mpegts, + http_chunk_size. + + The following options are used by the post processors: + prefer_ffmpeg: If False, use avconv instead of ffmpeg if both are available, + otherwise prefer ffmpeg. + ffmpeg_location: Location of the ffmpeg/avconv binary; either the path + to the binary or its containing directory. + postprocessor_args: A list of additional command-line arguments for the + postprocessor. + + The following options are used by the Youtube extractor: + youtube_include_dash_manifest: If True (default), DASH manifests and related + data will be downloaded and processed by extractor. + You can reduce network I/O by disabling it if you don't + care about DASH. + """ + + _NUMERIC_FIELDS = set(( + 'width', 'height', 'tbr', 'abr', 'asr', 'vbr', 'fps', 'filesize', 'filesize_approx', + 'timestamp', 'upload_year', 'upload_month', 'upload_day', + 'duration', 'view_count', 'like_count', 'dislike_count', 'repost_count', + 'average_rating', 'comment_count', 'age_limit', + 'start_time', 'end_time', + 'chapter_number', 'season_number', 'episode_number', + 'track_number', 'disc_number', 'release_year', + 'playlist_index', + )) + + params = None + _ies = [] + _pps = [] + _download_retcode = None + _num_downloads = None + _screen_file = None + + def __init__(self, params=None, auto_init=True): + """Create a FileDownloader object with the given options.""" + if params is None: + params = {} + self._ies = [] + self._ies_instances = {} + self._pps = [] + self._progress_hooks = [] + self._download_retcode = 0 + self._num_downloads = 0 + self._screen_file = [sys.stdout, sys.stderr][params.get('logtostderr', False)] + self._err_file = sys.stderr + self.params = { + # Default parameters + 'nocheckcertificate': False, + } + self.params.update(params) + self.cache = Cache(self) + + def check_deprecated(param, option, suggestion): + if self.params.get(param) is not None: + self.report_warning( + '%s is deprecated. Use %s instead.' % (option, suggestion)) + return True + return False + + if check_deprecated('cn_verification_proxy', '--cn-verification-proxy', '--geo-verification-proxy'): + if self.params.get('geo_verification_proxy') is None: + self.params['geo_verification_proxy'] = self.params['cn_verification_proxy'] + + check_deprecated('autonumber_size', '--autonumber-size', 'output template with %(autonumber)0Nd, where N in the number of digits') + check_deprecated('autonumber', '--auto-number', '-o "%(autonumber)s-%(title)s.%(ext)s"') + check_deprecated('usetitle', '--title', '-o "%(title)s-%(id)s.%(ext)s"') + + if params.get('bidi_workaround', False): + try: + import pty + master, slave = pty.openpty() + width = compat_get_terminal_size().columns + if width is None: + width_args = [] + else: + width_args = ['-w', str(width)] + sp_kwargs = dict( + stdin=subprocess.PIPE, + stdout=slave, + stderr=self._err_file) + try: + self._output_process = subprocess.Popen( + ['bidiv'] + width_args, **sp_kwargs + ) + except OSError: + self._output_process = subprocess.Popen( + ['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs) + self._output_channel = os.fdopen(master, 'rb') + except OSError as ose: + if ose.errno == errno.ENOENT: + self.report_warning('Could not find fribidi executable, ignoring --bidi-workaround . Make sure that fribidi is an executable file in one of the directories in your $PATH.') + else: + raise + + if (sys.platform != 'win32' + and sys.getfilesystemencoding() in ['ascii', 'ANSI_X3.4-1968'] + and not params.get('restrictfilenames', False)): + # Unicode filesystem API will throw errors (#1474, #13027) + self.report_warning( + 'Assuming --restrict-filenames since file system encoding ' + 'cannot encode all characters. ' + 'Set the LC_ALL environment variable to fix this.') + self.params['restrictfilenames'] = True + + if isinstance(params.get('outtmpl'), bytes): + self.report_warning( + 'Parameter outtmpl is bytes, but should be a unicode string. ' + 'Put from __future__ import unicode_literals at the top of your code file or consider switching to Python 3.x.') + + self._setup_opener() + + if auto_init: + self.print_debug_header() + self.add_default_info_extractors() + + for pp_def_raw in self.params.get('postprocessors', []): + pp_class = get_postprocessor(pp_def_raw['key']) + pp_def = dict(pp_def_raw) + del pp_def['key'] + pp = pp_class(self, **compat_kwargs(pp_def)) + self.add_post_processor(pp) + + for ph in self.params.get('progress_hooks', []): + self.add_progress_hook(ph) + + register_socks_protocols() + + def warn_if_short_id(self, argv): + # short YouTube ID starting with dash? + idxs = [ + i for i, a in enumerate(argv) + if re.match(r'^-[0-9A-Za-z_-]{10}$', a)] + if idxs: + correct_argv = ( + ['youtube-dlc'] + + [a for i, a in enumerate(argv) if i not in idxs] + + ['--'] + [argv[i] for i in idxs] + ) + self.report_warning( + 'Long argument string detected. ' + 'Use -- to separate parameters and URLs, like this:\n%s\n' % + args_to_str(correct_argv)) + + def add_info_extractor(self, ie): + """Add an InfoExtractor object to the end of the list.""" + self._ies.append(ie) + if not isinstance(ie, type): + self._ies_instances[ie.ie_key()] = ie + ie.set_downloader(self) + + def get_info_extractor(self, ie_key): + """ + Get an instance of an IE with name ie_key, it will try to get one from + the _ies list, if there's no instance it will create a new one and add + it to the extractor list. + """ + ie = self._ies_instances.get(ie_key) + if ie is None: + ie = get_info_extractor(ie_key)() + self.add_info_extractor(ie) + return ie + + def add_default_info_extractors(self): + """ + Add the InfoExtractors returned by gen_extractors to the end of the list + """ + for ie in gen_extractor_classes(): + self.add_info_extractor(ie) + + def add_post_processor(self, pp): + """Add a PostProcessor object to the end of the chain.""" + self._pps.append(pp) + pp.set_downloader(self) + + def add_progress_hook(self, ph): + """Add the progress hook (currently only for the file downloader)""" + self._progress_hooks.append(ph) + + def _bidi_workaround(self, message): + if not hasattr(self, '_output_channel'): + return message + + assert hasattr(self, '_output_process') + assert isinstance(message, compat_str) + line_count = message.count('\n') + 1 + self._output_process.stdin.write((message + '\n').encode('utf-8')) + self._output_process.stdin.flush() + res = ''.join(self._output_channel.readline().decode('utf-8') + for _ in range(line_count)) + return res[:-len('\n')] + + def to_screen(self, message, skip_eol=False): + """Print message to stdout if not in quiet mode.""" + return self.to_stdout(message, skip_eol, check_quiet=True) + + def _write_string(self, s, out=None): + write_string(s, out=out, encoding=self.params.get('encoding')) + + def to_stdout(self, message, skip_eol=False, check_quiet=False): + """Print message to stdout if not in quiet mode.""" + if self.params.get('logger'): + self.params['logger'].debug(message) + elif not check_quiet or not self.params.get('quiet', False): + message = self._bidi_workaround(message) + terminator = ['\n', ''][skip_eol] + output = message + terminator + + self._write_string(output, self._screen_file) + + def to_stderr(self, message): + """Print message to stderr.""" + assert isinstance(message, compat_str) + if self.params.get('logger'): + self.params['logger'].error(message) + else: + message = self._bidi_workaround(message) + output = message + '\n' + self._write_string(output, self._err_file) + + def to_console_title(self, message): + if not self.params.get('consoletitle', False): + return + if compat_os_name == 'nt': + if ctypes.windll.kernel32.GetConsoleWindow(): + # c_wchar_p() might not be necessary if `message` is + # already of type unicode() + ctypes.windll.kernel32.SetConsoleTitleW(ctypes.c_wchar_p(message)) + elif 'TERM' in os.environ: + self._write_string('\033]0;%s\007' % message, self._screen_file) + + def save_console_title(self): + if not self.params.get('consoletitle', False): + return + if self.params.get('simulate', False): + return + if compat_os_name != 'nt' and 'TERM' in os.environ: + # Save the title on stack + self._write_string('\033[22;0t', self._screen_file) + + def restore_console_title(self): + if not self.params.get('consoletitle', False): + return + if self.params.get('simulate', False): + return + if compat_os_name != 'nt' and 'TERM' in os.environ: + # Restore the title from stack + self._write_string('\033[23;0t', self._screen_file) + + def __enter__(self): + self.save_console_title() + return self + + def __exit__(self, *args): + self.restore_console_title() + + if self.params.get('cookiefile') is not None: + self.cookiejar.save(ignore_discard=True, ignore_expires=True) + + def trouble(self, message=None, tb=None): + """Determine action to take when a download problem appears. + + Depending on if the downloader has been configured to ignore + download errors or not, this method may throw an exception or + not when errors are found, after printing the message. + + tb, if given, is additional traceback information. + """ + if message is not None: + self.to_stderr(message) + if self.params.get('verbose'): + if tb is None: + if sys.exc_info()[0]: # if .trouble has been called from an except block + tb = '' + if hasattr(sys.exc_info()[1], 'exc_info') and sys.exc_info()[1].exc_info[0]: + tb += ''.join(traceback.format_exception(*sys.exc_info()[1].exc_info)) + tb += encode_compat_str(traceback.format_exc()) + else: + tb_data = traceback.format_list(traceback.extract_stack()) + tb = ''.join(tb_data) + self.to_stderr(tb) + if not self.params.get('ignoreerrors', False): + if sys.exc_info()[0] and hasattr(sys.exc_info()[1], 'exc_info') and sys.exc_info()[1].exc_info[0]: + exc_info = sys.exc_info()[1].exc_info + else: + exc_info = sys.exc_info() + raise DownloadError(message, exc_info) + self._download_retcode = 1 + + def report_warning(self, message): + ''' + Print the message to stderr, it will be prefixed with 'WARNING:' + If stderr is a tty file the 'WARNING:' will be colored + ''' + if self.params.get('logger') is not None: + self.params['logger'].warning(message) + else: + if self.params.get('no_warnings'): + return + if not self.params.get('no_color') and self._err_file.isatty() and compat_os_name != 'nt': + _msg_header = '\033[0;33mWARNING:\033[0m' + else: + _msg_header = 'WARNING:' + warning_message = '%s %s' % (_msg_header, message) + self.to_stderr(warning_message) + + def report_error(self, message, tb=None): + ''' + Do the same as trouble, but prefixes the message with 'ERROR:', colored + in red if stderr is a tty file. + ''' + if not self.params.get('no_color') and self._err_file.isatty() and compat_os_name != 'nt': + _msg_header = '\033[0;31mERROR:\033[0m' + else: + _msg_header = 'ERROR:' + error_message = '%s %s' % (_msg_header, message) + self.trouble(error_message, tb) + + def report_file_already_downloaded(self, file_name): + """Report file has already been fully downloaded.""" + try: + self.to_screen('[download] %s has already been downloaded' % file_name) + except UnicodeEncodeError: + self.to_screen('[download] The file has already been downloaded') + + def prepare_filename(self, info_dict): + """Generate the output filename.""" + try: + template_dict = dict(info_dict) + + template_dict['epoch'] = int(time.time()) + autonumber_size = self.params.get('autonumber_size') + if autonumber_size is None: + autonumber_size = 5 + template_dict['autonumber'] = self.params.get('autonumber_start', 1) - 1 + self._num_downloads + if template_dict.get('resolution') is None: + if template_dict.get('width') and template_dict.get('height'): + template_dict['resolution'] = '%dx%d' % (template_dict['width'], template_dict['height']) + elif template_dict.get('height'): + template_dict['resolution'] = '%sp' % template_dict['height'] + elif template_dict.get('width'): + template_dict['resolution'] = '%dx?' % template_dict['width'] + + sanitize = lambda k, v: sanitize_filename( + compat_str(v), + restricted=self.params.get('restrictfilenames'), + is_id=(k == 'id' or k.endswith('_id'))) + template_dict = dict((k, v if isinstance(v, compat_numeric_types) else sanitize(k, v)) + for k, v in template_dict.items() + if v is not None and not isinstance(v, (list, tuple, dict))) + template_dict = collections.defaultdict(lambda: 'NA', template_dict) + + outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL) + + # For fields playlist_index and autonumber convert all occurrences + # of %(field)s to %(field)0Nd for backward compatibility + field_size_compat_map = { + 'playlist_index': len(str(template_dict['n_entries'])), + 'autonumber': autonumber_size, + } + FIELD_SIZE_COMPAT_RE = r'(?<!%)%\((?P<field>autonumber|playlist_index)\)s' + mobj = re.search(FIELD_SIZE_COMPAT_RE, outtmpl) + if mobj: + outtmpl = re.sub( + FIELD_SIZE_COMPAT_RE, + r'%%(\1)0%dd' % field_size_compat_map[mobj.group('field')], + outtmpl) + + # Missing numeric fields used together with integer presentation types + # in format specification will break the argument substitution since + # string 'NA' is returned for missing fields. We will patch output + # template for missing fields to meet string presentation type. + for numeric_field in self._NUMERIC_FIELDS: + if numeric_field not in template_dict: + # As of [1] format syntax is: + # %[mapping_key][conversion_flags][minimum_width][.precision][length_modifier]type + # 1. https://docs.python.org/2/library/stdtypes.html#string-formatting + FORMAT_RE = r'''(?x) + (?<!%) + % + \({0}\) # mapping key + (?:[#0\-+ ]+)? # conversion flags (optional) + (?:\d+)? # minimum field width (optional) + (?:\.\d+)? # precision (optional) + [hlL]? # length modifier (optional) + [diouxXeEfFgGcrs%] # conversion type + ''' + outtmpl = re.sub( + FORMAT_RE.format(numeric_field), + r'%({0})s'.format(numeric_field), outtmpl) + + # expand_path translates '%%' into '%' and '$$' into '$' + # correspondingly that is not what we want since we need to keep + # '%%' intact for template dict substitution step. Working around + # with boundary-alike separator hack. + sep = ''.join([random.choice(ascii_letters) for _ in range(32)]) + outtmpl = outtmpl.replace('%%', '%{0}%'.format(sep)).replace('$$', '${0}$'.format(sep)) + + # outtmpl should be expand_path'ed before template dict substitution + # because meta fields may contain env variables we don't want to + # be expanded. For example, for outtmpl "%(title)s.%(ext)s" and + # title "Hello $PATH", we don't want `$PATH` to be expanded. + filename = expand_path(outtmpl).replace(sep, '') % template_dict + + # Temporary fix for #4787 + # 'Treat' all problem characters by passing filename through preferredencoding + # to workaround encoding issues with subprocess on python2 @ Windows + if sys.version_info < (3, 0) and sys.platform == 'win32': + filename = encodeFilename(filename, True).decode(preferredencoding()) + return sanitize_path(filename) + except ValueError as err: + self.report_error('Error in output template: ' + str(err) + ' (encoding: ' + repr(preferredencoding()) + ')') + return None + + def _match_entry(self, info_dict, incomplete): + """ Returns None iff the file should be downloaded """ + + video_title = info_dict.get('title', info_dict.get('id', 'video')) + if 'title' in info_dict: + # This can happen when we're just evaluating the playlist + title = info_dict['title'] + matchtitle = self.params.get('matchtitle', False) + if matchtitle: + if not re.search(matchtitle, title, re.IGNORECASE): + return '"' + title + '" title did not match pattern "' + matchtitle + '"' + rejecttitle = self.params.get('rejecttitle', False) + if rejecttitle: + if re.search(rejecttitle, title, re.IGNORECASE): + return '"' + title + '" title matched reject pattern "' + rejecttitle + '"' + date = info_dict.get('upload_date') + if date is not None: + dateRange = self.params.get('daterange', DateRange()) + if date not in dateRange: + return '%s upload date is not in range %s' % (date_from_str(date).isoformat(), dateRange) + view_count = info_dict.get('view_count') + if view_count is not None: + min_views = self.params.get('min_views') + if min_views is not None and view_count < min_views: + return 'Skipping %s, because it has not reached minimum view count (%d/%d)' % (video_title, view_count, min_views) + max_views = self.params.get('max_views') + if max_views is not None and view_count > max_views: + return 'Skipping %s, because it has exceeded the maximum view count (%d/%d)' % (video_title, view_count, max_views) + if age_restricted(info_dict.get('age_limit'), self.params.get('age_limit')): + return 'Skipping "%s" because it is age restricted' % video_title + if self.in_download_archive(info_dict): + return '%s has already been recorded in archive' % video_title + + if not incomplete: + match_filter = self.params.get('match_filter') + if match_filter is not None: + ret = match_filter(info_dict) + if ret is not None: + return ret + + return None + + @staticmethod + def add_extra_info(info_dict, extra_info): + '''Set the keys from extra_info in info dict if they are missing''' + for key, value in extra_info.items(): + info_dict.setdefault(key, value) + + def extract_info(self, url, download=True, ie_key=None, extra_info={}, + process=True, force_generic_extractor=False): + ''' + Returns a list with a dictionary for each video we find. + If 'download', also downloads the videos. + extra_info is a dict containing the extra values to add to each result + ''' + + if not ie_key and force_generic_extractor: + ie_key = 'Generic' + + if ie_key: + ies = [self.get_info_extractor(ie_key)] + else: + ies = self._ies + + for ie in ies: + if not ie.suitable(url): + continue + + ie = self.get_info_extractor(ie.ie_key()) + if not ie.working(): + self.report_warning('The program functionality for this site has been marked as broken, ' + 'and will probably not work.') + + try: + ie_result = ie.extract(url) + if ie_result is None: # Finished already (backwards compatibility; listformats and friends should be moved here) + break + if isinstance(ie_result, list): + # Backwards compatibility: old IE result format + ie_result = { + '_type': 'compat_list', + 'entries': ie_result, + } + self.add_default_extra_info(ie_result, ie, url) + if process: + return self.process_ie_result(ie_result, download, extra_info) + else: + return ie_result + except GeoRestrictedError as e: + msg = e.msg + if e.countries: + msg += '\nThis video is available in %s.' % ', '.join( + map(ISO3166Utils.short2full, e.countries)) + msg += '\nYou might want to use a VPN or a proxy server (with --proxy) to workaround.' + self.report_error(msg) + break + except ExtractorError as e: # An error we somewhat expected + self.report_error(compat_str(e), e.format_traceback()) + break + except MaxDownloadsReached: + raise + except Exception as e: + if self.params.get('ignoreerrors', False): + self.report_error(error_to_compat_str(e), tb=encode_compat_str(traceback.format_exc())) + break + else: + raise + else: + self.report_error('no suitable InfoExtractor for URL %s' % url) + + def add_default_extra_info(self, ie_result, ie, url): + self.add_extra_info(ie_result, { + 'extractor': ie.IE_NAME, + 'webpage_url': url, + 'webpage_url_basename': url_basename(url), + 'extractor_key': ie.ie_key(), + }) + + def process_ie_result(self, ie_result, download=True, extra_info={}): + """ + Take the result of the ie(may be modified) and resolve all unresolved + references (URLs, playlist items). + + It will also download the videos if 'download'. + Returns the resolved ie_result. + """ + result_type = ie_result.get('_type', 'video') + + if result_type in ('url', 'url_transparent'): + ie_result['url'] = sanitize_url(ie_result['url']) + extract_flat = self.params.get('extract_flat', False) + if ((extract_flat == 'in_playlist' and 'playlist' in extra_info) + or extract_flat is True): + self.__forced_printings( + ie_result, self.prepare_filename(ie_result), + incomplete=True) + return ie_result + + if result_type == 'video': + self.add_extra_info(ie_result, extra_info) + return self.process_video_result(ie_result, download=download) + elif result_type == 'url': + # We have to add extra_info to the results because it may be + # contained in a playlist + return self.extract_info(ie_result['url'], + download, + ie_key=ie_result.get('ie_key'), + extra_info=extra_info) + elif result_type == 'url_transparent': + # Use the information from the embedding page + info = self.extract_info( + ie_result['url'], ie_key=ie_result.get('ie_key'), + extra_info=extra_info, download=False, process=False) + + # extract_info may return None when ignoreerrors is enabled and + # extraction failed with an error, don't crash and return early + # in this case + if not info: + return info + + force_properties = dict( + (k, v) for k, v in ie_result.items() if v is not None) + for f in ('_type', 'url', 'id', 'extractor', 'extractor_key', 'ie_key'): + if f in force_properties: + del force_properties[f] + new_result = info.copy() + new_result.update(force_properties) + + # Extracted info may not be a video result (i.e. + # info.get('_type', 'video') != video) but rather an url or + # url_transparent. In such cases outer metadata (from ie_result) + # should be propagated to inner one (info). For this to happen + # _type of info should be overridden with url_transparent. This + # fixes issue from https://github.com/ytdl-org/youtube-dl/pull/11163. + if new_result.get('_type') == 'url': + new_result['_type'] = 'url_transparent' + + return self.process_ie_result( + new_result, download=download, extra_info=extra_info) + elif result_type in ('playlist', 'multi_video'): + # We process each entry in the playlist + playlist = ie_result.get('title') or ie_result.get('id') + self.to_screen('[download] Downloading playlist: %s' % playlist) + + playlist_results = [] + + playliststart = self.params.get('playliststart', 1) - 1 + playlistend = self.params.get('playlistend') + # For backwards compatibility, interpret -1 as whole list + if playlistend == -1: + playlistend = None + + playlistitems_str = self.params.get('playlist_items') + playlistitems = None + if playlistitems_str is not None: + def iter_playlistitems(format): + for string_segment in format.split(','): + if '-' in string_segment: + start, end = string_segment.split('-') + for item in range(int(start), int(end) + 1): + yield int(item) + else: + yield int(string_segment) + playlistitems = orderedSet(iter_playlistitems(playlistitems_str)) + + ie_entries = ie_result['entries'] + + def make_playlistitems_entries(list_ie_entries): + num_entries = len(list_ie_entries) + return [ + list_ie_entries[i - 1] for i in playlistitems + if -num_entries <= i - 1 < num_entries] + + def report_download(num_entries): + self.to_screen( + '[%s] playlist %s: Downloading %d videos' % + (ie_result['extractor'], playlist, num_entries)) + + if isinstance(ie_entries, list): + n_all_entries = len(ie_entries) + if playlistitems: + entries = make_playlistitems_entries(ie_entries) + else: + entries = ie_entries[playliststart:playlistend] + n_entries = len(entries) + self.to_screen( + '[%s] playlist %s: Collected %d video ids (downloading %d of them)' % + (ie_result['extractor'], playlist, n_all_entries, n_entries)) + elif isinstance(ie_entries, PagedList): + if playlistitems: + entries = [] + for item in playlistitems: + entries.extend(ie_entries.getslice( + item - 1, item + )) + else: + entries = ie_entries.getslice( + playliststart, playlistend) + n_entries = len(entries) + report_download(n_entries) + else: # iterable + if playlistitems: + entries = make_playlistitems_entries(list(itertools.islice( + ie_entries, 0, max(playlistitems)))) + else: + entries = list(itertools.islice( + ie_entries, playliststart, playlistend)) + n_entries = len(entries) + report_download(n_entries) + + if self.params.get('playlistreverse', False): + entries = entries[::-1] + + if self.params.get('playlistrandom', False): + random.shuffle(entries) + + x_forwarded_for = ie_result.get('__x_forwarded_for_ip') + + for i, entry in enumerate(entries, 1): + self.to_screen('[download] Downloading video %s of %s' % (i, n_entries)) + # This __x_forwarded_for_ip thing is a bit ugly but requires + # minimal changes + if x_forwarded_for: + entry['__x_forwarded_for_ip'] = x_forwarded_for + extra = { + 'n_entries': n_entries, + 'playlist': playlist, + 'playlist_id': ie_result.get('id'), + 'playlist_title': ie_result.get('title'), + 'playlist_uploader': ie_result.get('uploader'), + 'playlist_uploader_id': ie_result.get('uploader_id'), + 'playlist_index': playlistitems[i - 1] if playlistitems else i + playliststart, + 'extractor': ie_result['extractor'], + 'webpage_url': ie_result['webpage_url'], + 'webpage_url_basename': url_basename(ie_result['webpage_url']), + 'extractor_key': ie_result['extractor_key'], + } + + reason = self._match_entry(entry, incomplete=True) + if reason is not None: + self.to_screen('[download] ' + reason) + continue + + entry_result = self.process_ie_result(entry, + download=download, + extra_info=extra) + playlist_results.append(entry_result) + ie_result['entries'] = playlist_results + self.to_screen('[download] Finished downloading playlist: %s' % playlist) + return ie_result + elif result_type == 'compat_list': + self.report_warning( + 'Extractor %s returned a compat_list result. ' + 'It needs to be updated.' % ie_result.get('extractor')) + + def _fixup(r): + self.add_extra_info( + r, + { + 'extractor': ie_result['extractor'], + 'webpage_url': ie_result['webpage_url'], + 'webpage_url_basename': url_basename(ie_result['webpage_url']), + 'extractor_key': ie_result['extractor_key'], + } + ) + return r + ie_result['entries'] = [ + self.process_ie_result(_fixup(r), download, extra_info) + for r in ie_result['entries'] + ] + return ie_result + else: + raise Exception('Invalid result type: %s' % result_type) + + def _build_format_filter(self, filter_spec): + " Returns a function to filter the formats according to the filter_spec " + + OPERATORS = { + '<': operator.lt, + '<=': operator.le, + '>': operator.gt, + '>=': operator.ge, + '=': operator.eq, + '!=': operator.ne, + } + operator_rex = re.compile(r'''(?x)\s* + (?P<key>width|height|tbr|abr|vbr|asr|filesize|filesize_approx|fps) + \s*(?P<op>%s)(?P<none_inclusive>\s*\?)?\s* + (?P<value>[0-9.]+(?:[kKmMgGtTpPeEzZyY]i?[Bb]?)?) + $ + ''' % '|'.join(map(re.escape, OPERATORS.keys()))) + m = operator_rex.search(filter_spec) + if m: + try: + comparison_value = int(m.group('value')) + except ValueError: + comparison_value = parse_filesize(m.group('value')) + if comparison_value is None: + comparison_value = parse_filesize(m.group('value') + 'B') + if comparison_value is None: + raise ValueError( + 'Invalid value %r in format specification %r' % ( + m.group('value'), filter_spec)) + op = OPERATORS[m.group('op')] + + if not m: + STR_OPERATORS = { + '=': operator.eq, + '^=': lambda attr, value: attr.startswith(value), + '$=': lambda attr, value: attr.endswith(value), + '*=': lambda attr, value: value in attr, + } + str_operator_rex = re.compile(r'''(?x) + \s*(?P<key>ext|acodec|vcodec|container|protocol|format_id) + \s*(?P<negation>!\s*)?(?P<op>%s)(?P<none_inclusive>\s*\?)? + \s*(?P<value>[a-zA-Z0-9._-]+) + \s*$ + ''' % '|'.join(map(re.escape, STR_OPERATORS.keys()))) + m = str_operator_rex.search(filter_spec) + if m: + comparison_value = m.group('value') + str_op = STR_OPERATORS[m.group('op')] + if m.group('negation'): + op = lambda attr, value: not str_op(attr, value) + else: + op = str_op + + if not m: + raise ValueError('Invalid filter specification %r' % filter_spec) + + def _filter(f): + actual_value = f.get(m.group('key')) + if actual_value is None: + return m.group('none_inclusive') + return op(actual_value, comparison_value) + return _filter + + def _default_format_spec(self, info_dict, download=True): + + def can_merge(): + merger = FFmpegMergerPP(self) + return merger.available and merger.can_merge() + + def prefer_best(): + if self.params.get('simulate', False): + return False + if not download: + return False + if self.params.get('outtmpl', DEFAULT_OUTTMPL) == '-': + return True + if info_dict.get('is_live'): + return True + if not can_merge(): + return True + return False + + req_format_list = ['bestvideo+bestaudio', 'best'] + if prefer_best(): + req_format_list.reverse() + return '/'.join(req_format_list) + + def build_format_selector(self, format_spec): + def syntax_error(note, start): + message = ( + 'Invalid format specification: ' + '{0}\n\t{1}\n\t{2}^'.format(note, format_spec, ' ' * start[1])) + return SyntaxError(message) + + PICKFIRST = 'PICKFIRST' + MERGE = 'MERGE' + SINGLE = 'SINGLE' + GROUP = 'GROUP' + FormatSelector = collections.namedtuple('FormatSelector', ['type', 'selector', 'filters']) + + def _parse_filter(tokens): + filter_parts = [] + for type, string, start, _, _ in tokens: + if type == tokenize.OP and string == ']': + return ''.join(filter_parts) + else: + filter_parts.append(string) + + def _remove_unused_ops(tokens): + # Remove operators that we don't use and join them with the surrounding strings + # for example: 'mp4' '-' 'baseline' '-' '16x9' is converted to 'mp4-baseline-16x9' + ALLOWED_OPS = ('/', '+', ',', '(', ')') + last_string, last_start, last_end, last_line = None, None, None, None + for type, string, start, end, line in tokens: + if type == tokenize.OP and string == '[': + if last_string: + yield tokenize.NAME, last_string, last_start, last_end, last_line + last_string = None + yield type, string, start, end, line + # everything inside brackets will be handled by _parse_filter + for type, string, start, end, line in tokens: + yield type, string, start, end, line + if type == tokenize.OP and string == ']': + break + elif type == tokenize.OP and string in ALLOWED_OPS: + if last_string: + yield tokenize.NAME, last_string, last_start, last_end, last_line + last_string = None + yield type, string, start, end, line + elif type in [tokenize.NAME, tokenize.NUMBER, tokenize.OP]: + if not last_string: + last_string = string + last_start = start + last_end = end + else: + last_string += string + if last_string: + yield tokenize.NAME, last_string, last_start, last_end, last_line + + def _parse_format_selection(tokens, inside_merge=False, inside_choice=False, inside_group=False): + selectors = [] + current_selector = None + for type, string, start, _, _ in tokens: + # ENCODING is only defined in python 3.x + if type == getattr(tokenize, 'ENCODING', None): + continue + elif type in [tokenize.NAME, tokenize.NUMBER]: + current_selector = FormatSelector(SINGLE, string, []) + elif type == tokenize.OP: + if string == ')': + if not inside_group: + # ')' will be handled by the parentheses group + tokens.restore_last_token() + break + elif inside_merge and string in ['/', ',']: + tokens.restore_last_token() + break + elif inside_choice and string == ',': + tokens.restore_last_token() + break + elif string == ',': + if not current_selector: + raise syntax_error('"," must follow a format selector', start) + selectors.append(current_selector) + current_selector = None + elif string == '/': + if not current_selector: + raise syntax_error('"/" must follow a format selector', start) + first_choice = current_selector + second_choice = _parse_format_selection(tokens, inside_choice=True) + current_selector = FormatSelector(PICKFIRST, (first_choice, second_choice), []) + elif string == '[': + if not current_selector: + current_selector = FormatSelector(SINGLE, 'best', []) + format_filter = _parse_filter(tokens) + current_selector.filters.append(format_filter) + elif string == '(': + if current_selector: + raise syntax_error('Unexpected "("', start) + group = _parse_format_selection(tokens, inside_group=True) + current_selector = FormatSelector(GROUP, group, []) + elif string == '+': + video_selector = current_selector + audio_selector = _parse_format_selection(tokens, inside_merge=True) + if not video_selector or not audio_selector: + raise syntax_error('"+" must be between two format selectors', start) + current_selector = FormatSelector(MERGE, (video_selector, audio_selector), []) + else: + raise syntax_error('Operator not recognized: "{0}"'.format(string), start) + elif type == tokenize.ENDMARKER: + break + if current_selector: + selectors.append(current_selector) + return selectors + + def _build_selector_function(selector): + if isinstance(selector, list): + fs = [_build_selector_function(s) for s in selector] + + def selector_function(ctx): + for f in fs: + for format in f(ctx): + yield format + return selector_function + elif selector.type == GROUP: + selector_function = _build_selector_function(selector.selector) + elif selector.type == PICKFIRST: + fs = [_build_selector_function(s) for s in selector.selector] + + def selector_function(ctx): + for f in fs: + picked_formats = list(f(ctx)) + if picked_formats: + return picked_formats + return [] + elif selector.type == SINGLE: + format_spec = selector.selector + + def selector_function(ctx): + formats = list(ctx['formats']) + if not formats: + return + if format_spec == 'all': + for f in formats: + yield f + elif format_spec in ['best', 'worst', None]: + format_idx = 0 if format_spec == 'worst' else -1 + audiovideo_formats = [ + f for f in formats + if f.get('vcodec') != 'none' and f.get('acodec') != 'none'] + if audiovideo_formats: + yield audiovideo_formats[format_idx] + # for extractors with incomplete formats (audio only (soundcloud) + # or video only (imgur)) we will fallback to best/worst + # {video,audio}-only format + elif ctx['incomplete_formats']: + yield formats[format_idx] + elif format_spec == 'bestaudio': + audio_formats = [ + f for f in formats + if f.get('vcodec') == 'none'] + if audio_formats: + yield audio_formats[-1] + elif format_spec == 'worstaudio': + audio_formats = [ + f for f in formats + if f.get('vcodec') == 'none'] + if audio_formats: + yield audio_formats[0] + elif format_spec == 'bestvideo': + video_formats = [ + f for f in formats + if f.get('acodec') == 'none'] + if video_formats: + yield video_formats[-1] + elif format_spec == 'worstvideo': + video_formats = [ + f for f in formats + if f.get('acodec') == 'none'] + if video_formats: + yield video_formats[0] + else: + extensions = ['mp4', 'flv', 'webm', '3gp', 'm4a', 'mp3', 'ogg', 'aac', 'wav'] + if format_spec in extensions: + filter_f = lambda f: f['ext'] == format_spec + else: + filter_f = lambda f: f['format_id'] == format_spec + matches = list(filter(filter_f, formats)) + if matches: + yield matches[-1] + elif selector.type == MERGE: + def _merge(formats_info): + format_1, format_2 = [f['format_id'] for f in formats_info] + # The first format must contain the video and the + # second the audio + if formats_info[0].get('vcodec') == 'none': + self.report_error('The first format must ' + 'contain the video, try using ' + '"-f %s+%s"' % (format_2, format_1)) + return + # Formats must be opposite (video+audio) + if formats_info[0].get('acodec') == 'none' and formats_info[1].get('acodec') == 'none': + self.report_error( + 'Both formats %s and %s are video-only, you must specify "-f video+audio"' + % (format_1, format_2)) + return + output_ext = ( + formats_info[0]['ext'] + if self.params.get('merge_output_format') is None + else self.params['merge_output_format']) + return { + 'requested_formats': formats_info, + 'format': '%s+%s' % (formats_info[0].get('format'), + formats_info[1].get('format')), + 'format_id': '%s+%s' % (formats_info[0].get('format_id'), + formats_info[1].get('format_id')), + 'width': formats_info[0].get('width'), + 'height': formats_info[0].get('height'), + 'resolution': formats_info[0].get('resolution'), + 'fps': formats_info[0].get('fps'), + 'vcodec': formats_info[0].get('vcodec'), + 'vbr': formats_info[0].get('vbr'), + 'stretched_ratio': formats_info[0].get('stretched_ratio'), + 'acodec': formats_info[1].get('acodec'), + 'abr': formats_info[1].get('abr'), + 'ext': output_ext, + } + video_selector, audio_selector = map(_build_selector_function, selector.selector) + + def selector_function(ctx): + for pair in itertools.product( + video_selector(copy.deepcopy(ctx)), audio_selector(copy.deepcopy(ctx))): + yield _merge(pair) + + filters = [self._build_format_filter(f) for f in selector.filters] + + def final_selector(ctx): + ctx_copy = copy.deepcopy(ctx) + for _filter in filters: + ctx_copy['formats'] = list(filter(_filter, ctx_copy['formats'])) + return selector_function(ctx_copy) + return final_selector + + stream = io.BytesIO(format_spec.encode('utf-8')) + try: + tokens = list(_remove_unused_ops(compat_tokenize_tokenize(stream.readline))) + except tokenize.TokenError: + raise syntax_error('Missing closing/opening brackets or parenthesis', (0, len(format_spec))) + + class TokenIterator(object): + def __init__(self, tokens): + self.tokens = tokens + self.counter = 0 + + def __iter__(self): + return self + + def __next__(self): + if self.counter >= len(self.tokens): + raise StopIteration() + value = self.tokens[self.counter] + self.counter += 1 + return value + + next = __next__ + + def restore_last_token(self): + self.counter -= 1 + + parsed_selector = _parse_format_selection(iter(TokenIterator(tokens))) + return _build_selector_function(parsed_selector) + + def _calc_headers(self, info_dict): + res = std_headers.copy() + + add_headers = info_dict.get('http_headers') + if add_headers: + res.update(add_headers) + + cookies = self._calc_cookies(info_dict) + if cookies: + res['Cookie'] = cookies + + if 'X-Forwarded-For' not in res: + x_forwarded_for_ip = info_dict.get('__x_forwarded_for_ip') + if x_forwarded_for_ip: + res['X-Forwarded-For'] = x_forwarded_for_ip + + return res + + def _calc_cookies(self, info_dict): + pr = sanitized_Request(info_dict['url']) + self.cookiejar.add_cookie_header(pr) + return pr.get_header('Cookie') + + def process_video_result(self, info_dict, download=True): + assert info_dict.get('_type', 'video') == 'video' + + if 'id' not in info_dict: + raise ExtractorError('Missing "id" field in extractor result') + if 'title' not in info_dict: + raise ExtractorError('Missing "title" field in extractor result') + + def report_force_conversion(field, field_not, conversion): + self.report_warning( + '"%s" field is not %s - forcing %s conversion, there is an error in extractor' + % (field, field_not, conversion)) + + def sanitize_string_field(info, string_field): + field = info.get(string_field) + if field is None or isinstance(field, compat_str): + return + report_force_conversion(string_field, 'a string', 'string') + info[string_field] = compat_str(field) + + def sanitize_numeric_fields(info): + for numeric_field in self._NUMERIC_FIELDS: + field = info.get(numeric_field) + if field is None or isinstance(field, compat_numeric_types): + continue + report_force_conversion(numeric_field, 'numeric', 'int') + info[numeric_field] = int_or_none(field) + + sanitize_string_field(info_dict, 'id') + sanitize_numeric_fields(info_dict) + + if 'playlist' not in info_dict: + # It isn't part of a playlist + info_dict['playlist'] = None + info_dict['playlist_index'] = None + + thumbnails = info_dict.get('thumbnails') + if thumbnails is None: + thumbnail = info_dict.get('thumbnail') + if thumbnail: + info_dict['thumbnails'] = thumbnails = [{'url': thumbnail}] + if thumbnails: + thumbnails.sort(key=lambda t: ( + t.get('preference') if t.get('preference') is not None else -1, + t.get('width') if t.get('width') is not None else -1, + t.get('height') if t.get('height') is not None else -1, + t.get('id') if t.get('id') is not None else '', t.get('url'))) + for i, t in enumerate(thumbnails): + t['url'] = sanitize_url(t['url']) + if t.get('width') and t.get('height'): + t['resolution'] = '%dx%d' % (t['width'], t['height']) + if t.get('id') is None: + t['id'] = '%d' % i + + if self.params.get('list_thumbnails'): + self.list_thumbnails(info_dict) + return + + thumbnail = info_dict.get('thumbnail') + if thumbnail: + info_dict['thumbnail'] = sanitize_url(thumbnail) + elif thumbnails: + info_dict['thumbnail'] = thumbnails[-1]['url'] + + if 'display_id' not in info_dict and 'id' in info_dict: + info_dict['display_id'] = info_dict['id'] + + if info_dict.get('upload_date') is None and info_dict.get('timestamp') is not None: + # Working around out-of-range timestamp values (e.g. negative ones on Windows, + # see http://bugs.python.org/issue1646728) + try: + upload_date = datetime.datetime.utcfromtimestamp(info_dict['timestamp']) + info_dict['upload_date'] = upload_date.strftime('%Y%m%d') + except (ValueError, OverflowError, OSError): + pass + + # Auto generate title fields corresponding to the *_number fields when missing + # in order to always have clean titles. This is very common for TV series. + for field in ('chapter', 'season', 'episode'): + if info_dict.get('%s_number' % field) is not None and not info_dict.get(field): + info_dict[field] = '%s %d' % (field.capitalize(), info_dict['%s_number' % field]) + + for cc_kind in ('subtitles', 'automatic_captions'): + cc = info_dict.get(cc_kind) + if cc: + for _, subtitle in cc.items(): + for subtitle_format in subtitle: + if subtitle_format.get('url'): + subtitle_format['url'] = sanitize_url(subtitle_format['url']) + if subtitle_format.get('ext') is None: + subtitle_format['ext'] = determine_ext(subtitle_format['url']).lower() + + automatic_captions = info_dict.get('automatic_captions') + subtitles = info_dict.get('subtitles') + + if self.params.get('listsubtitles', False): + if 'automatic_captions' in info_dict: + self.list_subtitles( + info_dict['id'], automatic_captions, 'automatic captions') + self.list_subtitles(info_dict['id'], subtitles, 'subtitles') + return + + info_dict['requested_subtitles'] = self.process_subtitles( + info_dict['id'], subtitles, automatic_captions) + + # We now pick which formats have to be downloaded + if info_dict.get('formats') is None: + # There's only one format available + formats = [info_dict] + else: + formats = info_dict['formats'] + + if not formats: + raise ExtractorError('No video formats found!') + + def is_wellformed(f): + url = f.get('url') + if not url: + self.report_warning( + '"url" field is missing or empty - skipping format, ' + 'there is an error in extractor') + return False + if isinstance(url, bytes): + sanitize_string_field(f, 'url') + return True + + # Filter out malformed formats for better extraction robustness + formats = list(filter(is_wellformed, formats)) + + formats_dict = {} + + # We check that all the formats have the format and format_id fields + for i, format in enumerate(formats): + sanitize_string_field(format, 'format_id') + sanitize_numeric_fields(format) + format['url'] = sanitize_url(format['url']) + if not format.get('format_id'): + format['format_id'] = compat_str(i) + else: + # Sanitize format_id from characters used in format selector expression + format['format_id'] = re.sub(r'[\s,/+\[\]()]', '_', format['format_id']) + format_id = format['format_id'] + if format_id not in formats_dict: + formats_dict[format_id] = [] + formats_dict[format_id].append(format) + + # Make sure all formats have unique format_id + for format_id, ambiguous_formats in formats_dict.items(): + if len(ambiguous_formats) > 1: + for i, format in enumerate(ambiguous_formats): + format['format_id'] = '%s-%d' % (format_id, i) + + for i, format in enumerate(formats): + if format.get('format') is None: + format['format'] = '{id} - {res}{note}'.format( + id=format['format_id'], + res=self.format_resolution(format), + note=' ({0})'.format(format['format_note']) if format.get('format_note') is not None else '', + ) + # Automatically determine file extension if missing + if format.get('ext') is None: + format['ext'] = determine_ext(format['url']).lower() + # Automatically determine protocol if missing (useful for format + # selection purposes) + if format.get('protocol') is None: + format['protocol'] = determine_protocol(format) + # Add HTTP headers, so that external programs can use them from the + # json output + full_format_info = info_dict.copy() + full_format_info.update(format) + format['http_headers'] = self._calc_headers(full_format_info) + # Remove private housekeeping stuff + if '__x_forwarded_for_ip' in info_dict: + del info_dict['__x_forwarded_for_ip'] + + # TODO Central sorting goes here + + if formats[0] is not info_dict: + # only set the 'formats' fields if the original info_dict list them + # otherwise we end up with a circular reference, the first (and unique) + # element in the 'formats' field in info_dict is info_dict itself, + # which can't be exported to json + info_dict['formats'] = formats + if self.params.get('listformats'): + self.list_formats(info_dict) + return + + req_format = self.params.get('format') + if req_format is None: + req_format = self._default_format_spec(info_dict, download=download) + if self.params.get('verbose'): + self.to_stdout('[debug] Default format spec: %s' % req_format) + + format_selector = self.build_format_selector(req_format) + + # While in format selection we may need to have an access to the original + # format set in order to calculate some metrics or do some processing. + # For now we need to be able to guess whether original formats provided + # by extractor are incomplete or not (i.e. whether extractor provides only + # video-only or audio-only formats) for proper formats selection for + # extractors with such incomplete formats (see + # https://github.com/ytdl-org/youtube-dl/pull/5556). + # Since formats may be filtered during format selection and may not match + # the original formats the results may be incorrect. Thus original formats + # or pre-calculated metrics should be passed to format selection routines + # as well. + # We will pass a context object containing all necessary additional data + # instead of just formats. + # This fixes incorrect format selection issue (see + # https://github.com/ytdl-org/youtube-dl/issues/10083). + incomplete_formats = ( + # All formats are video-only or + all(f.get('vcodec') != 'none' and f.get('acodec') == 'none' for f in formats) + # all formats are audio-only + or all(f.get('vcodec') == 'none' and f.get('acodec') != 'none' for f in formats)) + + ctx = { + 'formats': formats, + 'incomplete_formats': incomplete_formats, + } + + formats_to_download = list(format_selector(ctx)) + if not formats_to_download: + raise ExtractorError('requested format not available', + expected=True) + + if download: + if len(formats_to_download) > 1: + self.to_screen('[info] %s: downloading video in %s formats' % (info_dict['id'], len(formats_to_download))) + for format in formats_to_download: + new_info = dict(info_dict) + new_info.update(format) + self.process_info(new_info) + # We update the info dict with the best quality format (backwards compatibility) + info_dict.update(formats_to_download[-1]) + return info_dict + + def process_subtitles(self, video_id, normal_subtitles, automatic_captions): + """Select the requested subtitles and their format""" + available_subs = {} + if normal_subtitles and self.params.get('writesubtitles'): + available_subs.update(normal_subtitles) + if automatic_captions and self.params.get('writeautomaticsub'): + for lang, cap_info in automatic_captions.items(): + if lang not in available_subs: + available_subs[lang] = cap_info + + if (not self.params.get('writesubtitles') and not + self.params.get('writeautomaticsub') or not + available_subs): + return None + + if self.params.get('allsubtitles', False): + requested_langs = available_subs.keys() + else: + if self.params.get('subtitleslangs', False): + requested_langs = self.params.get('subtitleslangs') + elif 'en' in available_subs: + requested_langs = ['en'] + else: + requested_langs = [list(available_subs.keys())[0]] + + formats_query = self.params.get('subtitlesformat', 'best') + formats_preference = formats_query.split('/') if formats_query else [] + subs = {} + for lang in requested_langs: + formats = available_subs.get(lang) + if formats is None: + self.report_warning('%s subtitles not available for %s' % (lang, video_id)) + continue + for ext in formats_preference: + if ext == 'best': + f = formats[-1] + break + matches = list(filter(lambda f: f['ext'] == ext, formats)) + if matches: + f = matches[-1] + break + else: + f = formats[-1] + self.report_warning( + 'No subtitle format found matching "%s" for language %s, ' + 'using %s' % (formats_query, lang, f['ext'])) + subs[lang] = f + return subs + + def __forced_printings(self, info_dict, filename, incomplete): + 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_mandatory('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)) + + def process_info(self, info_dict): + """Process a single resolved IE result.""" + + assert info_dict.get('_type', 'video') == 'video' + + max_downloads = self.params.get('max_downloads') + if max_downloads is not None: + if self._num_downloads >= int(max_downloads): + raise MaxDownloadsReached() + + # TODO: backward compatibility, to be removed + info_dict['fulltitle'] = info_dict['title'] + + if 'format' not in info_dict: + info_dict['format'] = info_dict['ext'] + + reason = self._match_entry(info_dict, incomplete=False) + if reason is not None: + self.to_screen('[download] ' + reason) + return + + self._num_downloads += 1 + + info_dict['_filename'] = filename = self.prepare_filename(info_dict) + + # Forced printings + self.__forced_printings(info_dict, filename, incomplete=False) + + # Do nothing else if in simulate mode + if self.params.get('simulate', False): + return + + if filename is None: + return + + def ensure_dir_exists(path): + try: + dn = os.path.dirname(path) + if dn and not os.path.exists(dn): + os.makedirs(dn) + return True + except (OSError, IOError) as err: + self.report_error('unable to create directory ' + error_to_compat_str(err)) + return False + + if not ensure_dir_exists(sanitize_path(encodeFilename(filename))): + return + + if self.params.get('writedescription', False): + descfn = replace_extension(filename, 'description', info_dict.get('ext')) + if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(descfn)): + self.to_screen('[info] Video description is already present') + elif info_dict.get('description') is None: + self.report_warning('There\'s no description to write.') + else: + try: + self.to_screen('[info] Writing video description to: ' + descfn) + with io.open(encodeFilename(descfn), 'w', encoding='utf-8') as descfile: + descfile.write(info_dict['description']) + except (OSError, IOError): + self.report_error('Cannot write description file ' + descfn) + return + + if self.params.get('writeannotations', False): + annofn = replace_extension(filename, 'annotations.xml', info_dict.get('ext')) + if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(annofn)): + self.to_screen('[info] Video annotations are already present') + elif not info_dict.get('annotations'): + self.report_warning('There are no annotations to write.') + else: + try: + self.to_screen('[info] Writing video annotations to: ' + annofn) + with io.open(encodeFilename(annofn), 'w', encoding='utf-8') as annofile: + annofile.write(info_dict['annotations']) + except (KeyError, TypeError): + self.report_warning('There are no annotations to write.') + except (OSError, IOError): + self.report_error('Cannot write annotations file: ' + annofn) + return + + def dl(name, info): + fd = get_suitable_downloader(info, self.params)(self, self.params) + for ph in self._progress_hooks: + fd.add_progress_hook(ph) + if self.params.get('verbose'): + self.to_stdout('[debug] Invoking downloader on %r' % info.get('url')) + return fd.download(name, info) + + subtitles_are_requested = any([self.params.get('writesubtitles', False), + self.params.get('writeautomaticsub')]) + + if subtitles_are_requested and info_dict.get('requested_subtitles'): + # subtitles download errors are already managed as troubles in relevant IE + # that way it will silently go on when used with unsupporting IE + subtitles = info_dict['requested_subtitles'] + for sub_lang, sub_info in subtitles.items(): + sub_format = sub_info['ext'] + sub_filename = subtitles_filename(filename, sub_lang, sub_format, info_dict.get('ext')) + if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(sub_filename)): + self.to_screen('[info] Video subtitle %s.%s is already present' % (sub_lang, sub_format)) + else: + if sub_info.get('data') is not None: + try: + # Use newline='' to prevent conversion of newline characters + # See https://github.com/ytdl-org/youtube-dl/issues/10268 + with io.open(encodeFilename(sub_filename), 'w', encoding='utf-8', newline='') as subfile: + subfile.write(sub_info['data']) + except (OSError, IOError): + self.report_error('Cannot write subtitles file ' + sub_filename) + return + else: + try: + dl(sub_filename, sub_info) + except (ExtractorError, IOError, OSError, ValueError, + compat_urllib_error.URLError, + compat_http_client.HTTPException, + socket.error) as err: + self.report_warning('Unable to download subtitle for "%s": %s' % + (sub_lang, error_to_compat_str(err))) + continue + + if self.params.get('writeinfojson', False): + infofn = replace_extension(filename, 'info.json', info_dict.get('ext')) + if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(infofn)): + self.to_screen('[info] Video description metadata is already present') + else: + self.to_screen('[info] Writing video description metadata as JSON to: ' + infofn) + try: + write_json_file(self.filter_requested_info(info_dict), infofn) + except (OSError, IOError): + self.report_error('Cannot write metadata to JSON file ' + infofn) + return + + self._write_thumbnails(info_dict, filename) + + if not self.params.get('skip_download', False): + try: + if info_dict.get('requested_formats') is not None: + downloaded = [] + success = True + merger = FFmpegMergerPP(self) + if not merger.available: + postprocessors = [] + self.report_warning('You have requested multiple ' + 'formats but ffmpeg or avconv are not installed.' + ' The formats won\'t be merged.') + else: + postprocessors = [merger] + + def compatible_formats(formats): + video, audio = formats + # Check extension + video_ext, audio_ext = video.get('ext'), audio.get('ext') + if video_ext and audio_ext: + COMPATIBLE_EXTS = ( + ('mp3', 'mp4', 'm4a', 'm4p', 'm4b', 'm4r', 'm4v', 'ismv', 'isma'), + ('webm') + ) + for exts in COMPATIBLE_EXTS: + if video_ext in exts and audio_ext in exts: + return True + # TODO: Check acodec/vcodec + return False + + filename_real_ext = os.path.splitext(filename)[1][1:] + filename_wo_ext = ( + os.path.splitext(filename)[0] + if filename_real_ext == info_dict['ext'] + else filename) + requested_formats = info_dict['requested_formats'] + if self.params.get('merge_output_format') is None and not compatible_formats(requested_formats): + info_dict['ext'] = 'mkv' + self.report_warning( + 'Requested formats are incompatible for merge and will be merged into mkv.') + # Ensure filename always has a correct extension for successful merge + filename = '%s.%s' % (filename_wo_ext, info_dict['ext']) + if os.path.exists(encodeFilename(filename)): + self.to_screen( + '[download] %s has already been downloaded and ' + 'merged' % filename) + else: + for f in requested_formats: + new_info = dict(info_dict) + new_info.update(f) + fname = prepend_extension( + self.prepare_filename(new_info), + 'f%s' % f['format_id'], new_info['ext']) + if not ensure_dir_exists(fname): + return + downloaded.append(fname) + partial_success = dl(fname, new_info) + success = success and partial_success + info_dict['__postprocessors'] = postprocessors + info_dict['__files_to_merge'] = downloaded + else: + # Just a single file + success = dl(filename, info_dict) + except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err: + self.report_error('unable to download video data: %s' % error_to_compat_str(err)) + return + except (OSError, IOError) as err: + raise UnavailableVideoError(err) + except (ContentTooShortError, ) as err: + self.report_error('content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded)) + return + + if success and filename != '-': + # Fixup content + fixup_policy = self.params.get('fixup') + if fixup_policy is None: + fixup_policy = 'detect_or_warn' + + INSTALL_FFMPEG_MESSAGE = 'Install ffmpeg or avconv to fix this automatically.' + + stretched_ratio = info_dict.get('stretched_ratio') + if stretched_ratio is not None and stretched_ratio != 1: + if fixup_policy == 'warn': + self.report_warning('%s: Non-uniform pixel ratio (%s)' % ( + info_dict['id'], stretched_ratio)) + elif fixup_policy == 'detect_or_warn': + stretched_pp = FFmpegFixupStretchedPP(self) + if stretched_pp.available: + info_dict.setdefault('__postprocessors', []) + info_dict['__postprocessors'].append(stretched_pp) + else: + self.report_warning( + '%s: Non-uniform pixel ratio (%s). %s' + % (info_dict['id'], stretched_ratio, INSTALL_FFMPEG_MESSAGE)) + else: + assert fixup_policy in ('ignore', 'never') + + if (info_dict.get('requested_formats') is None + and info_dict.get('container') == 'm4a_dash'): + if fixup_policy == 'warn': + self.report_warning( + '%s: writing DASH m4a. ' + 'Only some players support this container.' + % info_dict['id']) + elif fixup_policy == 'detect_or_warn': + fixup_pp = FFmpegFixupM4aPP(self) + if fixup_pp.available: + info_dict.setdefault('__postprocessors', []) + info_dict['__postprocessors'].append(fixup_pp) + else: + self.report_warning( + '%s: writing DASH m4a. ' + 'Only some players support this container. %s' + % (info_dict['id'], INSTALL_FFMPEG_MESSAGE)) + else: + assert fixup_policy in ('ignore', 'never') + + if (info_dict.get('protocol') == 'm3u8_native' + or info_dict.get('protocol') == 'm3u8' + and self.params.get('hls_prefer_native')): + if fixup_policy == 'warn': + self.report_warning('%s: malformed AAC bitstream detected.' % ( + info_dict['id'])) + elif fixup_policy == 'detect_or_warn': + fixup_pp = FFmpegFixupM3u8PP(self) + if fixup_pp.available: + info_dict.setdefault('__postprocessors', []) + info_dict['__postprocessors'].append(fixup_pp) + else: + self.report_warning( + '%s: malformed AAC bitstream detected. %s' + % (info_dict['id'], INSTALL_FFMPEG_MESSAGE)) + else: + assert fixup_policy in ('ignore', 'never') + + try: + self.post_process(filename, info_dict) + except (PostProcessingError) as err: + self.report_error('postprocessing: %s' % str(err)) + return + self.record_download_archive(info_dict) + + def download(self, url_list): + """Download a given list of URLs.""" + outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL) + if (len(url_list) > 1 + and outtmpl != '-' + and '%' not in outtmpl + and self.params.get('max_downloads') != 1): + raise SameFileError(outtmpl) + + for url in url_list: + try: + # It also downloads the videos + res = self.extract_info( + url, force_generic_extractor=self.params.get('force_generic_extractor', False)) + except UnavailableVideoError: + self.report_error('unable to download video') + except MaxDownloadsReached: + self.to_screen('[info] Maximum number of downloaded files reached.') + raise + else: + if self.params.get('dump_single_json', False): + self.to_stdout(json.dumps(res)) + + return self._download_retcode + + def download_with_info_file(self, info_filename): + with contextlib.closing(fileinput.FileInput( + [info_filename], mode='r', + openhook=fileinput.hook_encoded('utf-8'))) as f: + # FileInput doesn't have a read method, we can't call json.load + info = self.filter_requested_info(json.loads('\n'.join(f))) + try: + self.process_ie_result(info, download=True) + except DownloadError: + webpage_url = info.get('webpage_url') + if webpage_url is not None: + self.report_warning('The info failed to download, trying with "%s"' % webpage_url) + return self.download([webpage_url]) + else: + raise + return self._download_retcode + + @staticmethod + def filter_requested_info(info_dict): + return dict( + (k, v) for k, v in info_dict.items() + if k not in ['requested_formats', 'requested_subtitles']) + + def post_process(self, filename, ie_info): + """Run all the postprocessors on the given file.""" + info = dict(ie_info) + info['filepath'] = filename + pps_chain = [] + if ie_info.get('__postprocessors') is not None: + pps_chain.extend(ie_info['__postprocessors']) + pps_chain.extend(self._pps) + for pp in pps_chain: + files_to_delete = [] + try: + files_to_delete, info = pp.run(info) + except PostProcessingError as e: + self.report_error(e.msg) + if files_to_delete and not self.params.get('keepvideo', False): + for old_filename in files_to_delete: + self.to_screen('Deleting original file %s (pass -k to keep)' % old_filename) + try: + os.remove(encodeFilename(old_filename)) + except (IOError, OSError): + self.report_warning('Unable to remove downloaded original file') + + def _make_archive_id(self, info_dict): + video_id = info_dict.get('id') + if not video_id: + return + # Future-proof against any change in case + # and backwards compatibility with prior versions + extractor = info_dict.get('extractor_key') or info_dict.get('ie_key') # key in a playlist + if extractor is None: + url = str_or_none(info_dict.get('url')) + if not url: + return + # Try to find matching extractor for the URL and take its ie_key + for ie in self._ies: + if ie.suitable(url): + extractor = ie.ie_key() + break + else: + return + return extractor.lower() + ' ' + video_id + + def in_download_archive(self, info_dict): + fn = self.params.get('download_archive') + if fn is None: + return False + + vid_id = self._make_archive_id(info_dict) + if not vid_id: + return False # Incomplete video information + + try: + with locked_file(fn, 'r', encoding='utf-8') as archive_file: + for line in archive_file: + if line.strip() == vid_id: + return True + except IOError as ioe: + if ioe.errno != errno.ENOENT: + raise + return False + + def record_download_archive(self, info_dict): + fn = self.params.get('download_archive') + if fn is None: + return + vid_id = self._make_archive_id(info_dict) + assert vid_id + with locked_file(fn, 'a', encoding='utf-8') as archive_file: + archive_file.write(vid_id + '\n') + + @staticmethod + def format_resolution(format, default='unknown'): + if format.get('vcodec') == 'none': + return 'audio only' + if format.get('resolution') is not None: + return format['resolution'] + if format.get('height') is not None: + if format.get('width') is not None: + res = '%sx%s' % (format['width'], format['height']) + else: + res = '%sp' % format['height'] + elif format.get('width') is not None: + res = '%dx?' % format['width'] + else: + res = default + return res + + def _format_note(self, fdict): + res = '' + if fdict.get('ext') in ['f4f', 'f4m']: + res += '(unsupported) ' + if fdict.get('language'): + if res: + res += ' ' + res += '[%s] ' % fdict['language'] + if fdict.get('format_note') is not None: + res += fdict['format_note'] + ' ' + if fdict.get('tbr') is not None: + res += '%4dk ' % fdict['tbr'] + if fdict.get('container') is not None: + if res: + res += ', ' + res += '%s container' % fdict['container'] + if (fdict.get('vcodec') is not None + and fdict.get('vcodec') != 'none'): + if res: + res += ', ' + res += fdict['vcodec'] + if fdict.get('vbr') is not None: + res += '@' + elif fdict.get('vbr') is not None and fdict.get('abr') is not None: + res += 'video@' + if fdict.get('vbr') is not None: + res += '%4dk' % fdict['vbr'] + if fdict.get('fps') is not None: + if res: + res += ', ' + res += '%sfps' % fdict['fps'] + if fdict.get('acodec') is not None: + if res: + res += ', ' + if fdict['acodec'] == 'none': + res += 'video only' + else: + res += '%-5s' % fdict['acodec'] + elif fdict.get('abr') is not None: + if res: + res += ', ' + res += 'audio' + if fdict.get('abr') is not None: + res += '@%3dk' % fdict['abr'] + if fdict.get('asr') is not None: + res += ' (%5dHz)' % fdict['asr'] + if fdict.get('filesize') is not None: + if res: + res += ', ' + res += format_bytes(fdict['filesize']) + elif fdict.get('filesize_approx') is not None: + if res: + res += ', ' + res += '~' + format_bytes(fdict['filesize_approx']) + return res + + def list_formats(self, info_dict): + formats = info_dict.get('formats', [info_dict]) + table = [ + [f['format_id'], f['ext'], self.format_resolution(f), self._format_note(f)] + for f in formats + if f.get('preference') is None or f['preference'] >= -1000] + if len(formats) > 1: + table[-1][-1] += (' ' if table[-1][-1] else '') + '(best)' + + header_line = ['format code', 'extension', 'resolution', 'note'] + self.to_screen( + '[info] Available formats for %s:\n%s' % + (info_dict['id'], render_table(header_line, table))) + + def list_thumbnails(self, info_dict): + thumbnails = info_dict.get('thumbnails') + if not thumbnails: + self.to_screen('[info] No thumbnails present for %s' % info_dict['id']) + return + + self.to_screen( + '[info] Thumbnails for %s:' % info_dict['id']) + self.to_screen(render_table( + ['ID', 'width', 'height', 'URL'], + [[t['id'], t.get('width', 'unknown'), t.get('height', 'unknown'), t['url']] for t in thumbnails])) + + def list_subtitles(self, video_id, subtitles, name='subtitles'): + if not subtitles: + self.to_screen('%s has no %s' % (video_id, name)) + return + self.to_screen( + 'Available %s for %s:' % (name, video_id)) + self.to_screen(render_table( + ['Language', 'formats'], + [[lang, ', '.join(f['ext'] for f in reversed(formats))] + for lang, formats in subtitles.items()])) + + def urlopen(self, req): + """ Start an HTTP download """ + if isinstance(req, compat_basestring): + req = sanitized_Request(req) + return self._opener.open(req, timeout=self._socket_timeout) + + def print_debug_header(self): + if not self.params.get('verbose'): + return + + if type('') is not compat_str: + # Python 2.6 on SLES11 SP1 (https://github.com/ytdl-org/youtube-dl/issues/3326) + self.report_warning( + 'Your Python is broken! Update to a newer and supported version') + + stdout_encoding = getattr( + sys.stdout, 'encoding', 'missing (%s)' % type(sys.stdout).__name__) + encoding_str = ( + '[debug] Encodings: locale %s, fs %s, out %s, pref %s\n' % ( + locale.getpreferredencoding(), + sys.getfilesystemencoding(), + stdout_encoding, + self.get_encoding())) + write_string(encoding_str, encoding=None) + + self._write_string('[debug] youtube-dlc version ' + __version__ + '\n') + if _LAZY_LOADER: + self._write_string('[debug] Lazy loading extractors enabled' + '\n') + try: + sp = subprocess.Popen( + ['git', 'rev-parse', '--short', 'HEAD'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + cwd=os.path.dirname(os.path.abspath(__file__))) + out, err = sp.communicate() + out = out.decode().strip() + if re.match('[0-9a-f]+', out): + self._write_string('[debug] Git HEAD: ' + out + '\n') + except Exception: + try: + sys.exc_clear() + except Exception: + pass + + def python_implementation(): + impl_name = platform.python_implementation() + if impl_name == 'PyPy' and hasattr(sys, 'pypy_version_info'): + return impl_name + ' version %d.%d.%d' % sys.pypy_version_info[:3] + return impl_name + + self._write_string('[debug] Python version %s (%s) - %s\n' % ( + platform.python_version(), python_implementation(), + platform_name())) + + exe_versions = FFmpegPostProcessor.get_versions(self) + exe_versions['rtmpdump'] = rtmpdump_version() + exe_versions['phantomjs'] = PhantomJSwrapper._version() + exe_str = ', '.join( + '%s %s' % (exe, v) + for exe, v in sorted(exe_versions.items()) + if v + ) + if not exe_str: + exe_str = 'none' + self._write_string('[debug] exe versions: %s\n' % exe_str) + + proxy_map = {} + for handler in self._opener.handlers: + if hasattr(handler, 'proxies'): + proxy_map.update(handler.proxies) + self._write_string('[debug] Proxy map: ' + compat_str(proxy_map) + '\n') + + if self.params.get('call_home', False): + ipaddr = self.urlopen('https://yt-dl.org/ip').read().decode('utf-8') + self._write_string('[debug] Public IP address: %s\n' % ipaddr) + latest_version = self.urlopen( + 'https://yt-dl.org/latest/version').read().decode('utf-8') + if version_tuple(latest_version) > version_tuple(__version__): + self.report_warning( + 'You are using an outdated version (newest version: %s)! ' + 'See https://yt-dl.org/update if you need help updating.' % + latest_version) + + def _setup_opener(self): + timeout_val = self.params.get('socket_timeout') + self._socket_timeout = 600 if timeout_val is None else float(timeout_val) + + opts_cookiefile = self.params.get('cookiefile') + opts_proxy = self.params.get('proxy') + + if opts_cookiefile is None: + self.cookiejar = compat_cookiejar.CookieJar() + else: + opts_cookiefile = expand_path(opts_cookiefile) + self.cookiejar = YoutubeDLCookieJar(opts_cookiefile) + if os.access(opts_cookiefile, os.R_OK): + self.cookiejar.load(ignore_discard=True, ignore_expires=True) + + cookie_processor = YoutubeDLCookieProcessor(self.cookiejar) + if opts_proxy is not None: + if opts_proxy == '': + proxies = {} + else: + proxies = {'http': opts_proxy, 'https': opts_proxy} + else: + proxies = compat_urllib_request.getproxies() + # Set HTTPS proxy to HTTP one if given (https://github.com/ytdl-org/youtube-dl/issues/805) + if 'http' in proxies and 'https' not in proxies: + proxies['https'] = proxies['http'] + proxy_handler = PerRequestProxyHandler(proxies) + + debuglevel = 1 if self.params.get('debug_printtraffic') else 0 + https_handler = make_HTTPS_handler(self.params, debuglevel=debuglevel) + ydlh = YoutubeDLHandler(self.params, debuglevel=debuglevel) + redirect_handler = YoutubeDLRedirectHandler() + data_handler = compat_urllib_request_DataHandler() + + # When passing our own FileHandler instance, build_opener won't add the + # default FileHandler and allows us to disable the file protocol, which + # can be used for malicious purposes (see + # https://github.com/ytdl-org/youtube-dl/issues/8227) + file_handler = compat_urllib_request.FileHandler() + + def file_open(*args, **kwargs): + raise compat_urllib_error.URLError('file:// scheme is explicitly disabled in youtube-dlc for security reasons') + file_handler.file_open = file_open + + opener = compat_urllib_request.build_opener( + proxy_handler, https_handler, cookie_processor, ydlh, redirect_handler, data_handler, file_handler) + + # Delete the default user-agent header, which would otherwise apply in + # cases where our custom HTTP handler doesn't come into play + # (See https://github.com/ytdl-org/youtube-dl/issues/1309 for details) + opener.addheaders = [] + self._opener = opener + + def encode(self, s): + if isinstance(s, bytes): + return s # Already encoded + + try: + return s.encode(self.get_encoding()) + except UnicodeEncodeError as err: + err.reason = err.reason + '. Check your system encoding configuration or use the --encoding option.' + raise + + def get_encoding(self): + encoding = self.params.get('encoding') + if encoding is None: + encoding = preferredencoding() + return encoding + + def _write_thumbnails(self, info_dict, filename): + if self.params.get('writethumbnail', False): + thumbnails = info_dict.get('thumbnails') + if thumbnails: + thumbnails = [thumbnails[-1]] + elif self.params.get('write_all_thumbnails', False): + thumbnails = info_dict.get('thumbnails') + else: + return + + if not thumbnails: + # No thumbnails present, so return immediately + return + + for t in thumbnails: + thumb_ext = determine_ext(t['url'], 'jpg') + suffix = '_%s' % t['id'] if len(thumbnails) > 1 else '' + thumb_display_id = '%s ' % t['id'] if len(thumbnails) > 1 else '' + t['filename'] = thumb_filename = os.path.splitext(filename)[0] + suffix + '.' + thumb_ext + + if self.params.get('nooverwrites', False) and os.path.exists(encodeFilename(thumb_filename)): + self.to_screen('[%s] %s: Thumbnail %sis already present' % + (info_dict['extractor'], info_dict['id'], thumb_display_id)) + else: + self.to_screen('[%s] %s: Downloading thumbnail %s...' % + (info_dict['extractor'], info_dict['id'], thumb_display_id)) + try: + uf = self.urlopen(t['url']) + with open(encodeFilename(thumb_filename), 'wb') as thumbf: + shutil.copyfileobj(uf, thumbf) + self.to_screen('[%s] %s: Writing thumbnail %sto: %s' % + (info_dict['extractor'], info_dict['id'], thumb_display_id, thumb_filename)) + except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err: + self.report_warning('Unable to download thumbnail "%s": %s' % + (t['url'], error_to_compat_str(err))) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py new file mode 100644 index 000000000..a663417da --- /dev/null +++ b/youtube_dl/__init__.py @@ -0,0 +1,483 @@ +#!/usr/bin/env python +# coding: utf-8 + +from __future__ import unicode_literals + +__license__ = 'Public Domain' + +import codecs +import io +import os +import random +import sys + + +from .options import ( + parseOpts, +) +from .compat import ( + compat_getpass, + compat_shlex_split, + workaround_optparse_bug9161, +) +from .utils import ( + DateRange, + decodeOption, + DEFAULT_OUTTMPL, + DownloadError, + expand_path, + match_filter_func, + MaxDownloadsReached, + preferredencoding, + read_batch_urls, + SameFileError, + setproctitle, + std_headers, + write_string, + render_table, +) +from .update import update_self +from .downloader import ( + FileDownloader, +) +from .extractor import gen_extractors, list_extractors +from .extractor.adobepass import MSO_INFO +from .YoutubeDL import YoutubeDL + + +def _real_main(argv=None): + # Compatibility fixes for Windows + if sys.platform == 'win32': + # https://github.com/ytdl-org/youtube-dl/issues/820 + codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None) + + workaround_optparse_bug9161() + + setproctitle('youtube-dlc') + + parser, opts, args = parseOpts(argv) + + # Set user agent + if opts.user_agent is not None: + std_headers['User-Agent'] = opts.user_agent + + # Set referer + if opts.referer is not None: + std_headers['Referer'] = opts.referer + + # Custom HTTP headers + if opts.headers is not None: + for h in opts.headers: + if ':' not in h: + parser.error('wrong header formatting, it should be key:value, not "%s"' % h) + key, value = h.split(':', 1) + if opts.verbose: + write_string('[debug] Adding header from command line option %s:%s\n' % (key, value)) + std_headers[key] = value + + # Dump user agent + if opts.dump_user_agent: + write_string(std_headers['User-Agent'] + '\n', out=sys.stdout) + sys.exit(0) + + # Batch file verification + batch_urls = [] + if opts.batchfile is not None: + try: + if opts.batchfile == '-': + batchfd = sys.stdin + else: + batchfd = io.open( + expand_path(opts.batchfile), + 'r', encoding='utf-8', errors='ignore') + batch_urls = read_batch_urls(batchfd) + if opts.verbose: + write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n') + except IOError: + sys.exit('ERROR: batch file %s could not be read' % opts.batchfile) + all_urls = batch_urls + [url.strip() for url in args] # batch_urls are already striped in read_batch_urls + _enc = preferredencoding() + all_urls = [url.decode(_enc, 'ignore') if isinstance(url, bytes) else url for url in all_urls] + + if opts.list_extractors: + for ie in list_extractors(opts.age_limit): + write_string(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie._WORKING else '') + '\n', out=sys.stdout) + matchedUrls = [url for url in all_urls if ie.suitable(url)] + for mu in matchedUrls: + write_string(' ' + mu + '\n', out=sys.stdout) + sys.exit(0) + if opts.list_extractor_descriptions: + for ie in list_extractors(opts.age_limit): + if not ie._WORKING: + continue + desc = getattr(ie, 'IE_DESC', ie.IE_NAME) + if desc is False: + continue + if hasattr(ie, 'SEARCH_KEY'): + _SEARCHES = ('cute kittens', 'slithering pythons', 'falling cat', 'angry poodle', 'purple fish', 'running tortoise', 'sleeping bunny', 'burping cow') + _COUNTS = ('', '5', '10', 'all') + desc += ' (Example: "%s%s:%s" )' % (ie.SEARCH_KEY, random.choice(_COUNTS), random.choice(_SEARCHES)) + write_string(desc + '\n', out=sys.stdout) + sys.exit(0) + if opts.ap_list_mso: + 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) + + # 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') + if opts.password is not None and opts.username is None: + parser.error('account username missing\n') + if opts.ap_password is not None and opts.ap_username is None: + parser.error('TV Provider account username missing\n') + if opts.outtmpl is not None and (opts.usetitle or opts.autonumber or opts.useid): + parser.error('using output template conflicts with using title, video ID or auto number') + if opts.autonumber_size is not None: + if opts.autonumber_size <= 0: + parser.error('auto number size must be positive') + if opts.autonumber_start is not None: + if opts.autonumber_start < 0: + parser.error('auto number start must be positive or 0') + if opts.usetitle and opts.useid: + parser.error('using title conflicts with using video ID') + if opts.username is not None and opts.password is None: + opts.password = compat_getpass('Type account password and press [Return]: ') + if opts.ap_username is not None and opts.ap_password is None: + opts.ap_password = compat_getpass('Type TV provider account password and press [Return]: ') + if opts.ratelimit is not None: + numeric_limit = FileDownloader.parse_bytes(opts.ratelimit) + if numeric_limit is None: + parser.error('invalid rate limit specified') + opts.ratelimit = numeric_limit + if opts.min_filesize is not None: + numeric_limit = FileDownloader.parse_bytes(opts.min_filesize) + if numeric_limit is None: + parser.error('invalid min_filesize specified') + opts.min_filesize = numeric_limit + if opts.max_filesize is not None: + numeric_limit = FileDownloader.parse_bytes(opts.max_filesize) + if numeric_limit is None: + parser.error('invalid max_filesize specified') + opts.max_filesize = numeric_limit + if opts.sleep_interval is not None: + if opts.sleep_interval < 0: + parser.error('sleep interval must be positive or 0') + if opts.max_sleep_interval is not None: + if opts.max_sleep_interval < 0: + parser.error('max sleep interval must be positive or 0') + if opts.sleep_interval is None: + parser.error('min sleep interval must be specified, use --min-sleep-interval') + if opts.max_sleep_interval < opts.sleep_interval: + parser.error('max sleep interval must be greater than or equal to min sleep interval') + else: + opts.max_sleep_interval = opts.sleep_interval + if opts.ap_mso and opts.ap_mso not in MSO_INFO: + parser.error('Unsupported TV Provider, use --ap-list-mso to get a list of supported TV Providers') + + def parse_retries(retries): + if retries in ('inf', 'infinite'): + parsed_retries = float('inf') + else: + try: + parsed_retries = int(retries) + except (TypeError, ValueError): + parser.error('invalid retry count specified') + return parsed_retries + if opts.retries is not None: + opts.retries = parse_retries(opts.retries) + if opts.fragment_retries is not None: + opts.fragment_retries = parse_retries(opts.fragment_retries) + if opts.buffersize is not None: + numeric_buffersize = FileDownloader.parse_bytes(opts.buffersize) + if numeric_buffersize is None: + parser.error('invalid buffer size specified') + opts.buffersize = numeric_buffersize + if opts.http_chunk_size is not None: + numeric_chunksize = FileDownloader.parse_bytes(opts.http_chunk_size) + if not numeric_chunksize: + parser.error('invalid http chunk size specified') + opts.http_chunk_size = numeric_chunksize + if opts.playliststart <= 0: + raise ValueError('Playlist start must be positive') + if opts.playlistend not in (-1, None) and opts.playlistend < opts.playliststart: + raise ValueError('Playlist end must be greater than playlist start') + if opts.extractaudio: + if opts.audioformat not in ['best', 'aac', 'flac', 'mp3', 'm4a', 'opus', 'vorbis', 'wav']: + parser.error('invalid audio format specified') + if opts.audioquality: + opts.audioquality = opts.audioquality.strip('k').strip('K') + if not opts.audioquality.isdigit(): + parser.error('invalid audio quality specified') + if opts.recodevideo is not None: + if opts.recodevideo not in ['mp4', 'flv', 'webm', 'ogg', 'mkv', 'avi']: + parser.error('invalid video recode format specified') + if opts.convertsubtitles is not None: + if opts.convertsubtitles not in ['srt', 'vtt', 'ass', 'lrc']: + parser.error('invalid subtitle format specified') + + if opts.date is not None: + date = DateRange.day(opts.date) + else: + date = DateRange(opts.dateafter, opts.datebefore) + + # Do not download videos when there are audio-only formats + if opts.extractaudio and not opts.keepvideo and opts.format is None: + opts.format = 'bestaudio/best' + + # --all-sub automatically sets --write-sub if --write-auto-sub is not given + # this was the old behaviour if only --all-sub was given. + if opts.allsubtitles and not opts.writeautomaticsub: + opts.writesubtitles = True + + outtmpl = ((opts.outtmpl is not None and opts.outtmpl) + or (opts.format == '-1' and opts.usetitle and '%(title)s-%(id)s-%(format)s.%(ext)s') + or (opts.format == '-1' and '%(id)s-%(format)s.%(ext)s') + or (opts.usetitle and opts.autonumber and '%(autonumber)s-%(title)s-%(id)s.%(ext)s') + or (opts.usetitle and '%(title)s-%(id)s.%(ext)s') + or (opts.useid and '%(id)s.%(ext)s') + or (opts.autonumber and '%(autonumber)s-%(id)s.%(ext)s') + or DEFAULT_OUTTMPL) + if not os.path.splitext(outtmpl)[1] and opts.extractaudio: + parser.error('Cannot download a video and extract audio into the same' + ' file! Use "{0}.%(ext)s" instead of "{0}" as the output' + ' template'.format(outtmpl)) + + any_getting = opts.geturl or opts.gettitle or opts.getid or opts.getthumbnail or opts.getdescription or opts.getfilename or opts.getformat or opts.getduration or opts.dumpjson or opts.dump_single_json + any_printing = opts.print_json + download_archive_fn = expand_path(opts.download_archive) if opts.download_archive is not None else opts.download_archive + + # PostProcessors + postprocessors = [] + if opts.metafromtitle: + postprocessors.append({ + 'key': 'MetadataFromTitle', + 'titleformat': opts.metafromtitle + }) + if opts.extractaudio: + postprocessors.append({ + 'key': 'FFmpegExtractAudio', + 'preferredcodec': opts.audioformat, + 'preferredquality': opts.audioquality, + 'nopostoverwrites': opts.nopostoverwrites, + }) + if opts.recodevideo: + postprocessors.append({ + 'key': 'FFmpegVideoConvertor', + 'preferedformat': opts.recodevideo, + }) + # FFmpegMetadataPP should be run after FFmpegVideoConvertorPP and + # FFmpegExtractAudioPP as containers before conversion may not support + # metadata (3gp, webm, etc.) + # And this post-processor should be placed before other metadata + # manipulating post-processors (FFmpegEmbedSubtitle) to prevent loss of + # extra metadata. By default ffmpeg preserves metadata applicable for both + # source and target containers. From this point the container won't change, + # so metadata can be added here. + if opts.addmetadata: + postprocessors.append({'key': 'FFmpegMetadata'}) + if opts.convertsubtitles: + postprocessors.append({ + 'key': 'FFmpegSubtitlesConvertor', + 'format': opts.convertsubtitles, + }) + if opts.embedsubtitles: + postprocessors.append({ + 'key': 'FFmpegEmbedSubtitle', + }) + if opts.embedthumbnail: + already_have_thumbnail = opts.writethumbnail or opts.write_all_thumbnails + postprocessors.append({ + 'key': 'EmbedThumbnail', + 'already_have_thumbnail': already_have_thumbnail + }) + if not already_have_thumbnail: + opts.writethumbnail = True + # XAttrMetadataPP should be run after post-processors that may change file + # contents + if opts.xattrs: + postprocessors.append({'key': 'XAttrMetadata'}) + # Please keep ExecAfterDownload towards the bottom as it allows the user to modify the final file in any way. + # So if the user is able to remove the file before your postprocessor runs it might cause a few problems. + if opts.exec_cmd: + postprocessors.append({ + 'key': 'ExecAfterDownload', + 'exec_cmd': opts.exec_cmd, + }) + external_downloader_args = None + if opts.external_downloader_args: + external_downloader_args = compat_shlex_split(opts.external_downloader_args) + postprocessor_args = None + if opts.postprocessor_args: + postprocessor_args = compat_shlex_split(opts.postprocessor_args) + match_filter = ( + None if opts.match_filter is None + else match_filter_func(opts.match_filter)) + + ydl_opts = { + 'usenetrc': opts.usenetrc, + 'username': opts.username, + 'password': opts.password, + 'twofactor': opts.twofactor, + 'videopassword': opts.videopassword, + 'ap_mso': opts.ap_mso, + 'ap_username': opts.ap_username, + 'ap_password': opts.ap_password, + 'quiet': (opts.quiet or any_getting or any_printing), + 'no_warnings': opts.no_warnings, + 'forceurl': opts.geturl, + 'forcetitle': opts.gettitle, + 'forceid': opts.getid, + 'forcethumbnail': opts.getthumbnail, + 'forcedescription': opts.getdescription, + 'forceduration': opts.getduration, + 'forcefilename': opts.getfilename, + 'forceformat': opts.getformat, + 'forcejson': opts.dumpjson or opts.print_json, + 'dump_single_json': opts.dump_single_json, + 'simulate': opts.simulate or any_getting, + 'skip_download': opts.skip_download, + 'format': opts.format, + 'listformats': opts.listformats, + 'outtmpl': outtmpl, + 'autonumber_size': opts.autonumber_size, + 'autonumber_start': opts.autonumber_start, + 'restrictfilenames': opts.restrictfilenames, + 'ignoreerrors': opts.ignoreerrors, + 'force_generic_extractor': opts.force_generic_extractor, + 'ratelimit': opts.ratelimit, + 'nooverwrites': opts.nooverwrites, + 'retries': opts.retries, + 'fragment_retries': opts.fragment_retries, + 'skip_unavailable_fragments': opts.skip_unavailable_fragments, + 'keep_fragments': opts.keep_fragments, + 'buffersize': opts.buffersize, + 'noresizebuffer': opts.noresizebuffer, + 'http_chunk_size': opts.http_chunk_size, + 'continuedl': opts.continue_dl, + 'noprogress': opts.noprogress, + 'progress_with_newline': opts.progress_with_newline, + 'playliststart': opts.playliststart, + 'playlistend': opts.playlistend, + 'playlistreverse': opts.playlist_reverse, + 'playlistrandom': opts.playlist_random, + 'noplaylist': opts.noplaylist, + 'logtostderr': opts.outtmpl == '-', + 'consoletitle': opts.consoletitle, + 'nopart': opts.nopart, + 'updatetime': opts.updatetime, + 'writedescription': opts.writedescription, + 'writeannotations': opts.writeannotations, + 'writeinfojson': opts.writeinfojson, + 'writethumbnail': opts.writethumbnail, + 'write_all_thumbnails': opts.write_all_thumbnails, + 'writesubtitles': opts.writesubtitles, + 'writeautomaticsub': opts.writeautomaticsub, + 'allsubtitles': opts.allsubtitles, + 'listsubtitles': opts.listsubtitles, + 'subtitlesformat': opts.subtitlesformat, + 'subtitleslangs': opts.subtitleslangs, + 'matchtitle': decodeOption(opts.matchtitle), + 'rejecttitle': decodeOption(opts.rejecttitle), + 'max_downloads': opts.max_downloads, + 'prefer_free_formats': opts.prefer_free_formats, + 'verbose': opts.verbose, + 'dump_intermediate_pages': opts.dump_intermediate_pages, + 'write_pages': opts.write_pages, + 'test': opts.test, + 'keepvideo': opts.keepvideo, + 'min_filesize': opts.min_filesize, + 'max_filesize': opts.max_filesize, + 'min_views': opts.min_views, + 'max_views': opts.max_views, + 'daterange': date, + 'cachedir': opts.cachedir, + 'youtube_print_sig_code': opts.youtube_print_sig_code, + 'age_limit': opts.age_limit, + 'download_archive': download_archive_fn, + 'cookiefile': opts.cookiefile, + 'nocheckcertificate': opts.no_check_certificate, + 'prefer_insecure': opts.prefer_insecure, + 'proxy': opts.proxy, + 'socket_timeout': opts.socket_timeout, + 'bidi_workaround': opts.bidi_workaround, + 'debug_printtraffic': opts.debug_printtraffic, + 'prefer_ffmpeg': opts.prefer_ffmpeg, + 'include_ads': opts.include_ads, + 'default_search': opts.default_search, + 'youtube_include_dash_manifest': opts.youtube_include_dash_manifest, + 'encoding': opts.encoding, + 'extract_flat': opts.extract_flat, + 'mark_watched': opts.mark_watched, + 'merge_output_format': opts.merge_output_format, + 'postprocessors': postprocessors, + 'fixup': opts.fixup, + 'source_address': opts.source_address, + 'call_home': opts.call_home, + 'sleep_interval': opts.sleep_interval, + 'max_sleep_interval': opts.max_sleep_interval, + 'external_downloader': opts.external_downloader, + 'list_thumbnails': opts.list_thumbnails, + 'playlist_items': opts.playlist_items, + 'xattr_set_filesize': opts.xattr_set_filesize, + 'match_filter': match_filter, + 'no_color': opts.no_color, + 'ffmpeg_location': opts.ffmpeg_location, + 'hls_prefer_native': opts.hls_prefer_native, + 'hls_use_mpegts': opts.hls_use_mpegts, + 'external_downloader_args': external_downloader_args, + 'postprocessor_args': postprocessor_args, + 'cn_verification_proxy': opts.cn_verification_proxy, + 'geo_verification_proxy': opts.geo_verification_proxy, + 'config_location': opts.config_location, + 'geo_bypass': opts.geo_bypass, + 'geo_bypass_country': opts.geo_bypass_country, + 'geo_bypass_ip_block': opts.geo_bypass_ip_block, + # just for deprecation check + 'autonumber': opts.autonumber if opts.autonumber is True else None, + 'usetitle': opts.usetitle if opts.usetitle is True else None, + } + + with YoutubeDL(ydl_opts) as ydl: + # Update version + if opts.update_self: + update_self(ydl.to_screen, opts.verbose, ydl._opener) + + # Remove cache dir + if opts.rm_cachedir: + ydl.cache.remove() + + # Maybe do nothing + if (len(all_urls) < 1) and (opts.load_info_filename is None): + if opts.update_self or opts.rm_cachedir: + sys.exit() + + ydl.warn_if_short_id(sys.argv[1:] if argv is None else argv) + parser.error( + 'You must provide at least one URL.\n' + 'Type youtube-dlc --help to see a list of all options.') + + try: + if opts.load_info_filename is not None: + retcode = ydl.download_with_info_file(expand_path(opts.load_info_filename)) + else: + retcode = ydl.download(all_urls) + except MaxDownloadsReached: + ydl.to_screen('--max-download limit reached, aborting.') + retcode = 101 + + sys.exit(retcode) + + +def main(argv=None): + try: + _real_main(argv) + except DownloadError: + sys.exit(1) + except SameFileError: + sys.exit('ERROR: fixed output name but more than one file to download') + except KeyboardInterrupt: + sys.exit('\nERROR: Interrupted by user') + + +__all__ = ['main', 'YoutubeDL', 'gen_extractors', 'list_extractors'] diff --git a/youtube_dl/__main__.py b/youtube_dl/__main__.py new file mode 100644 index 000000000..0e7601686 --- /dev/null +++ b/youtube_dl/__main__.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +from __future__ import unicode_literals + +# Execute with +# $ python youtube_dlc/__main__.py (2.6+) +# $ python -m youtube_dlc (2.7+) + +import sys + +if __package__ is None and not hasattr(sys, 'frozen'): + # direct call of __main__.py + import os.path + path = os.path.realpath(os.path.abspath(__file__)) + sys.path.insert(0, os.path.dirname(os.path.dirname(path))) + +import youtube_dlc + +if __name__ == '__main__': + youtube_dlc.main() diff --git a/youtube_dl/aes.py b/youtube_dl/aes.py new file mode 100644 index 000000000..461bb6d41 --- /dev/null +++ b/youtube_dl/aes.py @@ -0,0 +1,361 @@ +from __future__ import unicode_literals + +from math import ceil + +from .compat import compat_b64decode +from .utils import bytes_to_intlist, intlist_to_bytes + +BLOCK_SIZE_BYTES = 16 + + +def aes_ctr_decrypt(data, key, counter): + """ + Decrypt with aes in counter mode + + @param {int[]} data cipher + @param {int[]} key 16/24/32-Byte cipher key + @param {instance} counter Instance whose next_value function (@returns {int[]} 16-Byte block) + returns the next counter block + @returns {int[]} decrypted data + """ + expanded_key = key_expansion(key) + block_count = int(ceil(float(len(data)) / BLOCK_SIZE_BYTES)) + + decrypted_data = [] + for i in range(block_count): + counter_block = counter.next_value() + block = data[i * BLOCK_SIZE_BYTES: (i + 1) * BLOCK_SIZE_BYTES] + block += [0] * (BLOCK_SIZE_BYTES - len(block)) + + cipher_counter_block = aes_encrypt(counter_block, expanded_key) + decrypted_data += xor(block, cipher_counter_block) + decrypted_data = decrypted_data[:len(data)] + + return decrypted_data + + +def aes_cbc_decrypt(data, key, iv): + """ + Decrypt with aes in CBC mode + + @param {int[]} data cipher + @param {int[]} key 16/24/32-Byte cipher key + @param {int[]} iv 16-Byte IV + @returns {int[]} decrypted data + """ + expanded_key = key_expansion(key) + block_count = int(ceil(float(len(data)) / BLOCK_SIZE_BYTES)) + + decrypted_data = [] + previous_cipher_block = iv + for i in range(block_count): + block = data[i * BLOCK_SIZE_BYTES: (i + 1) * BLOCK_SIZE_BYTES] + block += [0] * (BLOCK_SIZE_BYTES - len(block)) + + decrypted_block = aes_decrypt(block, expanded_key) + decrypted_data += xor(decrypted_block, previous_cipher_block) + previous_cipher_block = block + decrypted_data = decrypted_data[:len(data)] + + return decrypted_data + + +def aes_cbc_encrypt(data, key, iv): + """ + Encrypt with aes in CBC mode. Using PKCS#7 padding + + @param {int[]} data cleartext + @param {int[]} key 16/24/32-Byte cipher key + @param {int[]} iv 16-Byte IV + @returns {int[]} encrypted data + """ + expanded_key = key_expansion(key) + block_count = int(ceil(float(len(data)) / BLOCK_SIZE_BYTES)) + + encrypted_data = [] + previous_cipher_block = iv + for i in range(block_count): + block = data[i * BLOCK_SIZE_BYTES: (i + 1) * BLOCK_SIZE_BYTES] + remaining_length = BLOCK_SIZE_BYTES - len(block) + block += [remaining_length] * remaining_length + mixed_block = xor(block, previous_cipher_block) + + encrypted_block = aes_encrypt(mixed_block, expanded_key) + encrypted_data += encrypted_block + + previous_cipher_block = encrypted_block + + return encrypted_data + + +def key_expansion(data): + """ + Generate key schedule + + @param {int[]} data 16/24/32-Byte cipher key + @returns {int[]} 176/208/240-Byte expanded key + """ + data = data[:] # copy + rcon_iteration = 1 + key_size_bytes = len(data) + expanded_key_size_bytes = (key_size_bytes // 4 + 7) * BLOCK_SIZE_BYTES + + while len(data) < expanded_key_size_bytes: + temp = data[-4:] + temp = key_schedule_core(temp, rcon_iteration) + rcon_iteration += 1 + data += xor(temp, data[-key_size_bytes: 4 - key_size_bytes]) + + for _ in range(3): + temp = data[-4:] + data += xor(temp, data[-key_size_bytes: 4 - key_size_bytes]) + + if key_size_bytes == 32: + temp = data[-4:] + temp = sub_bytes(temp) + data += xor(temp, data[-key_size_bytes: 4 - key_size_bytes]) + + for _ in range(3 if key_size_bytes == 32 else 2 if key_size_bytes == 24 else 0): + temp = data[-4:] + data += xor(temp, data[-key_size_bytes: 4 - key_size_bytes]) + data = data[:expanded_key_size_bytes] + + return data + + +def aes_encrypt(data, expanded_key): + """ + Encrypt one block with aes + + @param {int[]} data 16-Byte state + @param {int[]} expanded_key 176/208/240-Byte expanded key + @returns {int[]} 16-Byte cipher + """ + rounds = len(expanded_key) // BLOCK_SIZE_BYTES - 1 + + data = xor(data, expanded_key[:BLOCK_SIZE_BYTES]) + for i in range(1, rounds + 1): + data = sub_bytes(data) + data = shift_rows(data) + if i != rounds: + data = mix_columns(data) + data = xor(data, expanded_key[i * BLOCK_SIZE_BYTES: (i + 1) * BLOCK_SIZE_BYTES]) + + return data + + +def aes_decrypt(data, expanded_key): + """ + Decrypt one block with aes + + @param {int[]} data 16-Byte cipher + @param {int[]} expanded_key 176/208/240-Byte expanded key + @returns {int[]} 16-Byte state + """ + rounds = len(expanded_key) // BLOCK_SIZE_BYTES - 1 + + for i in range(rounds, 0, -1): + data = xor(data, expanded_key[i * BLOCK_SIZE_BYTES: (i + 1) * BLOCK_SIZE_BYTES]) + if i != rounds: + data = mix_columns_inv(data) + data = shift_rows_inv(data) + data = sub_bytes_inv(data) + data = xor(data, expanded_key[:BLOCK_SIZE_BYTES]) + + return data + + +def aes_decrypt_text(data, password, key_size_bytes): + """ + Decrypt text + - The first 8 Bytes of decoded 'data' are the 8 high Bytes of the counter + - The cipher key is retrieved by encrypting the first 16 Byte of 'password' + with the first 'key_size_bytes' Bytes from 'password' (if necessary filled with 0's) + - Mode of operation is 'counter' + + @param {str} data Base64 encoded string + @param {str,unicode} password Password (will be encoded with utf-8) + @param {int} key_size_bytes Possible values: 16 for 128-Bit, 24 for 192-Bit or 32 for 256-Bit + @returns {str} Decrypted data + """ + NONCE_LENGTH_BYTES = 8 + + data = bytes_to_intlist(compat_b64decode(data)) + password = bytes_to_intlist(password.encode('utf-8')) + + key = password[:key_size_bytes] + [0] * (key_size_bytes - len(password)) + key = aes_encrypt(key[:BLOCK_SIZE_BYTES], key_expansion(key)) * (key_size_bytes // BLOCK_SIZE_BYTES) + + nonce = data[:NONCE_LENGTH_BYTES] + cipher = data[NONCE_LENGTH_BYTES:] + + class Counter(object): + __value = nonce + [0] * (BLOCK_SIZE_BYTES - NONCE_LENGTH_BYTES) + + def next_value(self): + temp = self.__value + self.__value = inc(self.__value) + return temp + + decrypted_data = aes_ctr_decrypt(cipher, key, Counter()) + plaintext = intlist_to_bytes(decrypted_data) + + return plaintext + + +RCON = (0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36) +SBOX = (0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16) +SBOX_INV = (0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d) +MIX_COLUMN_MATRIX = ((0x2, 0x3, 0x1, 0x1), + (0x1, 0x2, 0x3, 0x1), + (0x1, 0x1, 0x2, 0x3), + (0x3, 0x1, 0x1, 0x2)) +MIX_COLUMN_MATRIX_INV = ((0xE, 0xB, 0xD, 0x9), + (0x9, 0xE, 0xB, 0xD), + (0xD, 0x9, 0xE, 0xB), + (0xB, 0xD, 0x9, 0xE)) +RIJNDAEL_EXP_TABLE = (0x01, 0x03, 0x05, 0x0F, 0x11, 0x33, 0x55, 0xFF, 0x1A, 0x2E, 0x72, 0x96, 0xA1, 0xF8, 0x13, 0x35, + 0x5F, 0xE1, 0x38, 0x48, 0xD8, 0x73, 0x95, 0xA4, 0xF7, 0x02, 0x06, 0x0A, 0x1E, 0x22, 0x66, 0xAA, + 0xE5, 0x34, 0x5C, 0xE4, 0x37, 0x59, 0xEB, 0x26, 0x6A, 0xBE, 0xD9, 0x70, 0x90, 0xAB, 0xE6, 0x31, + 0x53, 0xF5, 0x04, 0x0C, 0x14, 0x3C, 0x44, 0xCC, 0x4F, 0xD1, 0x68, 0xB8, 0xD3, 0x6E, 0xB2, 0xCD, + 0x4C, 0xD4, 0x67, 0xA9, 0xE0, 0x3B, 0x4D, 0xD7, 0x62, 0xA6, 0xF1, 0x08, 0x18, 0x28, 0x78, 0x88, + 0x83, 0x9E, 0xB9, 0xD0, 0x6B, 0xBD, 0xDC, 0x7F, 0x81, 0x98, 0xB3, 0xCE, 0x49, 0xDB, 0x76, 0x9A, + 0xB5, 0xC4, 0x57, 0xF9, 0x10, 0x30, 0x50, 0xF0, 0x0B, 0x1D, 0x27, 0x69, 0xBB, 0xD6, 0x61, 0xA3, + 0xFE, 0x19, 0x2B, 0x7D, 0x87, 0x92, 0xAD, 0xEC, 0x2F, 0x71, 0x93, 0xAE, 0xE9, 0x20, 0x60, 0xA0, + 0xFB, 0x16, 0x3A, 0x4E, 0xD2, 0x6D, 0xB7, 0xC2, 0x5D, 0xE7, 0x32, 0x56, 0xFA, 0x15, 0x3F, 0x41, + 0xC3, 0x5E, 0xE2, 0x3D, 0x47, 0xC9, 0x40, 0xC0, 0x5B, 0xED, 0x2C, 0x74, 0x9C, 0xBF, 0xDA, 0x75, + 0x9F, 0xBA, 0xD5, 0x64, 0xAC, 0xEF, 0x2A, 0x7E, 0x82, 0x9D, 0xBC, 0xDF, 0x7A, 0x8E, 0x89, 0x80, + 0x9B, 0xB6, 0xC1, 0x58, 0xE8, 0x23, 0x65, 0xAF, 0xEA, 0x25, 0x6F, 0xB1, 0xC8, 0x43, 0xC5, 0x54, + 0xFC, 0x1F, 0x21, 0x63, 0xA5, 0xF4, 0x07, 0x09, 0x1B, 0x2D, 0x77, 0x99, 0xB0, 0xCB, 0x46, 0xCA, + 0x45, 0xCF, 0x4A, 0xDE, 0x79, 0x8B, 0x86, 0x91, 0xA8, 0xE3, 0x3E, 0x42, 0xC6, 0x51, 0xF3, 0x0E, + 0x12, 0x36, 0x5A, 0xEE, 0x29, 0x7B, 0x8D, 0x8C, 0x8F, 0x8A, 0x85, 0x94, 0xA7, 0xF2, 0x0D, 0x17, + 0x39, 0x4B, 0xDD, 0x7C, 0x84, 0x97, 0xA2, 0xFD, 0x1C, 0x24, 0x6C, 0xB4, 0xC7, 0x52, 0xF6, 0x01) +RIJNDAEL_LOG_TABLE = (0x00, 0x00, 0x19, 0x01, 0x32, 0x02, 0x1a, 0xc6, 0x4b, 0xc7, 0x1b, 0x68, 0x33, 0xee, 0xdf, 0x03, + 0x64, 0x04, 0xe0, 0x0e, 0x34, 0x8d, 0x81, 0xef, 0x4c, 0x71, 0x08, 0xc8, 0xf8, 0x69, 0x1c, 0xc1, + 0x7d, 0xc2, 0x1d, 0xb5, 0xf9, 0xb9, 0x27, 0x6a, 0x4d, 0xe4, 0xa6, 0x72, 0x9a, 0xc9, 0x09, 0x78, + 0x65, 0x2f, 0x8a, 0x05, 0x21, 0x0f, 0xe1, 0x24, 0x12, 0xf0, 0x82, 0x45, 0x35, 0x93, 0xda, 0x8e, + 0x96, 0x8f, 0xdb, 0xbd, 0x36, 0xd0, 0xce, 0x94, 0x13, 0x5c, 0xd2, 0xf1, 0x40, 0x46, 0x83, 0x38, + 0x66, 0xdd, 0xfd, 0x30, 0xbf, 0x06, 0x8b, 0x62, 0xb3, 0x25, 0xe2, 0x98, 0x22, 0x88, 0x91, 0x10, + 0x7e, 0x6e, 0x48, 0xc3, 0xa3, 0xb6, 0x1e, 0x42, 0x3a, 0x6b, 0x28, 0x54, 0xfa, 0x85, 0x3d, 0xba, + 0x2b, 0x79, 0x0a, 0x15, 0x9b, 0x9f, 0x5e, 0xca, 0x4e, 0xd4, 0xac, 0xe5, 0xf3, 0x73, 0xa7, 0x57, + 0xaf, 0x58, 0xa8, 0x50, 0xf4, 0xea, 0xd6, 0x74, 0x4f, 0xae, 0xe9, 0xd5, 0xe7, 0xe6, 0xad, 0xe8, + 0x2c, 0xd7, 0x75, 0x7a, 0xeb, 0x16, 0x0b, 0xf5, 0x59, 0xcb, 0x5f, 0xb0, 0x9c, 0xa9, 0x51, 0xa0, + 0x7f, 0x0c, 0xf6, 0x6f, 0x17, 0xc4, 0x49, 0xec, 0xd8, 0x43, 0x1f, 0x2d, 0xa4, 0x76, 0x7b, 0xb7, + 0xcc, 0xbb, 0x3e, 0x5a, 0xfb, 0x60, 0xb1, 0x86, 0x3b, 0x52, 0xa1, 0x6c, 0xaa, 0x55, 0x29, 0x9d, + 0x97, 0xb2, 0x87, 0x90, 0x61, 0xbe, 0xdc, 0xfc, 0xbc, 0x95, 0xcf, 0xcd, 0x37, 0x3f, 0x5b, 0xd1, + 0x53, 0x39, 0x84, 0x3c, 0x41, 0xa2, 0x6d, 0x47, 0x14, 0x2a, 0x9e, 0x5d, 0x56, 0xf2, 0xd3, 0xab, + 0x44, 0x11, 0x92, 0xd9, 0x23, 0x20, 0x2e, 0x89, 0xb4, 0x7c, 0xb8, 0x26, 0x77, 0x99, 0xe3, 0xa5, + 0x67, 0x4a, 0xed, 0xde, 0xc5, 0x31, 0xfe, 0x18, 0x0d, 0x63, 0x8c, 0x80, 0xc0, 0xf7, 0x70, 0x07) + + +def sub_bytes(data): + return [SBOX[x] for x in data] + + +def sub_bytes_inv(data): + return [SBOX_INV[x] for x in data] + + +def rotate(data): + return data[1:] + [data[0]] + + +def key_schedule_core(data, rcon_iteration): + data = rotate(data) + data = sub_bytes(data) + data[0] = data[0] ^ RCON[rcon_iteration] + + return data + + +def xor(data1, data2): + return [x ^ y for x, y in zip(data1, data2)] + + +def rijndael_mul(a, b): + if(a == 0 or b == 0): + return 0 + return RIJNDAEL_EXP_TABLE[(RIJNDAEL_LOG_TABLE[a] + RIJNDAEL_LOG_TABLE[b]) % 0xFF] + + +def mix_column(data, matrix): + data_mixed = [] + for row in range(4): + mixed = 0 + for column in range(4): + # xor is (+) and (-) + mixed ^= rijndael_mul(data[column], matrix[row][column]) + data_mixed.append(mixed) + return data_mixed + + +def mix_columns(data, matrix=MIX_COLUMN_MATRIX): + data_mixed = [] + for i in range(4): + column = data[i * 4: (i + 1) * 4] + data_mixed += mix_column(column, matrix) + return data_mixed + + +def mix_columns_inv(data): + return mix_columns(data, MIX_COLUMN_MATRIX_INV) + + +def shift_rows(data): + data_shifted = [] + for column in range(4): + for row in range(4): + data_shifted.append(data[((column + row) & 0b11) * 4 + row]) + return data_shifted + + +def shift_rows_inv(data): + data_shifted = [] + for column in range(4): + for row in range(4): + data_shifted.append(data[((column - row) & 0b11) * 4 + row]) + return data_shifted + + +def inc(data): + data = data[:] # copy + for i in range(len(data) - 1, -1, -1): + if data[i] == 255: + data[i] = 0 + else: + data[i] = data[i] + 1 + break + return data + + +__all__ = ['aes_encrypt', 'key_expansion', 'aes_ctr_decrypt', 'aes_cbc_decrypt', 'aes_decrypt_text'] diff --git a/youtube_dl/cache.py b/youtube_dl/cache.py new file mode 100644 index 000000000..ada6aa1f2 --- /dev/null +++ b/youtube_dl/cache.py @@ -0,0 +1,96 @@ +from __future__ import unicode_literals + +import errno +import io +import json +import os +import re +import shutil +import traceback + +from .compat import compat_getenv +from .utils import ( + expand_path, + write_json_file, +) + + +class Cache(object): + def __init__(self, ydl): + self._ydl = ydl + + def _get_root_dir(self): + res = self._ydl.params.get('cachedir') + if res is None: + cache_root = compat_getenv('XDG_CACHE_HOME', '~/.cache') + res = os.path.join(cache_root, 'youtube-dlc') + return expand_path(res) + + def _get_cache_fn(self, section, key, dtype): + assert re.match(r'^[a-zA-Z0-9_.-]+$', section), \ + 'invalid section %r' % section + assert re.match(r'^[a-zA-Z0-9_.-]+$', key), 'invalid key %r' % key + return os.path.join( + self._get_root_dir(), section, '%s.%s' % (key, dtype)) + + @property + def enabled(self): + return self._ydl.params.get('cachedir') is not False + + def store(self, section, key, data, dtype='json'): + assert dtype in ('json',) + + if not self.enabled: + return + + fn = self._get_cache_fn(section, key, dtype) + try: + try: + os.makedirs(os.path.dirname(fn)) + except OSError as ose: + if ose.errno != errno.EEXIST: + raise + write_json_file(data, fn) + except Exception: + tb = traceback.format_exc() + self._ydl.report_warning( + 'Writing cache to %r failed: %s' % (fn, tb)) + + def load(self, section, key, dtype='json', default=None): + assert dtype in ('json',) + + if not self.enabled: + return default + + cache_fn = self._get_cache_fn(section, key, dtype) + try: + try: + with io.open(cache_fn, 'r', encoding='utf-8') as cachef: + return json.load(cachef) + except ValueError: + try: + file_size = os.path.getsize(cache_fn) + except (OSError, IOError) as oe: + file_size = str(oe) + self._ydl.report_warning( + 'Cache retrieval from %s failed (%s)' % (cache_fn, file_size)) + except IOError: + pass # No cache available + + return default + + def remove(self): + if not self.enabled: + self._ydl.to_screen('Cache is disabled (Did you combine --no-cache-dir and --rm-cache-dir?)') + return + + cachedir = self._get_root_dir() + if not any((term in cachedir) for term in ('cache', 'tmp')): + raise Exception('Not removing directory %s - this does not look like a cache dir' % cachedir) + + self._ydl.to_screen( + 'Removing cache dir %s .' % cachedir, skip_eol=True) + if os.path.exists(cachedir): + self._ydl.to_screen('.', skip_eol=True) + shutil.rmtree(cachedir) + self._ydl.to_screen('.') diff --git a/youtube_dl/compat.py b/youtube_dl/compat.py new file mode 100644 index 000000000..1cf7efed6 --- /dev/null +++ b/youtube_dl/compat.py @@ -0,0 +1,3050 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import base64 +import binascii +import collections +import ctypes +import email +import getpass +import io +import itertools +import optparse +import os +import platform +import re +import shlex +import shutil +import socket +import struct +import subprocess +import sys +import xml.etree.ElementTree + + +try: + import urllib.request as compat_urllib_request +except ImportError: # Python 2 + import urllib2 as compat_urllib_request + +try: + import urllib.error as compat_urllib_error +except ImportError: # Python 2 + import urllib2 as compat_urllib_error + +try: + import urllib.parse as compat_urllib_parse +except ImportError: # Python 2 + import urllib as compat_urllib_parse + +try: + from urllib.parse import urlparse as compat_urllib_parse_urlparse +except ImportError: # Python 2 + from urlparse import urlparse as compat_urllib_parse_urlparse + +try: + import urllib.parse as compat_urlparse +except ImportError: # Python 2 + import urlparse as compat_urlparse + +try: + import urllib.response as compat_urllib_response +except ImportError: # Python 2 + import urllib as compat_urllib_response + +try: + import http.cookiejar as compat_cookiejar +except ImportError: # Python 2 + import cookielib as compat_cookiejar + +if sys.version_info[0] == 2: + class compat_cookiejar_Cookie(compat_cookiejar.Cookie): + def __init__(self, version, name, value, *args, **kwargs): + if isinstance(name, compat_str): + name = name.encode() + if isinstance(value, compat_str): + value = value.encode() + compat_cookiejar.Cookie.__init__(self, version, name, value, *args, **kwargs) +else: + compat_cookiejar_Cookie = compat_cookiejar.Cookie + +try: + import http.cookies as compat_cookies +except ImportError: # Python 2 + import Cookie as compat_cookies + +try: + import html.entities as compat_html_entities +except ImportError: # Python 2 + import htmlentitydefs as compat_html_entities + +try: # Python >= 3.3 + compat_html_entities_html5 = compat_html_entities.html5 +except AttributeError: + # Copied from CPython 3.5.1 html/entities.py + compat_html_entities_html5 = { + 'Aacute': '\xc1', + 'aacute': '\xe1', + 'Aacute;': '\xc1', + 'aacute;': '\xe1', + 'Abreve;': '\u0102', + 'abreve;': '\u0103', + 'ac;': '\u223e', + 'acd;': '\u223f', + 'acE;': '\u223e\u0333', + 'Acirc': '\xc2', + 'acirc': '\xe2', + 'Acirc;': '\xc2', + 'acirc;': '\xe2', + 'acute': '\xb4', + 'acute;': '\xb4', + 'Acy;': '\u0410', + 'acy;': '\u0430', + 'AElig': '\xc6', + 'aelig': '\xe6', + 'AElig;': '\xc6', + 'aelig;': '\xe6', + 'af;': '\u2061', + 'Afr;': '\U0001d504', + 'afr;': '\U0001d51e', + 'Agrave': '\xc0', + 'agrave': '\xe0', + 'Agrave;': '\xc0', + 'agrave;': '\xe0', + 'alefsym;': '\u2135', + 'aleph;': '\u2135', + 'Alpha;': '\u0391', + 'alpha;': '\u03b1', + 'Amacr;': '\u0100', + 'amacr;': '\u0101', + 'amalg;': '\u2a3f', + 'AMP': '&', + 'amp': '&', + 'AMP;': '&', + 'amp;': '&', + 'And;': '\u2a53', + 'and;': '\u2227', + 'andand;': '\u2a55', + 'andd;': '\u2a5c', + 'andslope;': '\u2a58', + 'andv;': '\u2a5a', + 'ang;': '\u2220', + 'ange;': '\u29a4', + 'angle;': '\u2220', + 'angmsd;': '\u2221', + 'angmsdaa;': '\u29a8', + 'angmsdab;': '\u29a9', + 'angmsdac;': '\u29aa', + 'angmsdad;': '\u29ab', + 'angmsdae;': '\u29ac', + 'angmsdaf;': '\u29ad', + 'angmsdag;': '\u29ae', + 'angmsdah;': '\u29af', + 'angrt;': '\u221f', + 'angrtvb;': '\u22be', + 'angrtvbd;': '\u299d', + 'angsph;': '\u2222', + 'angst;': '\xc5', + 'angzarr;': '\u237c', + 'Aogon;': '\u0104', + 'aogon;': '\u0105', + 'Aopf;': '\U0001d538', + 'aopf;': '\U0001d552', + 'ap;': '\u2248', + 'apacir;': '\u2a6f', + 'apE;': '\u2a70', + 'ape;': '\u224a', + 'apid;': '\u224b', + 'apos;': "'", + 'ApplyFunction;': '\u2061', + 'approx;': '\u2248', + 'approxeq;': '\u224a', + 'Aring': '\xc5', + 'aring': '\xe5', + 'Aring;': '\xc5', + 'aring;': '\xe5', + 'Ascr;': '\U0001d49c', + 'ascr;': '\U0001d4b6', + 'Assign;': '\u2254', + 'ast;': '*', + 'asymp;': '\u2248', + 'asympeq;': '\u224d', + 'Atilde': '\xc3', + 'atilde': '\xe3', + 'Atilde;': '\xc3', + 'atilde;': '\xe3', + 'Auml': '\xc4', + 'auml': '\xe4', + 'Auml;': '\xc4', + 'auml;': '\xe4', + 'awconint;': '\u2233', + 'awint;': '\u2a11', + 'backcong;': '\u224c', + 'backepsilon;': '\u03f6', + 'backprime;': '\u2035', + 'backsim;': '\u223d', + 'backsimeq;': '\u22cd', + 'Backslash;': '\u2216', + 'Barv;': '\u2ae7', + 'barvee;': '\u22bd', + 'Barwed;': '\u2306', + 'barwed;': '\u2305', + 'barwedge;': '\u2305', + 'bbrk;': '\u23b5', + 'bbrktbrk;': '\u23b6', + 'bcong;': '\u224c', + 'Bcy;': '\u0411', + 'bcy;': '\u0431', + 'bdquo;': '\u201e', + 'becaus;': '\u2235', + 'Because;': '\u2235', + 'because;': '\u2235', + 'bemptyv;': '\u29b0', + 'bepsi;': '\u03f6', + 'bernou;': '\u212c', + 'Bernoullis;': '\u212c', + 'Beta;': '\u0392', + 'beta;': '\u03b2', + 'beth;': '\u2136', + 'between;': '\u226c', + 'Bfr;': '\U0001d505', + 'bfr;': '\U0001d51f', + 'bigcap;': '\u22c2', + 'bigcirc;': '\u25ef', + 'bigcup;': '\u22c3', + 'bigodot;': '\u2a00', + 'bigoplus;': '\u2a01', + 'bigotimes;': '\u2a02', + 'bigsqcup;': '\u2a06', + 'bigstar;': '\u2605', + 'bigtriangledown;': '\u25bd', + 'bigtriangleup;': '\u25b3', + 'biguplus;': '\u2a04', + 'bigvee;': '\u22c1', + 'bigwedge;': '\u22c0', + 'bkarow;': '\u290d', + 'blacklozenge;': '\u29eb', + 'blacksquare;': '\u25aa', + 'blacktriangle;': '\u25b4', + 'blacktriangledown;': '\u25be', + 'blacktriangleleft;': '\u25c2', + 'blacktriangleright;': '\u25b8', + 'blank;': '\u2423', + 'blk12;': '\u2592', + 'blk14;': '\u2591', + 'blk34;': '\u2593', + 'block;': '\u2588', + 'bne;': '=\u20e5', + 'bnequiv;': '\u2261\u20e5', + 'bNot;': '\u2aed', + 'bnot;': '\u2310', + 'Bopf;': '\U0001d539', + 'bopf;': '\U0001d553', + 'bot;': '\u22a5', + 'bottom;': '\u22a5', + 'bowtie;': '\u22c8', + 'boxbox;': '\u29c9', + 'boxDL;': '\u2557', + 'boxDl;': '\u2556', + 'boxdL;': '\u2555', + 'boxdl;': '\u2510', + 'boxDR;': '\u2554', + 'boxDr;': '\u2553', + 'boxdR;': '\u2552', + 'boxdr;': '\u250c', + 'boxH;': '\u2550', + 'boxh;': '\u2500', + 'boxHD;': '\u2566', + 'boxHd;': '\u2564', + 'boxhD;': '\u2565', + 'boxhd;': '\u252c', + 'boxHU;': '\u2569', + 'boxHu;': '\u2567', + 'boxhU;': '\u2568', + 'boxhu;': '\u2534', + 'boxminus;': '\u229f', + 'boxplus;': '\u229e', + 'boxtimes;': '\u22a0', + 'boxUL;': '\u255d', + 'boxUl;': '\u255c', + 'boxuL;': '\u255b', + 'boxul;': '\u2518', + 'boxUR;': '\u255a', + 'boxUr;': '\u2559', + 'boxuR;': '\u2558', + 'boxur;': '\u2514', + 'boxV;': '\u2551', + 'boxv;': '\u2502', + 'boxVH;': '\u256c', + 'boxVh;': '\u256b', + 'boxvH;': '\u256a', + 'boxvh;': '\u253c', + 'boxVL;': '\u2563', + 'boxVl;': '\u2562', + 'boxvL;': '\u2561', + 'boxvl;': '\u2524', + 'boxVR;': '\u2560', + 'boxVr;': '\u255f', + 'boxvR;': '\u255e', + 'boxvr;': '\u251c', + 'bprime;': '\u2035', + 'Breve;': '\u02d8', + 'breve;': '\u02d8', + 'brvbar': '\xa6', + 'brvbar;': '\xa6', + 'Bscr;': '\u212c', + 'bscr;': '\U0001d4b7', + 'bsemi;': '\u204f', + 'bsim;': '\u223d', + 'bsime;': '\u22cd', + 'bsol;': '\\', + 'bsolb;': '\u29c5', + 'bsolhsub;': '\u27c8', + 'bull;': '\u2022', + 'bullet;': '\u2022', + 'bump;': '\u224e', + 'bumpE;': '\u2aae', + 'bumpe;': '\u224f', + 'Bumpeq;': '\u224e', + 'bumpeq;': '\u224f', + 'Cacute;': '\u0106', + 'cacute;': '\u0107', + 'Cap;': '\u22d2', + 'cap;': '\u2229', + 'capand;': '\u2a44', + 'capbrcup;': '\u2a49', + 'capcap;': '\u2a4b', + 'capcup;': '\u2a47', + 'capdot;': '\u2a40', + 'CapitalDifferentialD;': '\u2145', + 'caps;': '\u2229\ufe00', + 'caret;': '\u2041', + 'caron;': '\u02c7', + 'Cayleys;': '\u212d', + 'ccaps;': '\u2a4d', + 'Ccaron;': '\u010c', + 'ccaron;': '\u010d', + 'Ccedil': '\xc7', + 'ccedil': '\xe7', + 'Ccedil;': '\xc7', + 'ccedil;': '\xe7', + 'Ccirc;': '\u0108', + 'ccirc;': '\u0109', + 'Cconint;': '\u2230', + 'ccups;': '\u2a4c', + 'ccupssm;': '\u2a50', + 'Cdot;': '\u010a', + 'cdot;': '\u010b', + 'cedil': '\xb8', + 'cedil;': '\xb8', + 'Cedilla;': '\xb8', + 'cemptyv;': '\u29b2', + 'cent': '\xa2', + 'cent;': '\xa2', + 'CenterDot;': '\xb7', + 'centerdot;': '\xb7', + 'Cfr;': '\u212d', + 'cfr;': '\U0001d520', + 'CHcy;': '\u0427', + 'chcy;': '\u0447', + 'check;': '\u2713', + 'checkmark;': '\u2713', + 'Chi;': '\u03a7', + 'chi;': '\u03c7', + 'cir;': '\u25cb', + 'circ;': '\u02c6', + 'circeq;': '\u2257', + 'circlearrowleft;': '\u21ba', + 'circlearrowright;': '\u21bb', + 'circledast;': '\u229b', + 'circledcirc;': '\u229a', + 'circleddash;': '\u229d', + 'CircleDot;': '\u2299', + 'circledR;': '\xae', + 'circledS;': '\u24c8', + 'CircleMinus;': '\u2296', + 'CirclePlus;': '\u2295', + 'CircleTimes;': '\u2297', + 'cirE;': '\u29c3', + 'cire;': '\u2257', + 'cirfnint;': '\u2a10', + 'cirmid;': '\u2aef', + 'cirscir;': '\u29c2', + 'ClockwiseContourIntegral;': '\u2232', + 'CloseCurlyDoubleQuote;': '\u201d', + 'CloseCurlyQuote;': '\u2019', + 'clubs;': '\u2663', + 'clubsuit;': '\u2663', + 'Colon;': '\u2237', + 'colon;': ':', + 'Colone;': '\u2a74', + 'colone;': '\u2254', + 'coloneq;': '\u2254', + 'comma;': ',', + 'commat;': '@', + 'comp;': '\u2201', + 'compfn;': '\u2218', + 'complement;': '\u2201', + 'complexes;': '\u2102', + 'cong;': '\u2245', + 'congdot;': '\u2a6d', + 'Congruent;': '\u2261', + 'Conint;': '\u222f', + 'conint;': '\u222e', + 'ContourIntegral;': '\u222e', + 'Copf;': '\u2102', + 'copf;': '\U0001d554', + 'coprod;': '\u2210', + 'Coproduct;': '\u2210', + 'COPY': '\xa9', + 'copy': '\xa9', + 'COPY;': '\xa9', + 'copy;': '\xa9', + 'copysr;': '\u2117', + 'CounterClockwiseContourIntegral;': '\u2233', + 'crarr;': '\u21b5', + 'Cross;': '\u2a2f', + 'cross;': '\u2717', + 'Cscr;': '\U0001d49e', + 'cscr;': '\U0001d4b8', + 'csub;': '\u2acf', + 'csube;': '\u2ad1', + 'csup;': '\u2ad0', + 'csupe;': '\u2ad2', + 'ctdot;': '\u22ef', + 'cudarrl;': '\u2938', + 'cudarrr;': '\u2935', + 'cuepr;': '\u22de', + 'cuesc;': '\u22df', + 'cularr;': '\u21b6', + 'cularrp;': '\u293d', + 'Cup;': '\u22d3', + 'cup;': '\u222a', + 'cupbrcap;': '\u2a48', + 'CupCap;': '\u224d', + 'cupcap;': '\u2a46', + 'cupcup;': '\u2a4a', + 'cupdot;': '\u228d', + 'cupor;': '\u2a45', + 'cups;': '\u222a\ufe00', + 'curarr;': '\u21b7', + 'curarrm;': '\u293c', + 'curlyeqprec;': '\u22de', + 'curlyeqsucc;': '\u22df', + 'curlyvee;': '\u22ce', + 'curlywedge;': '\u22cf', + 'curren': '\xa4', + 'curren;': '\xa4', + 'curvearrowleft;': '\u21b6', + 'curvearrowright;': '\u21b7', + 'cuvee;': '\u22ce', + 'cuwed;': '\u22cf', + 'cwconint;': '\u2232', + 'cwint;': '\u2231', + 'cylcty;': '\u232d', + 'Dagger;': '\u2021', + 'dagger;': '\u2020', + 'daleth;': '\u2138', + 'Darr;': '\u21a1', + 'dArr;': '\u21d3', + 'darr;': '\u2193', + 'dash;': '\u2010', + 'Dashv;': '\u2ae4', + 'dashv;': '\u22a3', + 'dbkarow;': '\u290f', + 'dblac;': '\u02dd', + 'Dcaron;': '\u010e', + 'dcaron;': '\u010f', + 'Dcy;': '\u0414', + 'dcy;': '\u0434', + 'DD;': '\u2145', + 'dd;': '\u2146', + 'ddagger;': '\u2021', + 'ddarr;': '\u21ca', + 'DDotrahd;': '\u2911', + 'ddotseq;': '\u2a77', + 'deg': '\xb0', + 'deg;': '\xb0', + 'Del;': '\u2207', + 'Delta;': '\u0394', + 'delta;': '\u03b4', + 'demptyv;': '\u29b1', + 'dfisht;': '\u297f', + 'Dfr;': '\U0001d507', + 'dfr;': '\U0001d521', + 'dHar;': '\u2965', + 'dharl;': '\u21c3', + 'dharr;': '\u21c2', + 'DiacriticalAcute;': '\xb4', + 'DiacriticalDot;': '\u02d9', + 'DiacriticalDoubleAcute;': '\u02dd', + 'DiacriticalGrave;': '`', + 'DiacriticalTilde;': '\u02dc', + 'diam;': '\u22c4', + 'Diamond;': '\u22c4', + 'diamond;': '\u22c4', + 'diamondsuit;': '\u2666', + 'diams;': '\u2666', + 'die;': '\xa8', + 'DifferentialD;': '\u2146', + 'digamma;': '\u03dd', + 'disin;': '\u22f2', + 'div;': '\xf7', + 'divide': '\xf7', + 'divide;': '\xf7', + 'divideontimes;': '\u22c7', + 'divonx;': '\u22c7', + 'DJcy;': '\u0402', + 'djcy;': '\u0452', + 'dlcorn;': '\u231e', + 'dlcrop;': '\u230d', + 'dollar;': '$', + 'Dopf;': '\U0001d53b', + 'dopf;': '\U0001d555', + 'Dot;': '\xa8', + 'dot;': '\u02d9', + 'DotDot;': '\u20dc', + 'doteq;': '\u2250', + 'doteqdot;': '\u2251', + 'DotEqual;': '\u2250', + 'dotminus;': '\u2238', + 'dotplus;': '\u2214', + 'dotsquare;': '\u22a1', + 'doublebarwedge;': '\u2306', + 'DoubleContourIntegral;': '\u222f', + 'DoubleDot;': '\xa8', + 'DoubleDownArrow;': '\u21d3', + 'DoubleLeftArrow;': '\u21d0', + 'DoubleLeftRightArrow;': '\u21d4', + 'DoubleLeftTee;': '\u2ae4', + 'DoubleLongLeftArrow;': '\u27f8', + 'DoubleLongLeftRightArrow;': '\u27fa', + 'DoubleLongRightArrow;': '\u27f9', + 'DoubleRightArrow;': '\u21d2', + 'DoubleRightTee;': '\u22a8', + 'DoubleUpArrow;': '\u21d1', + 'DoubleUpDownArrow;': '\u21d5', + 'DoubleVerticalBar;': '\u2225', + 'DownArrow;': '\u2193', + 'Downarrow;': '\u21d3', + 'downarrow;': '\u2193', + 'DownArrowBar;': '\u2913', + 'DownArrowUpArrow;': '\u21f5', + 'DownBreve;': '\u0311', + 'downdownarrows;': '\u21ca', + 'downharpoonleft;': '\u21c3', + 'downharpoonright;': '\u21c2', + 'DownLeftRightVector;': '\u2950', + 'DownLeftTeeVector;': '\u295e', + 'DownLeftVector;': '\u21bd', + 'DownLeftVectorBar;': '\u2956', + 'DownRightTeeVector;': '\u295f', + 'DownRightVector;': '\u21c1', + 'DownRightVectorBar;': '\u2957', + 'DownTee;': '\u22a4', + 'DownTeeArrow;': '\u21a7', + 'drbkarow;': '\u2910', + 'drcorn;': '\u231f', + 'drcrop;': '\u230c', + 'Dscr;': '\U0001d49f', + 'dscr;': '\U0001d4b9', + 'DScy;': '\u0405', + 'dscy;': '\u0455', + 'dsol;': '\u29f6', + 'Dstrok;': '\u0110', + 'dstrok;': '\u0111', + 'dtdot;': '\u22f1', + 'dtri;': '\u25bf', + 'dtrif;': '\u25be', + 'duarr;': '\u21f5', + 'duhar;': '\u296f', + 'dwangle;': '\u29a6', + 'DZcy;': '\u040f', + 'dzcy;': '\u045f', + 'dzigrarr;': '\u27ff', + 'Eacute': '\xc9', + 'eacute': '\xe9', + 'Eacute;': '\xc9', + 'eacute;': '\xe9', + 'easter;': '\u2a6e', + 'Ecaron;': '\u011a', + 'ecaron;': '\u011b', + 'ecir;': '\u2256', + 'Ecirc': '\xca', + 'ecirc': '\xea', + 'Ecirc;': '\xca', + 'ecirc;': '\xea', + 'ecolon;': '\u2255', + 'Ecy;': '\u042d', + 'ecy;': '\u044d', + 'eDDot;': '\u2a77', + 'Edot;': '\u0116', + 'eDot;': '\u2251', + 'edot;': '\u0117', + 'ee;': '\u2147', + 'efDot;': '\u2252', + 'Efr;': '\U0001d508', + 'efr;': '\U0001d522', + 'eg;': '\u2a9a', + 'Egrave': '\xc8', + 'egrave': '\xe8', + 'Egrave;': '\xc8', + 'egrave;': '\xe8', + 'egs;': '\u2a96', + 'egsdot;': '\u2a98', + 'el;': '\u2a99', + 'Element;': '\u2208', + 'elinters;': '\u23e7', + 'ell;': '\u2113', + 'els;': '\u2a95', + 'elsdot;': '\u2a97', + 'Emacr;': '\u0112', + 'emacr;': '\u0113', + 'empty;': '\u2205', + 'emptyset;': '\u2205', + 'EmptySmallSquare;': '\u25fb', + 'emptyv;': '\u2205', + 'EmptyVerySmallSquare;': '\u25ab', + 'emsp13;': '\u2004', + 'emsp14;': '\u2005', + 'emsp;': '\u2003', + 'ENG;': '\u014a', + 'eng;': '\u014b', + 'ensp;': '\u2002', + 'Eogon;': '\u0118', + 'eogon;': '\u0119', + 'Eopf;': '\U0001d53c', + 'eopf;': '\U0001d556', + 'epar;': '\u22d5', + 'eparsl;': '\u29e3', + 'eplus;': '\u2a71', + 'epsi;': '\u03b5', + 'Epsilon;': '\u0395', + 'epsilon;': '\u03b5', + 'epsiv;': '\u03f5', + 'eqcirc;': '\u2256', + 'eqcolon;': '\u2255', + 'eqsim;': '\u2242', + 'eqslantgtr;': '\u2a96', + 'eqslantless;': '\u2a95', + 'Equal;': '\u2a75', + 'equals;': '=', + 'EqualTilde;': '\u2242', + 'equest;': '\u225f', + 'Equilibrium;': '\u21cc', + 'equiv;': '\u2261', + 'equivDD;': '\u2a78', + 'eqvparsl;': '\u29e5', + 'erarr;': '\u2971', + 'erDot;': '\u2253', + 'Escr;': '\u2130', + 'escr;': '\u212f', + 'esdot;': '\u2250', + 'Esim;': '\u2a73', + 'esim;': '\u2242', + 'Eta;': '\u0397', + 'eta;': '\u03b7', + 'ETH': '\xd0', + 'eth': '\xf0', + 'ETH;': '\xd0', + 'eth;': '\xf0', + 'Euml': '\xcb', + 'euml': '\xeb', + 'Euml;': '\xcb', + 'euml;': '\xeb', + 'euro;': '\u20ac', + 'excl;': '!', + 'exist;': '\u2203', + 'Exists;': '\u2203', + 'expectation;': '\u2130', + 'ExponentialE;': '\u2147', + 'exponentiale;': '\u2147', + 'fallingdotseq;': '\u2252', + 'Fcy;': '\u0424', + 'fcy;': '\u0444', + 'female;': '\u2640', + 'ffilig;': '\ufb03', + 'fflig;': '\ufb00', + 'ffllig;': '\ufb04', + 'Ffr;': '\U0001d509', + 'ffr;': '\U0001d523', + 'filig;': '\ufb01', + 'FilledSmallSquare;': '\u25fc', + 'FilledVerySmallSquare;': '\u25aa', + 'fjlig;': 'fj', + 'flat;': '\u266d', + 'fllig;': '\ufb02', + 'fltns;': '\u25b1', + 'fnof;': '\u0192', + 'Fopf;': '\U0001d53d', + 'fopf;': '\U0001d557', + 'ForAll;': '\u2200', + 'forall;': '\u2200', + 'fork;': '\u22d4', + 'forkv;': '\u2ad9', + 'Fouriertrf;': '\u2131', + 'fpartint;': '\u2a0d', + 'frac12': '\xbd', + 'frac12;': '\xbd', + 'frac13;': '\u2153', + 'frac14': '\xbc', + 'frac14;': '\xbc', + 'frac15;': '\u2155', + 'frac16;': '\u2159', + 'frac18;': '\u215b', + 'frac23;': '\u2154', + 'frac25;': '\u2156', + 'frac34': '\xbe', + 'frac34;': '\xbe', + 'frac35;': '\u2157', + 'frac38;': '\u215c', + 'frac45;': '\u2158', + 'frac56;': '\u215a', + 'frac58;': '\u215d', + 'frac78;': '\u215e', + 'frasl;': '\u2044', + 'frown;': '\u2322', + 'Fscr;': '\u2131', + 'fscr;': '\U0001d4bb', + 'gacute;': '\u01f5', + 'Gamma;': '\u0393', + 'gamma;': '\u03b3', + 'Gammad;': '\u03dc', + 'gammad;': '\u03dd', + 'gap;': '\u2a86', + 'Gbreve;': '\u011e', + 'gbreve;': '\u011f', + 'Gcedil;': '\u0122', + 'Gcirc;': '\u011c', + 'gcirc;': '\u011d', + 'Gcy;': '\u0413', + 'gcy;': '\u0433', + 'Gdot;': '\u0120', + 'gdot;': '\u0121', + 'gE;': '\u2267', + 'ge;': '\u2265', + 'gEl;': '\u2a8c', + 'gel;': '\u22db', + 'geq;': '\u2265', + 'geqq;': '\u2267', + 'geqslant;': '\u2a7e', + 'ges;': '\u2a7e', + 'gescc;': '\u2aa9', + 'gesdot;': '\u2a80', + 'gesdoto;': '\u2a82', + 'gesdotol;': '\u2a84', + 'gesl;': '\u22db\ufe00', + 'gesles;': '\u2a94', + 'Gfr;': '\U0001d50a', + 'gfr;': '\U0001d524', + 'Gg;': '\u22d9', + 'gg;': '\u226b', + 'ggg;': '\u22d9', + 'gimel;': '\u2137', + 'GJcy;': '\u0403', + 'gjcy;': '\u0453', + 'gl;': '\u2277', + 'gla;': '\u2aa5', + 'glE;': '\u2a92', + 'glj;': '\u2aa4', + 'gnap;': '\u2a8a', + 'gnapprox;': '\u2a8a', + 'gnE;': '\u2269', + 'gne;': '\u2a88', + 'gneq;': '\u2a88', + 'gneqq;': '\u2269', + 'gnsim;': '\u22e7', + 'Gopf;': '\U0001d53e', + 'gopf;': '\U0001d558', + 'grave;': '`', + 'GreaterEqual;': '\u2265', + 'GreaterEqualLess;': '\u22db', + 'GreaterFullEqual;': '\u2267', + 'GreaterGreater;': '\u2aa2', + 'GreaterLess;': '\u2277', + 'GreaterSlantEqual;': '\u2a7e', + 'GreaterTilde;': '\u2273', + 'Gscr;': '\U0001d4a2', + 'gscr;': '\u210a', + 'gsim;': '\u2273', + 'gsime;': '\u2a8e', + 'gsiml;': '\u2a90', + 'GT': '>', + 'gt': '>', + 'GT;': '>', + 'Gt;': '\u226b', + 'gt;': '>', + 'gtcc;': '\u2aa7', + 'gtcir;': '\u2a7a', + 'gtdot;': '\u22d7', + 'gtlPar;': '\u2995', + 'gtquest;': '\u2a7c', + 'gtrapprox;': '\u2a86', + 'gtrarr;': '\u2978', + 'gtrdot;': '\u22d7', + 'gtreqless;': '\u22db', + 'gtreqqless;': '\u2a8c', + 'gtrless;': '\u2277', + 'gtrsim;': '\u2273', + 'gvertneqq;': '\u2269\ufe00', + 'gvnE;': '\u2269\ufe00', + 'Hacek;': '\u02c7', + 'hairsp;': '\u200a', + 'half;': '\xbd', + 'hamilt;': '\u210b', + 'HARDcy;': '\u042a', + 'hardcy;': '\u044a', + 'hArr;': '\u21d4', + 'harr;': '\u2194', + 'harrcir;': '\u2948', + 'harrw;': '\u21ad', + 'Hat;': '^', + 'hbar;': '\u210f', + 'Hcirc;': '\u0124', + 'hcirc;': '\u0125', + 'hearts;': '\u2665', + 'heartsuit;': '\u2665', + 'hellip;': '\u2026', + 'hercon;': '\u22b9', + 'Hfr;': '\u210c', + 'hfr;': '\U0001d525', + 'HilbertSpace;': '\u210b', + 'hksearow;': '\u2925', + 'hkswarow;': '\u2926', + 'hoarr;': '\u21ff', + 'homtht;': '\u223b', + 'hookleftarrow;': '\u21a9', + 'hookrightarrow;': '\u21aa', + 'Hopf;': '\u210d', + 'hopf;': '\U0001d559', + 'horbar;': '\u2015', + 'HorizontalLine;': '\u2500', + 'Hscr;': '\u210b', + 'hscr;': '\U0001d4bd', + 'hslash;': '\u210f', + 'Hstrok;': '\u0126', + 'hstrok;': '\u0127', + 'HumpDownHump;': '\u224e', + 'HumpEqual;': '\u224f', + 'hybull;': '\u2043', + 'hyphen;': '\u2010', + 'Iacute': '\xcd', + 'iacute': '\xed', + 'Iacute;': '\xcd', + 'iacute;': '\xed', + 'ic;': '\u2063', + 'Icirc': '\xce', + 'icirc': '\xee', + 'Icirc;': '\xce', + 'icirc;': '\xee', + 'Icy;': '\u0418', + 'icy;': '\u0438', + 'Idot;': '\u0130', + 'IEcy;': '\u0415', + 'iecy;': '\u0435', + 'iexcl': '\xa1', + 'iexcl;': '\xa1', + 'iff;': '\u21d4', + 'Ifr;': '\u2111', + 'ifr;': '\U0001d526', + 'Igrave': '\xcc', + 'igrave': '\xec', + 'Igrave;': '\xcc', + 'igrave;': '\xec', + 'ii;': '\u2148', + 'iiiint;': '\u2a0c', + 'iiint;': '\u222d', + 'iinfin;': '\u29dc', + 'iiota;': '\u2129', + 'IJlig;': '\u0132', + 'ijlig;': '\u0133', + 'Im;': '\u2111', + 'Imacr;': '\u012a', + 'imacr;': '\u012b', + 'image;': '\u2111', + 'ImaginaryI;': '\u2148', + 'imagline;': '\u2110', + 'imagpart;': '\u2111', + 'imath;': '\u0131', + 'imof;': '\u22b7', + 'imped;': '\u01b5', + 'Implies;': '\u21d2', + 'in;': '\u2208', + 'incare;': '\u2105', + 'infin;': '\u221e', + 'infintie;': '\u29dd', + 'inodot;': '\u0131', + 'Int;': '\u222c', + 'int;': '\u222b', + 'intcal;': '\u22ba', + 'integers;': '\u2124', + 'Integral;': '\u222b', + 'intercal;': '\u22ba', + 'Intersection;': '\u22c2', + 'intlarhk;': '\u2a17', + 'intprod;': '\u2a3c', + 'InvisibleComma;': '\u2063', + 'InvisibleTimes;': '\u2062', + 'IOcy;': '\u0401', + 'iocy;': '\u0451', + 'Iogon;': '\u012e', + 'iogon;': '\u012f', + 'Iopf;': '\U0001d540', + 'iopf;': '\U0001d55a', + 'Iota;': '\u0399', + 'iota;': '\u03b9', + 'iprod;': '\u2a3c', + 'iquest': '\xbf', + 'iquest;': '\xbf', + 'Iscr;': '\u2110', + 'iscr;': '\U0001d4be', + 'isin;': '\u2208', + 'isindot;': '\u22f5', + 'isinE;': '\u22f9', + 'isins;': '\u22f4', + 'isinsv;': '\u22f3', + 'isinv;': '\u2208', + 'it;': '\u2062', + 'Itilde;': '\u0128', + 'itilde;': '\u0129', + 'Iukcy;': '\u0406', + 'iukcy;': '\u0456', + 'Iuml': '\xcf', + 'iuml': '\xef', + 'Iuml;': '\xcf', + 'iuml;': '\xef', + 'Jcirc;': '\u0134', + 'jcirc;': '\u0135', + 'Jcy;': '\u0419', + 'jcy;': '\u0439', + 'Jfr;': '\U0001d50d', + 'jfr;': '\U0001d527', + 'jmath;': '\u0237', + 'Jopf;': '\U0001d541', + 'jopf;': '\U0001d55b', + 'Jscr;': '\U0001d4a5', + 'jscr;': '\U0001d4bf', + 'Jsercy;': '\u0408', + 'jsercy;': '\u0458', + 'Jukcy;': '\u0404', + 'jukcy;': '\u0454', + 'Kappa;': '\u039a', + 'kappa;': '\u03ba', + 'kappav;': '\u03f0', + 'Kcedil;': '\u0136', + 'kcedil;': '\u0137', + 'Kcy;': '\u041a', + 'kcy;': '\u043a', + 'Kfr;': '\U0001d50e', + 'kfr;': '\U0001d528', + 'kgreen;': '\u0138', + 'KHcy;': '\u0425', + 'khcy;': '\u0445', + 'KJcy;': '\u040c', + 'kjcy;': '\u045c', + 'Kopf;': '\U0001d542', + 'kopf;': '\U0001d55c', + 'Kscr;': '\U0001d4a6', + 'kscr;': '\U0001d4c0', + 'lAarr;': '\u21da', + 'Lacute;': '\u0139', + 'lacute;': '\u013a', + 'laemptyv;': '\u29b4', + 'lagran;': '\u2112', + 'Lambda;': '\u039b', + 'lambda;': '\u03bb', + 'Lang;': '\u27ea', + 'lang;': '\u27e8', + 'langd;': '\u2991', + 'langle;': '\u27e8', + 'lap;': '\u2a85', + 'Laplacetrf;': '\u2112', + 'laquo': '\xab', + 'laquo;': '\xab', + 'Larr;': '\u219e', + 'lArr;': '\u21d0', + 'larr;': '\u2190', + 'larrb;': '\u21e4', + 'larrbfs;': '\u291f', + 'larrfs;': '\u291d', + 'larrhk;': '\u21a9', + 'larrlp;': '\u21ab', + 'larrpl;': '\u2939', + 'larrsim;': '\u2973', + 'larrtl;': '\u21a2', + 'lat;': '\u2aab', + 'lAtail;': '\u291b', + 'latail;': '\u2919', + 'late;': '\u2aad', + 'lates;': '\u2aad\ufe00', + 'lBarr;': '\u290e', + 'lbarr;': '\u290c', + 'lbbrk;': '\u2772', + 'lbrace;': '{', + 'lbrack;': '[', + 'lbrke;': '\u298b', + 'lbrksld;': '\u298f', + 'lbrkslu;': '\u298d', + 'Lcaron;': '\u013d', + 'lcaron;': '\u013e', + 'Lcedil;': '\u013b', + 'lcedil;': '\u013c', + 'lceil;': '\u2308', + 'lcub;': '{', + 'Lcy;': '\u041b', + 'lcy;': '\u043b', + 'ldca;': '\u2936', + 'ldquo;': '\u201c', + 'ldquor;': '\u201e', + 'ldrdhar;': '\u2967', + 'ldrushar;': '\u294b', + 'ldsh;': '\u21b2', + 'lE;': '\u2266', + 'le;': '\u2264', + 'LeftAngleBracket;': '\u27e8', + 'LeftArrow;': '\u2190', + 'Leftarrow;': '\u21d0', + 'leftarrow;': '\u2190', + 'LeftArrowBar;': '\u21e4', + 'LeftArrowRightArrow;': '\u21c6', + 'leftarrowtail;': '\u21a2', + 'LeftCeiling;': '\u2308', + 'LeftDoubleBracket;': '\u27e6', + 'LeftDownTeeVector;': '\u2961', + 'LeftDownVector;': '\u21c3', + 'LeftDownVectorBar;': '\u2959', + 'LeftFloor;': '\u230a', + 'leftharpoondown;': '\u21bd', + 'leftharpoonup;': '\u21bc', + 'leftleftarrows;': '\u21c7', + 'LeftRightArrow;': '\u2194', + 'Leftrightarrow;': '\u21d4', + 'leftrightarrow;': '\u2194', + 'leftrightarrows;': '\u21c6', + 'leftrightharpoons;': '\u21cb', + 'leftrightsquigarrow;': '\u21ad', + 'LeftRightVector;': '\u294e', + 'LeftTee;': '\u22a3', + 'LeftTeeArrow;': '\u21a4', + 'LeftTeeVector;': '\u295a', + 'leftthreetimes;': '\u22cb', + 'LeftTriangle;': '\u22b2', + 'LeftTriangleBar;': '\u29cf', + 'LeftTriangleEqual;': '\u22b4', + 'LeftUpDownVector;': '\u2951', + 'LeftUpTeeVector;': '\u2960', + 'LeftUpVector;': '\u21bf', + 'LeftUpVectorBar;': '\u2958', + 'LeftVector;': '\u21bc', + 'LeftVectorBar;': '\u2952', + 'lEg;': '\u2a8b', + 'leg;': '\u22da', + 'leq;': '\u2264', + 'leqq;': '\u2266', + 'leqslant;': '\u2a7d', + 'les;': '\u2a7d', + 'lescc;': '\u2aa8', + 'lesdot;': '\u2a7f', + 'lesdoto;': '\u2a81', + 'lesdotor;': '\u2a83', + 'lesg;': '\u22da\ufe00', + 'lesges;': '\u2a93', + 'lessapprox;': '\u2a85', + 'lessdot;': '\u22d6', + 'lesseqgtr;': '\u22da', + 'lesseqqgtr;': '\u2a8b', + 'LessEqualGreater;': '\u22da', + 'LessFullEqual;': '\u2266', + 'LessGreater;': '\u2276', + 'lessgtr;': '\u2276', + 'LessLess;': '\u2aa1', + 'lesssim;': '\u2272', + 'LessSlantEqual;': '\u2a7d', + 'LessTilde;': '\u2272', + 'lfisht;': '\u297c', + 'lfloor;': '\u230a', + 'Lfr;': '\U0001d50f', + 'lfr;': '\U0001d529', + 'lg;': '\u2276', + 'lgE;': '\u2a91', + 'lHar;': '\u2962', + 'lhard;': '\u21bd', + 'lharu;': '\u21bc', + 'lharul;': '\u296a', + 'lhblk;': '\u2584', + 'LJcy;': '\u0409', + 'ljcy;': '\u0459', + 'Ll;': '\u22d8', + 'll;': '\u226a', + 'llarr;': '\u21c7', + 'llcorner;': '\u231e', + 'Lleftarrow;': '\u21da', + 'llhard;': '\u296b', + 'lltri;': '\u25fa', + 'Lmidot;': '\u013f', + 'lmidot;': '\u0140', + 'lmoust;': '\u23b0', + 'lmoustache;': '\u23b0', + 'lnap;': '\u2a89', + 'lnapprox;': '\u2a89', + 'lnE;': '\u2268', + 'lne;': '\u2a87', + 'lneq;': '\u2a87', + 'lneqq;': '\u2268', + 'lnsim;': '\u22e6', + 'loang;': '\u27ec', + 'loarr;': '\u21fd', + 'lobrk;': '\u27e6', + 'LongLeftArrow;': '\u27f5', + 'Longleftarrow;': '\u27f8', + 'longleftarrow;': '\u27f5', + 'LongLeftRightArrow;': '\u27f7', + 'Longleftrightarrow;': '\u27fa', + 'longleftrightarrow;': '\u27f7', + 'longmapsto;': '\u27fc', + 'LongRightArrow;': '\u27f6', + 'Longrightarrow;': '\u27f9', + 'longrightarrow;': '\u27f6', + 'looparrowleft;': '\u21ab', + 'looparrowright;': '\u21ac', + 'lopar;': '\u2985', + 'Lopf;': '\U0001d543', + 'lopf;': '\U0001d55d', + 'loplus;': '\u2a2d', + 'lotimes;': '\u2a34', + 'lowast;': '\u2217', + 'lowbar;': '_', + 'LowerLeftArrow;': '\u2199', + 'LowerRightArrow;': '\u2198', + 'loz;': '\u25ca', + 'lozenge;': '\u25ca', + 'lozf;': '\u29eb', + 'lpar;': '(', + 'lparlt;': '\u2993', + 'lrarr;': '\u21c6', + 'lrcorner;': '\u231f', + 'lrhar;': '\u21cb', + 'lrhard;': '\u296d', + 'lrm;': '\u200e', + 'lrtri;': '\u22bf', + 'lsaquo;': '\u2039', + 'Lscr;': '\u2112', + 'lscr;': '\U0001d4c1', + 'Lsh;': '\u21b0', + 'lsh;': '\u21b0', + 'lsim;': '\u2272', + 'lsime;': '\u2a8d', + 'lsimg;': '\u2a8f', + 'lsqb;': '[', + 'lsquo;': '\u2018', + 'lsquor;': '\u201a', + 'Lstrok;': '\u0141', + 'lstrok;': '\u0142', + 'LT': '<', + 'lt': '<', + 'LT;': '<', + 'Lt;': '\u226a', + 'lt;': '<', + 'ltcc;': '\u2aa6', + 'ltcir;': '\u2a79', + 'ltdot;': '\u22d6', + 'lthree;': '\u22cb', + 'ltimes;': '\u22c9', + 'ltlarr;': '\u2976', + 'ltquest;': '\u2a7b', + 'ltri;': '\u25c3', + 'ltrie;': '\u22b4', + 'ltrif;': '\u25c2', + 'ltrPar;': '\u2996', + 'lurdshar;': '\u294a', + 'luruhar;': '\u2966', + 'lvertneqq;': '\u2268\ufe00', + 'lvnE;': '\u2268\ufe00', + 'macr': '\xaf', + 'macr;': '\xaf', + 'male;': '\u2642', + 'malt;': '\u2720', + 'maltese;': '\u2720', + 'Map;': '\u2905', + 'map;': '\u21a6', + 'mapsto;': '\u21a6', + 'mapstodown;': '\u21a7', + 'mapstoleft;': '\u21a4', + 'mapstoup;': '\u21a5', + 'marker;': '\u25ae', + 'mcomma;': '\u2a29', + 'Mcy;': '\u041c', + 'mcy;': '\u043c', + 'mdash;': '\u2014', + 'mDDot;': '\u223a', + 'measuredangle;': '\u2221', + 'MediumSpace;': '\u205f', + 'Mellintrf;': '\u2133', + 'Mfr;': '\U0001d510', + 'mfr;': '\U0001d52a', + 'mho;': '\u2127', + 'micro': '\xb5', + 'micro;': '\xb5', + 'mid;': '\u2223', + 'midast;': '*', + 'midcir;': '\u2af0', + 'middot': '\xb7', + 'middot;': '\xb7', + 'minus;': '\u2212', + 'minusb;': '\u229f', + 'minusd;': '\u2238', + 'minusdu;': '\u2a2a', + 'MinusPlus;': '\u2213', + 'mlcp;': '\u2adb', + 'mldr;': '\u2026', + 'mnplus;': '\u2213', + 'models;': '\u22a7', + 'Mopf;': '\U0001d544', + 'mopf;': '\U0001d55e', + 'mp;': '\u2213', + 'Mscr;': '\u2133', + 'mscr;': '\U0001d4c2', + 'mstpos;': '\u223e', + 'Mu;': '\u039c', + 'mu;': '\u03bc', + 'multimap;': '\u22b8', + 'mumap;': '\u22b8', + 'nabla;': '\u2207', + 'Nacute;': '\u0143', + 'nacute;': '\u0144', + 'nang;': '\u2220\u20d2', + 'nap;': '\u2249', + 'napE;': '\u2a70\u0338', + 'napid;': '\u224b\u0338', + 'napos;': '\u0149', + 'napprox;': '\u2249', + 'natur;': '\u266e', + 'natural;': '\u266e', + 'naturals;': '\u2115', + 'nbsp': '\xa0', + 'nbsp;': '\xa0', + 'nbump;': '\u224e\u0338', + 'nbumpe;': '\u224f\u0338', + 'ncap;': '\u2a43', + 'Ncaron;': '\u0147', + 'ncaron;': '\u0148', + 'Ncedil;': '\u0145', + 'ncedil;': '\u0146', + 'ncong;': '\u2247', + 'ncongdot;': '\u2a6d\u0338', + 'ncup;': '\u2a42', + 'Ncy;': '\u041d', + 'ncy;': '\u043d', + 'ndash;': '\u2013', + 'ne;': '\u2260', + 'nearhk;': '\u2924', + 'neArr;': '\u21d7', + 'nearr;': '\u2197', + 'nearrow;': '\u2197', + 'nedot;': '\u2250\u0338', + 'NegativeMediumSpace;': '\u200b', + 'NegativeThickSpace;': '\u200b', + 'NegativeThinSpace;': '\u200b', + 'NegativeVeryThinSpace;': '\u200b', + 'nequiv;': '\u2262', + 'nesear;': '\u2928', + 'nesim;': '\u2242\u0338', + 'NestedGreaterGreater;': '\u226b', + 'NestedLessLess;': '\u226a', + 'NewLine;': '\n', + 'nexist;': '\u2204', + 'nexists;': '\u2204', + 'Nfr;': '\U0001d511', + 'nfr;': '\U0001d52b', + 'ngE;': '\u2267\u0338', + 'nge;': '\u2271', + 'ngeq;': '\u2271', + 'ngeqq;': '\u2267\u0338', + 'ngeqslant;': '\u2a7e\u0338', + 'nges;': '\u2a7e\u0338', + 'nGg;': '\u22d9\u0338', + 'ngsim;': '\u2275', + 'nGt;': '\u226b\u20d2', + 'ngt;': '\u226f', + 'ngtr;': '\u226f', + 'nGtv;': '\u226b\u0338', + 'nhArr;': '\u21ce', + 'nharr;': '\u21ae', + 'nhpar;': '\u2af2', + 'ni;': '\u220b', + 'nis;': '\u22fc', + 'nisd;': '\u22fa', + 'niv;': '\u220b', + 'NJcy;': '\u040a', + 'njcy;': '\u045a', + 'nlArr;': '\u21cd', + 'nlarr;': '\u219a', + 'nldr;': '\u2025', + 'nlE;': '\u2266\u0338', + 'nle;': '\u2270', + 'nLeftarrow;': '\u21cd', + 'nleftarrow;': '\u219a', + 'nLeftrightarrow;': '\u21ce', + 'nleftrightarrow;': '\u21ae', + 'nleq;': '\u2270', + 'nleqq;': '\u2266\u0338', + 'nleqslant;': '\u2a7d\u0338', + 'nles;': '\u2a7d\u0338', + 'nless;': '\u226e', + 'nLl;': '\u22d8\u0338', + 'nlsim;': '\u2274', + 'nLt;': '\u226a\u20d2', + 'nlt;': '\u226e', + 'nltri;': '\u22ea', + 'nltrie;': '\u22ec', + 'nLtv;': '\u226a\u0338', + 'nmid;': '\u2224', + 'NoBreak;': '\u2060', + 'NonBreakingSpace;': '\xa0', + 'Nopf;': '\u2115', + 'nopf;': '\U0001d55f', + 'not': '\xac', + 'Not;': '\u2aec', + 'not;': '\xac', + 'NotCongruent;': '\u2262', + 'NotCupCap;': '\u226d', + 'NotDoubleVerticalBar;': '\u2226', + 'NotElement;': '\u2209', + 'NotEqual;': '\u2260', + 'NotEqualTilde;': '\u2242\u0338', + 'NotExists;': '\u2204', + 'NotGreater;': '\u226f', + 'NotGreaterEqual;': '\u2271', + 'NotGreaterFullEqual;': '\u2267\u0338', + 'NotGreaterGreater;': '\u226b\u0338', + 'NotGreaterLess;': '\u2279', + 'NotGreaterSlantEqual;': '\u2a7e\u0338', + 'NotGreaterTilde;': '\u2275', + 'NotHumpDownHump;': '\u224e\u0338', + 'NotHumpEqual;': '\u224f\u0338', + 'notin;': '\u2209', + 'notindot;': '\u22f5\u0338', + 'notinE;': '\u22f9\u0338', + 'notinva;': '\u2209', + 'notinvb;': '\u22f7', + 'notinvc;': '\u22f6', + 'NotLeftTriangle;': '\u22ea', + 'NotLeftTriangleBar;': '\u29cf\u0338', + 'NotLeftTriangleEqual;': '\u22ec', + 'NotLess;': '\u226e', + 'NotLessEqual;': '\u2270', + 'NotLessGreater;': '\u2278', + 'NotLessLess;': '\u226a\u0338', + 'NotLessSlantEqual;': '\u2a7d\u0338', + 'NotLessTilde;': '\u2274', + 'NotNestedGreaterGreater;': '\u2aa2\u0338', + 'NotNestedLessLess;': '\u2aa1\u0338', + 'notni;': '\u220c', + 'notniva;': '\u220c', + 'notnivb;': '\u22fe', + 'notnivc;': '\u22fd', + 'NotPrecedes;': '\u2280', + 'NotPrecedesEqual;': '\u2aaf\u0338', + 'NotPrecedesSlantEqual;': '\u22e0', + 'NotReverseElement;': '\u220c', + 'NotRightTriangle;': '\u22eb', + 'NotRightTriangleBar;': '\u29d0\u0338', + 'NotRightTriangleEqual;': '\u22ed', + 'NotSquareSubset;': '\u228f\u0338', + 'NotSquareSubsetEqual;': '\u22e2', + 'NotSquareSuperset;': '\u2290\u0338', + 'NotSquareSupersetEqual;': '\u22e3', + 'NotSubset;': '\u2282\u20d2', + 'NotSubsetEqual;': '\u2288', + 'NotSucceeds;': '\u2281', + 'NotSucceedsEqual;': '\u2ab0\u0338', + 'NotSucceedsSlantEqual;': '\u22e1', + 'NotSucceedsTilde;': '\u227f\u0338', + 'NotSuperset;': '\u2283\u20d2', + 'NotSupersetEqual;': '\u2289', + 'NotTilde;': '\u2241', + 'NotTildeEqual;': '\u2244', + 'NotTildeFullEqual;': '\u2247', + 'NotTildeTilde;': '\u2249', + 'NotVerticalBar;': '\u2224', + 'npar;': '\u2226', + 'nparallel;': '\u2226', + 'nparsl;': '\u2afd\u20e5', + 'npart;': '\u2202\u0338', + 'npolint;': '\u2a14', + 'npr;': '\u2280', + 'nprcue;': '\u22e0', + 'npre;': '\u2aaf\u0338', + 'nprec;': '\u2280', + 'npreceq;': '\u2aaf\u0338', + 'nrArr;': '\u21cf', + 'nrarr;': '\u219b', + 'nrarrc;': '\u2933\u0338', + 'nrarrw;': '\u219d\u0338', + 'nRightarrow;': '\u21cf', + 'nrightarrow;': '\u219b', + 'nrtri;': '\u22eb', + 'nrtrie;': '\u22ed', + 'nsc;': '\u2281', + 'nsccue;': '\u22e1', + 'nsce;': '\u2ab0\u0338', + 'Nscr;': '\U0001d4a9', + 'nscr;': '\U0001d4c3', + 'nshortmid;': '\u2224', + 'nshortparallel;': '\u2226', + 'nsim;': '\u2241', + 'nsime;': '\u2244', + 'nsimeq;': '\u2244', + 'nsmid;': '\u2224', + 'nspar;': '\u2226', + 'nsqsube;': '\u22e2', + 'nsqsupe;': '\u22e3', + 'nsub;': '\u2284', + 'nsubE;': '\u2ac5\u0338', + 'nsube;': '\u2288', + 'nsubset;': '\u2282\u20d2', + 'nsubseteq;': '\u2288', + 'nsubseteqq;': '\u2ac5\u0338', + 'nsucc;': '\u2281', + 'nsucceq;': '\u2ab0\u0338', + 'nsup;': '\u2285', + 'nsupE;': '\u2ac6\u0338', + 'nsupe;': '\u2289', + 'nsupset;': '\u2283\u20d2', + 'nsupseteq;': '\u2289', + 'nsupseteqq;': '\u2ac6\u0338', + 'ntgl;': '\u2279', + 'Ntilde': '\xd1', + 'ntilde': '\xf1', + 'Ntilde;': '\xd1', + 'ntilde;': '\xf1', + 'ntlg;': '\u2278', + 'ntriangleleft;': '\u22ea', + 'ntrianglelefteq;': '\u22ec', + 'ntriangleright;': '\u22eb', + 'ntrianglerighteq;': '\u22ed', + 'Nu;': '\u039d', + 'nu;': '\u03bd', + 'num;': '#', + 'numero;': '\u2116', + 'numsp;': '\u2007', + 'nvap;': '\u224d\u20d2', + 'nVDash;': '\u22af', + 'nVdash;': '\u22ae', + 'nvDash;': '\u22ad', + 'nvdash;': '\u22ac', + 'nvge;': '\u2265\u20d2', + 'nvgt;': '>\u20d2', + 'nvHarr;': '\u2904', + 'nvinfin;': '\u29de', + 'nvlArr;': '\u2902', + 'nvle;': '\u2264\u20d2', + 'nvlt;': '<\u20d2', + 'nvltrie;': '\u22b4\u20d2', + 'nvrArr;': '\u2903', + 'nvrtrie;': '\u22b5\u20d2', + 'nvsim;': '\u223c\u20d2', + 'nwarhk;': '\u2923', + 'nwArr;': '\u21d6', + 'nwarr;': '\u2196', + 'nwarrow;': '\u2196', + 'nwnear;': '\u2927', + 'Oacute': '\xd3', + 'oacute': '\xf3', + 'Oacute;': '\xd3', + 'oacute;': '\xf3', + 'oast;': '\u229b', + 'ocir;': '\u229a', + 'Ocirc': '\xd4', + 'ocirc': '\xf4', + 'Ocirc;': '\xd4', + 'ocirc;': '\xf4', + 'Ocy;': '\u041e', + 'ocy;': '\u043e', + 'odash;': '\u229d', + 'Odblac;': '\u0150', + 'odblac;': '\u0151', + 'odiv;': '\u2a38', + 'odot;': '\u2299', + 'odsold;': '\u29bc', + 'OElig;': '\u0152', + 'oelig;': '\u0153', + 'ofcir;': '\u29bf', + 'Ofr;': '\U0001d512', + 'ofr;': '\U0001d52c', + 'ogon;': '\u02db', + 'Ograve': '\xd2', + 'ograve': '\xf2', + 'Ograve;': '\xd2', + 'ograve;': '\xf2', + 'ogt;': '\u29c1', + 'ohbar;': '\u29b5', + 'ohm;': '\u03a9', + 'oint;': '\u222e', + 'olarr;': '\u21ba', + 'olcir;': '\u29be', + 'olcross;': '\u29bb', + 'oline;': '\u203e', + 'olt;': '\u29c0', + 'Omacr;': '\u014c', + 'omacr;': '\u014d', + 'Omega;': '\u03a9', + 'omega;': '\u03c9', + 'Omicron;': '\u039f', + 'omicron;': '\u03bf', + 'omid;': '\u29b6', + 'ominus;': '\u2296', + 'Oopf;': '\U0001d546', + 'oopf;': '\U0001d560', + 'opar;': '\u29b7', + 'OpenCurlyDoubleQuote;': '\u201c', + 'OpenCurlyQuote;': '\u2018', + 'operp;': '\u29b9', + 'oplus;': '\u2295', + 'Or;': '\u2a54', + 'or;': '\u2228', + 'orarr;': '\u21bb', + 'ord;': '\u2a5d', + 'order;': '\u2134', + 'orderof;': '\u2134', + 'ordf': '\xaa', + 'ordf;': '\xaa', + 'ordm': '\xba', + 'ordm;': '\xba', + 'origof;': '\u22b6', + 'oror;': '\u2a56', + 'orslope;': '\u2a57', + 'orv;': '\u2a5b', + 'oS;': '\u24c8', + 'Oscr;': '\U0001d4aa', + 'oscr;': '\u2134', + 'Oslash': '\xd8', + 'oslash': '\xf8', + 'Oslash;': '\xd8', + 'oslash;': '\xf8', + 'osol;': '\u2298', + 'Otilde': '\xd5', + 'otilde': '\xf5', + 'Otilde;': '\xd5', + 'otilde;': '\xf5', + 'Otimes;': '\u2a37', + 'otimes;': '\u2297', + 'otimesas;': '\u2a36', + 'Ouml': '\xd6', + 'ouml': '\xf6', + 'Ouml;': '\xd6', + 'ouml;': '\xf6', + 'ovbar;': '\u233d', + 'OverBar;': '\u203e', + 'OverBrace;': '\u23de', + 'OverBracket;': '\u23b4', + 'OverParenthesis;': '\u23dc', + 'par;': '\u2225', + 'para': '\xb6', + 'para;': '\xb6', + 'parallel;': '\u2225', + 'parsim;': '\u2af3', + 'parsl;': '\u2afd', + 'part;': '\u2202', + 'PartialD;': '\u2202', + 'Pcy;': '\u041f', + 'pcy;': '\u043f', + 'percnt;': '%', + 'period;': '.', + 'permil;': '\u2030', + 'perp;': '\u22a5', + 'pertenk;': '\u2031', + 'Pfr;': '\U0001d513', + 'pfr;': '\U0001d52d', + 'Phi;': '\u03a6', + 'phi;': '\u03c6', + 'phiv;': '\u03d5', + 'phmmat;': '\u2133', + 'phone;': '\u260e', + 'Pi;': '\u03a0', + 'pi;': '\u03c0', + 'pitchfork;': '\u22d4', + 'piv;': '\u03d6', + 'planck;': '\u210f', + 'planckh;': '\u210e', + 'plankv;': '\u210f', + 'plus;': '+', + 'plusacir;': '\u2a23', + 'plusb;': '\u229e', + 'pluscir;': '\u2a22', + 'plusdo;': '\u2214', + 'plusdu;': '\u2a25', + 'pluse;': '\u2a72', + 'PlusMinus;': '\xb1', + 'plusmn': '\xb1', + 'plusmn;': '\xb1', + 'plussim;': '\u2a26', + 'plustwo;': '\u2a27', + 'pm;': '\xb1', + 'Poincareplane;': '\u210c', + 'pointint;': '\u2a15', + 'Popf;': '\u2119', + 'popf;': '\U0001d561', + 'pound': '\xa3', + 'pound;': '\xa3', + 'Pr;': '\u2abb', + 'pr;': '\u227a', + 'prap;': '\u2ab7', + 'prcue;': '\u227c', + 'prE;': '\u2ab3', + 'pre;': '\u2aaf', + 'prec;': '\u227a', + 'precapprox;': '\u2ab7', + 'preccurlyeq;': '\u227c', + 'Precedes;': '\u227a', + 'PrecedesEqual;': '\u2aaf', + 'PrecedesSlantEqual;': '\u227c', + 'PrecedesTilde;': '\u227e', + 'preceq;': '\u2aaf', + 'precnapprox;': '\u2ab9', + 'precneqq;': '\u2ab5', + 'precnsim;': '\u22e8', + 'precsim;': '\u227e', + 'Prime;': '\u2033', + 'prime;': '\u2032', + 'primes;': '\u2119', + 'prnap;': '\u2ab9', + 'prnE;': '\u2ab5', + 'prnsim;': '\u22e8', + 'prod;': '\u220f', + 'Product;': '\u220f', + 'profalar;': '\u232e', + 'profline;': '\u2312', + 'profsurf;': '\u2313', + 'prop;': '\u221d', + 'Proportion;': '\u2237', + 'Proportional;': '\u221d', + 'propto;': '\u221d', + 'prsim;': '\u227e', + 'prurel;': '\u22b0', + 'Pscr;': '\U0001d4ab', + 'pscr;': '\U0001d4c5', + 'Psi;': '\u03a8', + 'psi;': '\u03c8', + 'puncsp;': '\u2008', + 'Qfr;': '\U0001d514', + 'qfr;': '\U0001d52e', + 'qint;': '\u2a0c', + 'Qopf;': '\u211a', + 'qopf;': '\U0001d562', + 'qprime;': '\u2057', + 'Qscr;': '\U0001d4ac', + 'qscr;': '\U0001d4c6', + 'quaternions;': '\u210d', + 'quatint;': '\u2a16', + 'quest;': '?', + 'questeq;': '\u225f', + 'QUOT': '"', + 'quot': '"', + 'QUOT;': '"', + 'quot;': '"', + 'rAarr;': '\u21db', + 'race;': '\u223d\u0331', + 'Racute;': '\u0154', + 'racute;': '\u0155', + 'radic;': '\u221a', + 'raemptyv;': '\u29b3', + 'Rang;': '\u27eb', + 'rang;': '\u27e9', + 'rangd;': '\u2992', + 'range;': '\u29a5', + 'rangle;': '\u27e9', + 'raquo': '\xbb', + 'raquo;': '\xbb', + 'Rarr;': '\u21a0', + 'rArr;': '\u21d2', + 'rarr;': '\u2192', + 'rarrap;': '\u2975', + 'rarrb;': '\u21e5', + 'rarrbfs;': '\u2920', + 'rarrc;': '\u2933', + 'rarrfs;': '\u291e', + 'rarrhk;': '\u21aa', + 'rarrlp;': '\u21ac', + 'rarrpl;': '\u2945', + 'rarrsim;': '\u2974', + 'Rarrtl;': '\u2916', + 'rarrtl;': '\u21a3', + 'rarrw;': '\u219d', + 'rAtail;': '\u291c', + 'ratail;': '\u291a', + 'ratio;': '\u2236', + 'rationals;': '\u211a', + 'RBarr;': '\u2910', + 'rBarr;': '\u290f', + 'rbarr;': '\u290d', + 'rbbrk;': '\u2773', + 'rbrace;': '}', + 'rbrack;': ']', + 'rbrke;': '\u298c', + 'rbrksld;': '\u298e', + 'rbrkslu;': '\u2990', + 'Rcaron;': '\u0158', + 'rcaron;': '\u0159', + 'Rcedil;': '\u0156', + 'rcedil;': '\u0157', + 'rceil;': '\u2309', + 'rcub;': '}', + 'Rcy;': '\u0420', + 'rcy;': '\u0440', + 'rdca;': '\u2937', + 'rdldhar;': '\u2969', + 'rdquo;': '\u201d', + 'rdquor;': '\u201d', + 'rdsh;': '\u21b3', + 'Re;': '\u211c', + 'real;': '\u211c', + 'realine;': '\u211b', + 'realpart;': '\u211c', + 'reals;': '\u211d', + 'rect;': '\u25ad', + 'REG': '\xae', + 'reg': '\xae', + 'REG;': '\xae', + 'reg;': '\xae', + 'ReverseElement;': '\u220b', + 'ReverseEquilibrium;': '\u21cb', + 'ReverseUpEquilibrium;': '\u296f', + 'rfisht;': '\u297d', + 'rfloor;': '\u230b', + 'Rfr;': '\u211c', + 'rfr;': '\U0001d52f', + 'rHar;': '\u2964', + 'rhard;': '\u21c1', + 'rharu;': '\u21c0', + 'rharul;': '\u296c', + 'Rho;': '\u03a1', + 'rho;': '\u03c1', + 'rhov;': '\u03f1', + 'RightAngleBracket;': '\u27e9', + 'RightArrow;': '\u2192', + 'Rightarrow;': '\u21d2', + 'rightarrow;': '\u2192', + 'RightArrowBar;': '\u21e5', + 'RightArrowLeftArrow;': '\u21c4', + 'rightarrowtail;': '\u21a3', + 'RightCeiling;': '\u2309', + 'RightDoubleBracket;': '\u27e7', + 'RightDownTeeVector;': '\u295d', + 'RightDownVector;': '\u21c2', + 'RightDownVectorBar;': '\u2955', + 'RightFloor;': '\u230b', + 'rightharpoondown;': '\u21c1', + 'rightharpoonup;': '\u21c0', + 'rightleftarrows;': '\u21c4', + 'rightleftharpoons;': '\u21cc', + 'rightrightarrows;': '\u21c9', + 'rightsquigarrow;': '\u219d', + 'RightTee;': '\u22a2', + 'RightTeeArrow;': '\u21a6', + 'RightTeeVector;': '\u295b', + 'rightthreetimes;': '\u22cc', + 'RightTriangle;': '\u22b3', + 'RightTriangleBar;': '\u29d0', + 'RightTriangleEqual;': '\u22b5', + 'RightUpDownVector;': '\u294f', + 'RightUpTeeVector;': '\u295c', + 'RightUpVector;': '\u21be', + 'RightUpVectorBar;': '\u2954', + 'RightVector;': '\u21c0', + 'RightVectorBar;': '\u2953', + 'ring;': '\u02da', + 'risingdotseq;': '\u2253', + 'rlarr;': '\u21c4', + 'rlhar;': '\u21cc', + 'rlm;': '\u200f', + 'rmoust;': '\u23b1', + 'rmoustache;': '\u23b1', + 'rnmid;': '\u2aee', + 'roang;': '\u27ed', + 'roarr;': '\u21fe', + 'robrk;': '\u27e7', + 'ropar;': '\u2986', + 'Ropf;': '\u211d', + 'ropf;': '\U0001d563', + 'roplus;': '\u2a2e', + 'rotimes;': '\u2a35', + 'RoundImplies;': '\u2970', + 'rpar;': ')', + 'rpargt;': '\u2994', + 'rppolint;': '\u2a12', + 'rrarr;': '\u21c9', + 'Rrightarrow;': '\u21db', + 'rsaquo;': '\u203a', + 'Rscr;': '\u211b', + 'rscr;': '\U0001d4c7', + 'Rsh;': '\u21b1', + 'rsh;': '\u21b1', + 'rsqb;': ']', + 'rsquo;': '\u2019', + 'rsquor;': '\u2019', + 'rthree;': '\u22cc', + 'rtimes;': '\u22ca', + 'rtri;': '\u25b9', + 'rtrie;': '\u22b5', + 'rtrif;': '\u25b8', + 'rtriltri;': '\u29ce', + 'RuleDelayed;': '\u29f4', + 'ruluhar;': '\u2968', + 'rx;': '\u211e', + 'Sacute;': '\u015a', + 'sacute;': '\u015b', + 'sbquo;': '\u201a', + 'Sc;': '\u2abc', + 'sc;': '\u227b', + 'scap;': '\u2ab8', + 'Scaron;': '\u0160', + 'scaron;': '\u0161', + 'sccue;': '\u227d', + 'scE;': '\u2ab4', + 'sce;': '\u2ab0', + 'Scedil;': '\u015e', + 'scedil;': '\u015f', + 'Scirc;': '\u015c', + 'scirc;': '\u015d', + 'scnap;': '\u2aba', + 'scnE;': '\u2ab6', + 'scnsim;': '\u22e9', + 'scpolint;': '\u2a13', + 'scsim;': '\u227f', + 'Scy;': '\u0421', + 'scy;': '\u0441', + 'sdot;': '\u22c5', + 'sdotb;': '\u22a1', + 'sdote;': '\u2a66', + 'searhk;': '\u2925', + 'seArr;': '\u21d8', + 'searr;': '\u2198', + 'searrow;': '\u2198', + 'sect': '\xa7', + 'sect;': '\xa7', + 'semi;': ';', + 'seswar;': '\u2929', + 'setminus;': '\u2216', + 'setmn;': '\u2216', + 'sext;': '\u2736', + 'Sfr;': '\U0001d516', + 'sfr;': '\U0001d530', + 'sfrown;': '\u2322', + 'sharp;': '\u266f', + 'SHCHcy;': '\u0429', + 'shchcy;': '\u0449', + 'SHcy;': '\u0428', + 'shcy;': '\u0448', + 'ShortDownArrow;': '\u2193', + 'ShortLeftArrow;': '\u2190', + 'shortmid;': '\u2223', + 'shortparallel;': '\u2225', + 'ShortRightArrow;': '\u2192', + 'ShortUpArrow;': '\u2191', + 'shy': '\xad', + 'shy;': '\xad', + 'Sigma;': '\u03a3', + 'sigma;': '\u03c3', + 'sigmaf;': '\u03c2', + 'sigmav;': '\u03c2', + 'sim;': '\u223c', + 'simdot;': '\u2a6a', + 'sime;': '\u2243', + 'simeq;': '\u2243', + 'simg;': '\u2a9e', + 'simgE;': '\u2aa0', + 'siml;': '\u2a9d', + 'simlE;': '\u2a9f', + 'simne;': '\u2246', + 'simplus;': '\u2a24', + 'simrarr;': '\u2972', + 'slarr;': '\u2190', + 'SmallCircle;': '\u2218', + 'smallsetminus;': '\u2216', + 'smashp;': '\u2a33', + 'smeparsl;': '\u29e4', + 'smid;': '\u2223', + 'smile;': '\u2323', + 'smt;': '\u2aaa', + 'smte;': '\u2aac', + 'smtes;': '\u2aac\ufe00', + 'SOFTcy;': '\u042c', + 'softcy;': '\u044c', + 'sol;': '/', + 'solb;': '\u29c4', + 'solbar;': '\u233f', + 'Sopf;': '\U0001d54a', + 'sopf;': '\U0001d564', + 'spades;': '\u2660', + 'spadesuit;': '\u2660', + 'spar;': '\u2225', + 'sqcap;': '\u2293', + 'sqcaps;': '\u2293\ufe00', + 'sqcup;': '\u2294', + 'sqcups;': '\u2294\ufe00', + 'Sqrt;': '\u221a', + 'sqsub;': '\u228f', + 'sqsube;': '\u2291', + 'sqsubset;': '\u228f', + 'sqsubseteq;': '\u2291', + 'sqsup;': '\u2290', + 'sqsupe;': '\u2292', + 'sqsupset;': '\u2290', + 'sqsupseteq;': '\u2292', + 'squ;': '\u25a1', + 'Square;': '\u25a1', + 'square;': '\u25a1', + 'SquareIntersection;': '\u2293', + 'SquareSubset;': '\u228f', + 'SquareSubsetEqual;': '\u2291', + 'SquareSuperset;': '\u2290', + 'SquareSupersetEqual;': '\u2292', + 'SquareUnion;': '\u2294', + 'squarf;': '\u25aa', + 'squf;': '\u25aa', + 'srarr;': '\u2192', + 'Sscr;': '\U0001d4ae', + 'sscr;': '\U0001d4c8', + 'ssetmn;': '\u2216', + 'ssmile;': '\u2323', + 'sstarf;': '\u22c6', + 'Star;': '\u22c6', + 'star;': '\u2606', + 'starf;': '\u2605', + 'straightepsilon;': '\u03f5', + 'straightphi;': '\u03d5', + 'strns;': '\xaf', + 'Sub;': '\u22d0', + 'sub;': '\u2282', + 'subdot;': '\u2abd', + 'subE;': '\u2ac5', + 'sube;': '\u2286', + 'subedot;': '\u2ac3', + 'submult;': '\u2ac1', + 'subnE;': '\u2acb', + 'subne;': '\u228a', + 'subplus;': '\u2abf', + 'subrarr;': '\u2979', + 'Subset;': '\u22d0', + 'subset;': '\u2282', + 'subseteq;': '\u2286', + 'subseteqq;': '\u2ac5', + 'SubsetEqual;': '\u2286', + 'subsetneq;': '\u228a', + 'subsetneqq;': '\u2acb', + 'subsim;': '\u2ac7', + 'subsub;': '\u2ad5', + 'subsup;': '\u2ad3', + 'succ;': '\u227b', + 'succapprox;': '\u2ab8', + 'succcurlyeq;': '\u227d', + 'Succeeds;': '\u227b', + 'SucceedsEqual;': '\u2ab0', + 'SucceedsSlantEqual;': '\u227d', + 'SucceedsTilde;': '\u227f', + 'succeq;': '\u2ab0', + 'succnapprox;': '\u2aba', + 'succneqq;': '\u2ab6', + 'succnsim;': '\u22e9', + 'succsim;': '\u227f', + 'SuchThat;': '\u220b', + 'Sum;': '\u2211', + 'sum;': '\u2211', + 'sung;': '\u266a', + 'sup1': '\xb9', + 'sup1;': '\xb9', + 'sup2': '\xb2', + 'sup2;': '\xb2', + 'sup3': '\xb3', + 'sup3;': '\xb3', + 'Sup;': '\u22d1', + 'sup;': '\u2283', + 'supdot;': '\u2abe', + 'supdsub;': '\u2ad8', + 'supE;': '\u2ac6', + 'supe;': '\u2287', + 'supedot;': '\u2ac4', + 'Superset;': '\u2283', + 'SupersetEqual;': '\u2287', + 'suphsol;': '\u27c9', + 'suphsub;': '\u2ad7', + 'suplarr;': '\u297b', + 'supmult;': '\u2ac2', + 'supnE;': '\u2acc', + 'supne;': '\u228b', + 'supplus;': '\u2ac0', + 'Supset;': '\u22d1', + 'supset;': '\u2283', + 'supseteq;': '\u2287', + 'supseteqq;': '\u2ac6', + 'supsetneq;': '\u228b', + 'supsetneqq;': '\u2acc', + 'supsim;': '\u2ac8', + 'supsub;': '\u2ad4', + 'supsup;': '\u2ad6', + 'swarhk;': '\u2926', + 'swArr;': '\u21d9', + 'swarr;': '\u2199', + 'swarrow;': '\u2199', + 'swnwar;': '\u292a', + 'szlig': '\xdf', + 'szlig;': '\xdf', + 'Tab;': '\t', + 'target;': '\u2316', + 'Tau;': '\u03a4', + 'tau;': '\u03c4', + 'tbrk;': '\u23b4', + 'Tcaron;': '\u0164', + 'tcaron;': '\u0165', + 'Tcedil;': '\u0162', + 'tcedil;': '\u0163', + 'Tcy;': '\u0422', + 'tcy;': '\u0442', + 'tdot;': '\u20db', + 'telrec;': '\u2315', + 'Tfr;': '\U0001d517', + 'tfr;': '\U0001d531', + 'there4;': '\u2234', + 'Therefore;': '\u2234', + 'therefore;': '\u2234', + 'Theta;': '\u0398', + 'theta;': '\u03b8', + 'thetasym;': '\u03d1', + 'thetav;': '\u03d1', + 'thickapprox;': '\u2248', + 'thicksim;': '\u223c', + 'ThickSpace;': '\u205f\u200a', + 'thinsp;': '\u2009', + 'ThinSpace;': '\u2009', + 'thkap;': '\u2248', + 'thksim;': '\u223c', + 'THORN': '\xde', + 'thorn': '\xfe', + 'THORN;': '\xde', + 'thorn;': '\xfe', + 'Tilde;': '\u223c', + 'tilde;': '\u02dc', + 'TildeEqual;': '\u2243', + 'TildeFullEqual;': '\u2245', + 'TildeTilde;': '\u2248', + 'times': '\xd7', + 'times;': '\xd7', + 'timesb;': '\u22a0', + 'timesbar;': '\u2a31', + 'timesd;': '\u2a30', + 'tint;': '\u222d', + 'toea;': '\u2928', + 'top;': '\u22a4', + 'topbot;': '\u2336', + 'topcir;': '\u2af1', + 'Topf;': '\U0001d54b', + 'topf;': '\U0001d565', + 'topfork;': '\u2ada', + 'tosa;': '\u2929', + 'tprime;': '\u2034', + 'TRADE;': '\u2122', + 'trade;': '\u2122', + 'triangle;': '\u25b5', + 'triangledown;': '\u25bf', + 'triangleleft;': '\u25c3', + 'trianglelefteq;': '\u22b4', + 'triangleq;': '\u225c', + 'triangleright;': '\u25b9', + 'trianglerighteq;': '\u22b5', + 'tridot;': '\u25ec', + 'trie;': '\u225c', + 'triminus;': '\u2a3a', + 'TripleDot;': '\u20db', + 'triplus;': '\u2a39', + 'trisb;': '\u29cd', + 'tritime;': '\u2a3b', + 'trpezium;': '\u23e2', + 'Tscr;': '\U0001d4af', + 'tscr;': '\U0001d4c9', + 'TScy;': '\u0426', + 'tscy;': '\u0446', + 'TSHcy;': '\u040b', + 'tshcy;': '\u045b', + 'Tstrok;': '\u0166', + 'tstrok;': '\u0167', + 'twixt;': '\u226c', + 'twoheadleftarrow;': '\u219e', + 'twoheadrightarrow;': '\u21a0', + 'Uacute': '\xda', + 'uacute': '\xfa', + 'Uacute;': '\xda', + 'uacute;': '\xfa', + 'Uarr;': '\u219f', + 'uArr;': '\u21d1', + 'uarr;': '\u2191', + 'Uarrocir;': '\u2949', + 'Ubrcy;': '\u040e', + 'ubrcy;': '\u045e', + 'Ubreve;': '\u016c', + 'ubreve;': '\u016d', + 'Ucirc': '\xdb', + 'ucirc': '\xfb', + 'Ucirc;': '\xdb', + 'ucirc;': '\xfb', + 'Ucy;': '\u0423', + 'ucy;': '\u0443', + 'udarr;': '\u21c5', + 'Udblac;': '\u0170', + 'udblac;': '\u0171', + 'udhar;': '\u296e', + 'ufisht;': '\u297e', + 'Ufr;': '\U0001d518', + 'ufr;': '\U0001d532', + 'Ugrave': '\xd9', + 'ugrave': '\xf9', + 'Ugrave;': '\xd9', + 'ugrave;': '\xf9', + 'uHar;': '\u2963', + 'uharl;': '\u21bf', + 'uharr;': '\u21be', + 'uhblk;': '\u2580', + 'ulcorn;': '\u231c', + 'ulcorner;': '\u231c', + 'ulcrop;': '\u230f', + 'ultri;': '\u25f8', + 'Umacr;': '\u016a', + 'umacr;': '\u016b', + 'uml': '\xa8', + 'uml;': '\xa8', + 'UnderBar;': '_', + 'UnderBrace;': '\u23df', + 'UnderBracket;': '\u23b5', + 'UnderParenthesis;': '\u23dd', + 'Union;': '\u22c3', + 'UnionPlus;': '\u228e', + 'Uogon;': '\u0172', + 'uogon;': '\u0173', + 'Uopf;': '\U0001d54c', + 'uopf;': '\U0001d566', + 'UpArrow;': '\u2191', + 'Uparrow;': '\u21d1', + 'uparrow;': '\u2191', + 'UpArrowBar;': '\u2912', + 'UpArrowDownArrow;': '\u21c5', + 'UpDownArrow;': '\u2195', + 'Updownarrow;': '\u21d5', + 'updownarrow;': '\u2195', + 'UpEquilibrium;': '\u296e', + 'upharpoonleft;': '\u21bf', + 'upharpoonright;': '\u21be', + 'uplus;': '\u228e', + 'UpperLeftArrow;': '\u2196', + 'UpperRightArrow;': '\u2197', + 'Upsi;': '\u03d2', + 'upsi;': '\u03c5', + 'upsih;': '\u03d2', + 'Upsilon;': '\u03a5', + 'upsilon;': '\u03c5', + 'UpTee;': '\u22a5', + 'UpTeeArrow;': '\u21a5', + 'upuparrows;': '\u21c8', + 'urcorn;': '\u231d', + 'urcorner;': '\u231d', + 'urcrop;': '\u230e', + 'Uring;': '\u016e', + 'uring;': '\u016f', + 'urtri;': '\u25f9', + 'Uscr;': '\U0001d4b0', + 'uscr;': '\U0001d4ca', + 'utdot;': '\u22f0', + 'Utilde;': '\u0168', + 'utilde;': '\u0169', + 'utri;': '\u25b5', + 'utrif;': '\u25b4', + 'uuarr;': '\u21c8', + 'Uuml': '\xdc', + 'uuml': '\xfc', + 'Uuml;': '\xdc', + 'uuml;': '\xfc', + 'uwangle;': '\u29a7', + 'vangrt;': '\u299c', + 'varepsilon;': '\u03f5', + 'varkappa;': '\u03f0', + 'varnothing;': '\u2205', + 'varphi;': '\u03d5', + 'varpi;': '\u03d6', + 'varpropto;': '\u221d', + 'vArr;': '\u21d5', + 'varr;': '\u2195', + 'varrho;': '\u03f1', + 'varsigma;': '\u03c2', + 'varsubsetneq;': '\u228a\ufe00', + 'varsubsetneqq;': '\u2acb\ufe00', + 'varsupsetneq;': '\u228b\ufe00', + 'varsupsetneqq;': '\u2acc\ufe00', + 'vartheta;': '\u03d1', + 'vartriangleleft;': '\u22b2', + 'vartriangleright;': '\u22b3', + 'Vbar;': '\u2aeb', + 'vBar;': '\u2ae8', + 'vBarv;': '\u2ae9', + 'Vcy;': '\u0412', + 'vcy;': '\u0432', + 'VDash;': '\u22ab', + 'Vdash;': '\u22a9', + 'vDash;': '\u22a8', + 'vdash;': '\u22a2', + 'Vdashl;': '\u2ae6', + 'Vee;': '\u22c1', + 'vee;': '\u2228', + 'veebar;': '\u22bb', + 'veeeq;': '\u225a', + 'vellip;': '\u22ee', + 'Verbar;': '\u2016', + 'verbar;': '|', + 'Vert;': '\u2016', + 'vert;': '|', + 'VerticalBar;': '\u2223', + 'VerticalLine;': '|', + 'VerticalSeparator;': '\u2758', + 'VerticalTilde;': '\u2240', + 'VeryThinSpace;': '\u200a', + 'Vfr;': '\U0001d519', + 'vfr;': '\U0001d533', + 'vltri;': '\u22b2', + 'vnsub;': '\u2282\u20d2', + 'vnsup;': '\u2283\u20d2', + 'Vopf;': '\U0001d54d', + 'vopf;': '\U0001d567', + 'vprop;': '\u221d', + 'vrtri;': '\u22b3', + 'Vscr;': '\U0001d4b1', + 'vscr;': '\U0001d4cb', + 'vsubnE;': '\u2acb\ufe00', + 'vsubne;': '\u228a\ufe00', + 'vsupnE;': '\u2acc\ufe00', + 'vsupne;': '\u228b\ufe00', + 'Vvdash;': '\u22aa', + 'vzigzag;': '\u299a', + 'Wcirc;': '\u0174', + 'wcirc;': '\u0175', + 'wedbar;': '\u2a5f', + 'Wedge;': '\u22c0', + 'wedge;': '\u2227', + 'wedgeq;': '\u2259', + 'weierp;': '\u2118', + 'Wfr;': '\U0001d51a', + 'wfr;': '\U0001d534', + 'Wopf;': '\U0001d54e', + 'wopf;': '\U0001d568', + 'wp;': '\u2118', + 'wr;': '\u2240', + 'wreath;': '\u2240', + 'Wscr;': '\U0001d4b2', + 'wscr;': '\U0001d4cc', + 'xcap;': '\u22c2', + 'xcirc;': '\u25ef', + 'xcup;': '\u22c3', + 'xdtri;': '\u25bd', + 'Xfr;': '\U0001d51b', + 'xfr;': '\U0001d535', + 'xhArr;': '\u27fa', + 'xharr;': '\u27f7', + 'Xi;': '\u039e', + 'xi;': '\u03be', + 'xlArr;': '\u27f8', + 'xlarr;': '\u27f5', + 'xmap;': '\u27fc', + 'xnis;': '\u22fb', + 'xodot;': '\u2a00', + 'Xopf;': '\U0001d54f', + 'xopf;': '\U0001d569', + 'xoplus;': '\u2a01', + 'xotime;': '\u2a02', + 'xrArr;': '\u27f9', + 'xrarr;': '\u27f6', + 'Xscr;': '\U0001d4b3', + 'xscr;': '\U0001d4cd', + 'xsqcup;': '\u2a06', + 'xuplus;': '\u2a04', + 'xutri;': '\u25b3', + 'xvee;': '\u22c1', + 'xwedge;': '\u22c0', + 'Yacute': '\xdd', + 'yacute': '\xfd', + 'Yacute;': '\xdd', + 'yacute;': '\xfd', + 'YAcy;': '\u042f', + 'yacy;': '\u044f', + 'Ycirc;': '\u0176', + 'ycirc;': '\u0177', + 'Ycy;': '\u042b', + 'ycy;': '\u044b', + 'yen': '\xa5', + 'yen;': '\xa5', + 'Yfr;': '\U0001d51c', + 'yfr;': '\U0001d536', + 'YIcy;': '\u0407', + 'yicy;': '\u0457', + 'Yopf;': '\U0001d550', + 'yopf;': '\U0001d56a', + 'Yscr;': '\U0001d4b4', + 'yscr;': '\U0001d4ce', + 'YUcy;': '\u042e', + 'yucy;': '\u044e', + 'yuml': '\xff', + 'Yuml;': '\u0178', + 'yuml;': '\xff', + 'Zacute;': '\u0179', + 'zacute;': '\u017a', + 'Zcaron;': '\u017d', + 'zcaron;': '\u017e', + 'Zcy;': '\u0417', + 'zcy;': '\u0437', + 'Zdot;': '\u017b', + 'zdot;': '\u017c', + 'zeetrf;': '\u2128', + 'ZeroWidthSpace;': '\u200b', + 'Zeta;': '\u0396', + 'zeta;': '\u03b6', + 'Zfr;': '\u2128', + 'zfr;': '\U0001d537', + 'ZHcy;': '\u0416', + 'zhcy;': '\u0436', + 'zigrarr;': '\u21dd', + 'Zopf;': '\u2124', + 'zopf;': '\U0001d56b', + 'Zscr;': '\U0001d4b5', + 'zscr;': '\U0001d4cf', + 'zwj;': '\u200d', + 'zwnj;': '\u200c', + } + +try: + import http.client as compat_http_client +except ImportError: # Python 2 + import httplib as compat_http_client + +try: + from urllib.error import HTTPError as compat_HTTPError +except ImportError: # Python 2 + from urllib2 import HTTPError as compat_HTTPError + +try: + from urllib.request import urlretrieve as compat_urlretrieve +except ImportError: # Python 2 + from urllib import urlretrieve as compat_urlretrieve + +try: + from html.parser import HTMLParser as compat_HTMLParser +except ImportError: # Python 2 + from HTMLParser import HTMLParser as compat_HTMLParser + +try: # Python 2 + from HTMLParser import HTMLParseError as compat_HTMLParseError +except ImportError: # Python <3.4 + try: + from html.parser import HTMLParseError as compat_HTMLParseError + except ImportError: # Python >3.4 + + # HTMLParseError has been deprecated in Python 3.3 and removed in + # Python 3.5. Introducing dummy exception for Python >3.5 for compatible + # and uniform cross-version exceptiong handling + class compat_HTMLParseError(Exception): + pass + +try: + from subprocess import DEVNULL + compat_subprocess_get_DEVNULL = lambda: DEVNULL +except ImportError: + compat_subprocess_get_DEVNULL = lambda: open(os.path.devnull, 'w') + +try: + import http.server as compat_http_server +except ImportError: + import BaseHTTPServer as compat_http_server + +try: + compat_str = unicode # Python 2 +except NameError: + compat_str = str + +try: + from urllib.parse import unquote_to_bytes as compat_urllib_parse_unquote_to_bytes + from urllib.parse import unquote as compat_urllib_parse_unquote + from urllib.parse import unquote_plus as compat_urllib_parse_unquote_plus +except ImportError: # Python 2 + _asciire = (compat_urllib_parse._asciire if hasattr(compat_urllib_parse, '_asciire') + else re.compile(r'([\x00-\x7f]+)')) + + # HACK: The following are the correct unquote_to_bytes, unquote and unquote_plus + # implementations from cpython 3.4.3's stdlib. Python 2's version + # is apparently broken (see https://github.com/ytdl-org/youtube-dl/pull/6244) + + def compat_urllib_parse_unquote_to_bytes(string): + """unquote_to_bytes('abc%20def') -> b'abc def'.""" + # Note: strings are encoded as UTF-8. This is only an issue if it contains + # unescaped non-ASCII characters, which URIs should not. + if not string: + # Is it a string-like object? + string.split + return b'' + if isinstance(string, compat_str): + string = string.encode('utf-8') + bits = string.split(b'%') + if len(bits) == 1: + return string + res = [bits[0]] + append = res.append + for item in bits[1:]: + try: + append(compat_urllib_parse._hextochr[item[:2]]) + append(item[2:]) + except KeyError: + append(b'%') + append(item) + return b''.join(res) + + def compat_urllib_parse_unquote(string, encoding='utf-8', errors='replace'): + """Replace %xx escapes by their single-character equivalent. The optional + encoding and errors parameters specify how to decode percent-encoded + sequences into Unicode characters, as accepted by the bytes.decode() + method. + By default, percent-encoded sequences are decoded with UTF-8, and invalid + sequences are replaced by a placeholder character. + + unquote('abc%20def') -> 'abc def'. + """ + if '%' not in string: + string.split + return string + if encoding is None: + encoding = 'utf-8' + if errors is None: + errors = 'replace' + bits = _asciire.split(string) + res = [bits[0]] + append = res.append + for i in range(1, len(bits), 2): + append(compat_urllib_parse_unquote_to_bytes(bits[i]).decode(encoding, errors)) + append(bits[i + 1]) + return ''.join(res) + + def compat_urllib_parse_unquote_plus(string, encoding='utf-8', errors='replace'): + """Like unquote(), but also replace plus signs by spaces, as required for + unquoting HTML form values. + + unquote_plus('%7e/abc+def') -> '~/abc def' + """ + string = string.replace('+', ' ') + return compat_urllib_parse_unquote(string, encoding, errors) + +try: + from urllib.parse import urlencode as compat_urllib_parse_urlencode +except ImportError: # Python 2 + # Python 2 will choke in urlencode on mixture of byte and unicode strings. + # Possible solutions are to either port it from python 3 with all + # the friends or manually ensure input query contains only byte strings. + # We will stick with latter thus recursively encoding the whole query. + def compat_urllib_parse_urlencode(query, doseq=0, encoding='utf-8'): + def encode_elem(e): + if isinstance(e, dict): + e = encode_dict(e) + elif isinstance(e, (list, tuple,)): + list_e = encode_list(e) + e = tuple(list_e) if isinstance(e, tuple) else list_e + elif isinstance(e, compat_str): + e = e.encode(encoding) + return e + + def encode_dict(d): + return dict((encode_elem(k), encode_elem(v)) for k, v in d.items()) + + def encode_list(l): + return [encode_elem(e) for e in l] + + return compat_urllib_parse.urlencode(encode_elem(query), doseq=doseq) + +try: + from urllib.request import DataHandler as compat_urllib_request_DataHandler +except ImportError: # Python < 3.4 + # Ported from CPython 98774:1733b3bd46db, Lib/urllib/request.py + class compat_urllib_request_DataHandler(compat_urllib_request.BaseHandler): + def data_open(self, req): + # data URLs as specified in RFC 2397. + # + # ignores POSTed data + # + # syntax: + # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data + # mediatype := [ type "/" subtype ] *( ";" parameter ) + # data := *urlchar + # parameter := attribute "=" value + url = req.get_full_url() + + scheme, data = url.split(':', 1) + mediatype, data = data.split(',', 1) + + # even base64 encoded data URLs might be quoted so unquote in any case: + data = compat_urllib_parse_unquote_to_bytes(data) + if mediatype.endswith(';base64'): + data = binascii.a2b_base64(data) + mediatype = mediatype[:-7] + + if not mediatype: + mediatype = 'text/plain;charset=US-ASCII' + + headers = email.message_from_string( + 'Content-type: %s\nContent-length: %d\n' % (mediatype, len(data))) + + return compat_urllib_response.addinfourl(io.BytesIO(data), headers, url) + +try: + compat_basestring = basestring # Python 2 +except NameError: + compat_basestring = str + +try: + compat_chr = unichr # Python 2 +except NameError: + compat_chr = chr + +try: + from xml.etree.ElementTree import ParseError as compat_xml_parse_error +except ImportError: # Python 2.6 + from xml.parsers.expat import ExpatError as compat_xml_parse_error + + +etree = xml.etree.ElementTree + + +class _TreeBuilder(etree.TreeBuilder): + def doctype(self, name, pubid, system): + pass + + +try: + # xml.etree.ElementTree.Element is a method in Python <=2.6 and + # the following will crash with: + # TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types + isinstance(None, xml.etree.ElementTree.Element) + from xml.etree.ElementTree import Element as compat_etree_Element +except TypeError: # Python <=2.6 + from xml.etree.ElementTree import _ElementInterface as compat_etree_Element + +if sys.version_info[0] >= 3: + def compat_etree_fromstring(text): + return etree.XML(text, parser=etree.XMLParser(target=_TreeBuilder())) +else: + # python 2.x tries to encode unicode strings with ascii (see the + # XMLParser._fixtext method) + try: + _etree_iter = etree.Element.iter + except AttributeError: # Python <=2.6 + def _etree_iter(root): + for el in root.findall('*'): + yield el + for sub in _etree_iter(el): + yield sub + + # on 2.6 XML doesn't have a parser argument, function copied from CPython + # 2.7 source + def _XML(text, parser=None): + if not parser: + parser = etree.XMLParser(target=_TreeBuilder()) + parser.feed(text) + return parser.close() + + def _element_factory(*args, **kwargs): + el = etree.Element(*args, **kwargs) + for k, v in el.items(): + if isinstance(v, bytes): + el.set(k, v.decode('utf-8')) + return el + + def compat_etree_fromstring(text): + doc = _XML(text, parser=etree.XMLParser(target=_TreeBuilder(element_factory=_element_factory))) + for el in _etree_iter(doc): + if el.text is not None and isinstance(el.text, bytes): + el.text = el.text.decode('utf-8') + return doc + +if hasattr(etree, 'register_namespace'): + compat_etree_register_namespace = etree.register_namespace +else: + def compat_etree_register_namespace(prefix, uri): + """Register a namespace prefix. + The registry is global, and any existing mapping for either the + given prefix or the namespace URI will be removed. + *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and + attributes in this namespace will be serialized with prefix if possible. + ValueError is raised if prefix is reserved or is invalid. + """ + if re.match(r"ns\d+$", prefix): + raise ValueError("Prefix format reserved for internal use") + for k, v in list(etree._namespace_map.items()): + if k == uri or v == prefix: + del etree._namespace_map[k] + etree._namespace_map[uri] = prefix + +if sys.version_info < (2, 7): + # Here comes the crazy part: In 2.6, if the xpath is a unicode, + # .//node does not match if a node is a direct child of . ! + def compat_xpath(xpath): + if isinstance(xpath, compat_str): + xpath = xpath.encode('ascii') + return xpath +else: + compat_xpath = lambda xpath: xpath + +try: + from urllib.parse import parse_qs as compat_parse_qs +except ImportError: # Python 2 + # HACK: The following is the correct parse_qs implementation from cpython 3's stdlib. + # Python 2's version is apparently totally broken + + def _parse_qsl(qs, keep_blank_values=False, strict_parsing=False, + encoding='utf-8', errors='replace'): + qs, _coerce_result = qs, compat_str + pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')] + r = [] + for name_value in pairs: + if not name_value and not strict_parsing: + continue + nv = name_value.split('=', 1) + if len(nv) != 2: + if strict_parsing: + raise ValueError('bad query field: %r' % (name_value,)) + # Handle case of a control-name with no equal sign + if keep_blank_values: + nv.append('') + else: + continue + if len(nv[1]) or keep_blank_values: + name = nv[0].replace('+', ' ') + name = compat_urllib_parse_unquote( + name, encoding=encoding, errors=errors) + name = _coerce_result(name) + value = nv[1].replace('+', ' ') + value = compat_urllib_parse_unquote( + value, encoding=encoding, errors=errors) + value = _coerce_result(value) + r.append((name, value)) + return r + + def compat_parse_qs(qs, keep_blank_values=False, strict_parsing=False, + encoding='utf-8', errors='replace'): + parsed_result = {} + pairs = _parse_qsl(qs, keep_blank_values, strict_parsing, + encoding=encoding, errors=errors) + for name, value in pairs: + if name in parsed_result: + parsed_result[name].append(value) + else: + parsed_result[name] = [value] + return parsed_result + + +compat_os_name = os._name if os.name == 'java' else os.name + + +if compat_os_name == 'nt': + def compat_shlex_quote(s): + return s if re.match(r'^[-_\w./]+$', s) else '"%s"' % s.replace('"', '\\"') +else: + try: + from shlex import quote as compat_shlex_quote + except ImportError: # Python < 3.3 + def compat_shlex_quote(s): + if re.match(r'^[-_\w./]+$', s): + return s + else: + return "'" + s.replace("'", "'\"'\"'") + "'" + + +try: + args = shlex.split('中文') + assert (isinstance(args, list) + and isinstance(args[0], compat_str) + and args[0] == '中文') + compat_shlex_split = shlex.split +except (AssertionError, UnicodeEncodeError): + # Working around shlex issue with unicode strings on some python 2 + # versions (see http://bugs.python.org/issue1548891) + def compat_shlex_split(s, comments=False, posix=True): + if isinstance(s, compat_str): + s = s.encode('utf-8') + return list(map(lambda s: s.decode('utf-8'), shlex.split(s, comments, posix))) + + +def compat_ord(c): + if type(c) is int: + return c + else: + return ord(c) + + +if sys.version_info >= (3, 0): + compat_getenv = os.getenv + compat_expanduser = os.path.expanduser + + def compat_setenv(key, value, env=os.environ): + env[key] = value +else: + # Environment variables should be decoded with filesystem encoding. + # Otherwise it will fail if any non-ASCII characters present (see #3854 #3217 #2918) + + def compat_getenv(key, default=None): + from .utils import get_filesystem_encoding + env = os.getenv(key, default) + if env: + env = env.decode(get_filesystem_encoding()) + return env + + def compat_setenv(key, value, env=os.environ): + def encode(v): + from .utils import get_filesystem_encoding + return v.encode(get_filesystem_encoding()) if isinstance(v, compat_str) else v + env[encode(key)] = encode(value) + + # HACK: The default implementations of os.path.expanduser from cpython do not decode + # environment variables with filesystem encoding. We will work around this by + # providing adjusted implementations. + # The following are os.path.expanduser implementations from cpython 2.7.8 stdlib + # for different platforms with correct environment variables decoding. + + if compat_os_name == 'posix': + def compat_expanduser(path): + """Expand ~ and ~user constructions. If user or $HOME is unknown, + do nothing.""" + if not path.startswith('~'): + return path + i = path.find('/', 1) + if i < 0: + i = len(path) + if i == 1: + if 'HOME' not in os.environ: + import pwd + userhome = pwd.getpwuid(os.getuid()).pw_dir + else: + userhome = compat_getenv('HOME') + else: + import pwd + try: + pwent = pwd.getpwnam(path[1:i]) + except KeyError: + return path + userhome = pwent.pw_dir + userhome = userhome.rstrip('/') + return (userhome + path[i:]) or '/' + elif compat_os_name in ('nt', 'ce'): + def compat_expanduser(path): + """Expand ~ and ~user constructs. + + If user or $HOME is unknown, do nothing.""" + if path[:1] != '~': + return path + i, n = 1, len(path) + while i < n and path[i] not in '/\\': + i = i + 1 + + if 'HOME' in os.environ: + userhome = compat_getenv('HOME') + elif 'USERPROFILE' in os.environ: + userhome = compat_getenv('USERPROFILE') + elif 'HOMEPATH' not in os.environ: + return path + else: + try: + drive = compat_getenv('HOMEDRIVE') + except KeyError: + drive = '' + userhome = os.path.join(drive, compat_getenv('HOMEPATH')) + + if i != 1: # ~user + userhome = os.path.join(os.path.dirname(userhome), path[1:i]) + + return userhome + path[i:] + else: + compat_expanduser = os.path.expanduser + + +if compat_os_name == 'nt' and sys.version_info < (3, 8): + # os.path.realpath on Windows does not follow symbolic links + # prior to Python 3.8 (see https://bugs.python.org/issue9949) + def compat_realpath(path): + while os.path.islink(path): + path = os.path.abspath(os.readlink(path)) + return path +else: + compat_realpath = os.path.realpath + + +if sys.version_info < (3, 0): + def compat_print(s): + from .utils import preferredencoding + print(s.encode(preferredencoding(), 'xmlcharrefreplace')) +else: + def compat_print(s): + assert isinstance(s, compat_str) + print(s) + + +if sys.version_info < (3, 0) and sys.platform == 'win32': + def compat_getpass(prompt, *args, **kwargs): + if isinstance(prompt, compat_str): + from .utils import preferredencoding + prompt = prompt.encode(preferredencoding()) + return getpass.getpass(prompt, *args, **kwargs) +else: + compat_getpass = getpass.getpass + +try: + compat_input = raw_input +except NameError: # Python 3 + compat_input = input + +# Python < 2.6.5 require kwargs to be bytes +try: + def _testfunc(x): + pass + _testfunc(**{'x': 0}) +except TypeError: + def compat_kwargs(kwargs): + return dict((bytes(k), v) for k, v in kwargs.items()) +else: + compat_kwargs = lambda kwargs: kwargs + + +try: + compat_numeric_types = (int, float, long, complex) +except NameError: # Python 3 + compat_numeric_types = (int, float, complex) + + +try: + compat_integer_types = (int, long) +except NameError: # Python 3 + compat_integer_types = (int, ) + + +if sys.version_info < (2, 7): + def compat_socket_create_connection(address, timeout, source_address=None): + host, port = address + err = None + for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): + af, socktype, proto, canonname, sa = res + sock = None + try: + sock = socket.socket(af, socktype, proto) + sock.settimeout(timeout) + if source_address: + sock.bind(source_address) + sock.connect(sa) + return sock + except socket.error as _: + err = _ + if sock is not None: + sock.close() + if err is not None: + raise err + else: + raise socket.error('getaddrinfo returns an empty list') +else: + compat_socket_create_connection = socket.create_connection + + +# Fix https://github.com/ytdl-org/youtube-dl/issues/4223 +# See http://bugs.python.org/issue9161 for what is broken +def workaround_optparse_bug9161(): + op = optparse.OptionParser() + og = optparse.OptionGroup(op, 'foo') + try: + og.add_option('-t') + except TypeError: + real_add_option = optparse.OptionGroup.add_option + + def _compat_add_option(self, *args, **kwargs): + enc = lambda v: ( + v.encode('ascii', 'replace') if isinstance(v, compat_str) + else v) + bargs = [enc(a) for a in args] + bkwargs = dict( + (k, enc(v)) for k, v in kwargs.items()) + return real_add_option(self, *bargs, **bkwargs) + optparse.OptionGroup.add_option = _compat_add_option + + +if hasattr(shutil, 'get_terminal_size'): # Python >= 3.3 + compat_get_terminal_size = shutil.get_terminal_size +else: + _terminal_size = collections.namedtuple('terminal_size', ['columns', 'lines']) + + def compat_get_terminal_size(fallback=(80, 24)): + columns = compat_getenv('COLUMNS') + if columns: + columns = int(columns) + else: + columns = None + lines = compat_getenv('LINES') + if lines: + lines = int(lines) + else: + lines = None + + if columns is None or lines is None or columns <= 0 or lines <= 0: + try: + sp = subprocess.Popen( + ['stty', 'size'], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = sp.communicate() + _lines, _columns = map(int, out.split()) + except Exception: + _columns, _lines = _terminal_size(*fallback) + + if columns is None or columns <= 0: + columns = _columns + if lines is None or lines <= 0: + lines = _lines + return _terminal_size(columns, lines) + +try: + itertools.count(start=0, step=1) + compat_itertools_count = itertools.count +except TypeError: # Python 2.6 + def compat_itertools_count(start=0, step=1): + n = start + while True: + yield n + n += step + +if sys.version_info >= (3, 0): + from tokenize import tokenize as compat_tokenize_tokenize +else: + from tokenize import generate_tokens as compat_tokenize_tokenize + + +try: + struct.pack('!I', 0) +except TypeError: + # In Python 2.6 and 2.7.x < 2.7.7, struct requires a bytes argument + # See https://bugs.python.org/issue19099 + def compat_struct_pack(spec, *args): + if isinstance(spec, compat_str): + spec = spec.encode('ascii') + return struct.pack(spec, *args) + + def compat_struct_unpack(spec, *args): + if isinstance(spec, compat_str): + spec = spec.encode('ascii') + return struct.unpack(spec, *args) + + class compat_Struct(struct.Struct): + def __init__(self, fmt): + if isinstance(fmt, compat_str): + fmt = fmt.encode('ascii') + super(compat_Struct, self).__init__(fmt) +else: + compat_struct_pack = struct.pack + compat_struct_unpack = struct.unpack + if platform.python_implementation() == 'IronPython' and sys.version_info < (2, 7, 8): + class compat_Struct(struct.Struct): + def unpack(self, string): + if not isinstance(string, buffer): # noqa: F821 + string = buffer(string) # noqa: F821 + return super(compat_Struct, self).unpack(string) + else: + compat_Struct = struct.Struct + + +try: + from future_builtins import zip as compat_zip +except ImportError: # not 2.6+ or is 3.x + try: + from itertools import izip as compat_zip # < 2.5 or 3.x + except ImportError: + compat_zip = zip + + +if sys.version_info < (3, 3): + def compat_b64decode(s, *args, **kwargs): + if isinstance(s, compat_str): + s = s.encode('ascii') + return base64.b64decode(s, *args, **kwargs) +else: + compat_b64decode = base64.b64decode + + +if platform.python_implementation() == 'PyPy' and sys.pypy_version_info < (5, 4, 0): + # PyPy2 prior to version 5.4.0 expects byte strings as Windows function + # names, see the original PyPy issue [1] and the youtube-dlc one [2]. + # 1. https://bitbucket.org/pypy/pypy/issues/2360/windows-ctypescdll-typeerror-function-name + # 2. https://github.com/ytdl-org/youtube-dl/pull/4392 + def compat_ctypes_WINFUNCTYPE(*args, **kwargs): + real = ctypes.WINFUNCTYPE(*args, **kwargs) + + def resf(tpl, *args, **kwargs): + funcname, dll = tpl + return real((str(funcname), dll), *args, **kwargs) + + return resf +else: + def compat_ctypes_WINFUNCTYPE(*args, **kwargs): + return ctypes.WINFUNCTYPE(*args, **kwargs) + + +__all__ = [ + 'compat_HTMLParseError', + 'compat_HTMLParser', + 'compat_HTTPError', + 'compat_Struct', + 'compat_b64decode', + 'compat_basestring', + 'compat_chr', + 'compat_cookiejar', + 'compat_cookiejar_Cookie', + 'compat_cookies', + 'compat_ctypes_WINFUNCTYPE', + 'compat_etree_Element', + 'compat_etree_fromstring', + 'compat_etree_register_namespace', + 'compat_expanduser', + 'compat_get_terminal_size', + 'compat_getenv', + 'compat_getpass', + 'compat_html_entities', + 'compat_html_entities_html5', + 'compat_http_client', + 'compat_http_server', + 'compat_input', + 'compat_integer_types', + 'compat_itertools_count', + 'compat_kwargs', + 'compat_numeric_types', + 'compat_ord', + 'compat_os_name', + 'compat_parse_qs', + 'compat_print', + 'compat_realpath', + 'compat_setenv', + 'compat_shlex_quote', + 'compat_shlex_split', + 'compat_socket_create_connection', + 'compat_str', + 'compat_struct_pack', + 'compat_struct_unpack', + 'compat_subprocess_get_DEVNULL', + 'compat_tokenize_tokenize', + 'compat_urllib_error', + 'compat_urllib_parse', + 'compat_urllib_parse_unquote', + 'compat_urllib_parse_unquote_plus', + 'compat_urllib_parse_unquote_to_bytes', + 'compat_urllib_parse_urlencode', + 'compat_urllib_parse_urlparse', + 'compat_urllib_request', + 'compat_urllib_request_DataHandler', + 'compat_urllib_response', + 'compat_urlparse', + 'compat_urlretrieve', + 'compat_xml_parse_error', + 'compat_xpath', + 'compat_zip', + 'workaround_optparse_bug9161', +] diff --git a/youtube_dl/downloader/__init__.py b/youtube_dl/downloader/__init__.py new file mode 100644 index 000000000..4ae81f516 --- /dev/null +++ b/youtube_dl/downloader/__init__.py @@ -0,0 +1,63 @@ +from __future__ import unicode_literals + +from .common import FileDownloader +from .f4m import F4mFD +from .hls import HlsFD +from .http import HttpFD +from .rtmp import RtmpFD +from .dash import DashSegmentsFD +from .rtsp import RtspFD +from .ism import IsmFD +from .youtube_live_chat import YoutubeLiveChatReplayFD +from .external import ( + get_external_downloader, + FFmpegFD, +) + +from ..utils import ( + determine_protocol, +) + +PROTOCOL_MAP = { + 'rtmp': RtmpFD, + 'm3u8_native': HlsFD, + 'm3u8': FFmpegFD, + 'mms': RtspFD, + 'rtsp': RtspFD, + 'f4m': F4mFD, + 'http_dash_segments': DashSegmentsFD, + 'ism': IsmFD, + 'youtube_live_chat_replay': YoutubeLiveChatReplayFD, +} + + +def get_suitable_downloader(info_dict, params={}): + """Get the downloader class that can handle the info dict.""" + protocol = determine_protocol(info_dict) + info_dict['protocol'] = protocol + + # if (info_dict.get('start_time') or info_dict.get('end_time')) and not info_dict.get('requested_formats') and FFmpegFD.can_download(info_dict): + # return FFmpegFD + + external_downloader = params.get('external_downloader') + if external_downloader is not None: + ed = get_external_downloader(external_downloader) + if ed.can_download(info_dict): + return ed + + if protocol.startswith('m3u8') and info_dict.get('is_live'): + return FFmpegFD + + if protocol == 'm3u8' and params.get('hls_prefer_native') is True: + return HlsFD + + if protocol == 'm3u8_native' and params.get('hls_prefer_native') is False: + return FFmpegFD + + return PROTOCOL_MAP.get(protocol, HttpFD) + + +__all__ = [ + 'get_suitable_downloader', + 'FileDownloader', +] diff --git a/youtube_dl/downloader/common.py b/youtube_dl/downloader/common.py new file mode 100644 index 000000000..31c286458 --- /dev/null +++ b/youtube_dl/downloader/common.py @@ -0,0 +1,391 @@ +from __future__ import division, unicode_literals + +import os +import re +import sys +import time +import random + +from ..compat import compat_os_name +from ..utils import ( + decodeArgument, + encodeFilename, + error_to_compat_str, + format_bytes, + shell_quote, + timeconvert, +) + + +class FileDownloader(object): + """File Downloader class. + + File downloader objects are the ones responsible of downloading the + actual video file and writing it to disk. + + File downloaders accept a lot of parameters. In order not to saturate + the object constructor with arguments, it receives a dictionary of + options instead. + + Available options: + + verbose: Print additional info to stdout. + quiet: Do not print messages to stdout. + ratelimit: Download speed limit, in bytes/sec. + retries: Number of times to retry for HTTP error 5xx + buffersize: Size of download buffer in bytes. + noresizebuffer: Do not automatically resize the download buffer. + continuedl: Try to continue downloads if possible. + noprogress: Do not print the progress bar. + logtostderr: Log messages to stderr instead of stdout. + consoletitle: Display progress in console window's titlebar. + nopart: Do not use temporary .part files. + updatetime: Use the Last-modified header to set output file timestamps. + test: Download only first bytes to test the downloader. + min_filesize: Skip files smaller than this size + max_filesize: Skip files larger than this size + xattr_set_filesize: Set ytdl.filesize user xattribute with expected size. + external_downloader_args: A list of additional command-line arguments for the + external downloader. + hls_use_mpegts: Use the mpegts container for HLS videos. + http_chunk_size: Size of a chunk for chunk-based HTTP downloading. May be + useful for bypassing bandwidth throttling imposed by + a webserver (experimental) + + Subclasses of this one must re-define the real_download method. + """ + + _TEST_FILE_SIZE = 10241 + params = None + + def __init__(self, ydl, params): + """Create a FileDownloader object with the given options.""" + self.ydl = ydl + self._progress_hooks = [] + self.params = params + self.add_progress_hook(self.report_progress) + + @staticmethod + def format_seconds(seconds): + (mins, secs) = divmod(seconds, 60) + (hours, mins) = divmod(mins, 60) + if hours > 99: + return '--:--:--' + if hours == 0: + return '%02d:%02d' % (mins, secs) + else: + return '%02d:%02d:%02d' % (hours, mins, secs) + + @staticmethod + def calc_percent(byte_counter, data_len): + if data_len is None: + return None + return float(byte_counter) / float(data_len) * 100.0 + + @staticmethod + def format_percent(percent): + if percent is None: + return '---.-%' + return '%6s' % ('%3.1f%%' % percent) + + @staticmethod + def calc_eta(start, now, total, current): + if total is None: + return None + if now is None: + now = time.time() + dif = now - start + if current == 0 or dif < 0.001: # One millisecond + return None + rate = float(current) / dif + return int((float(total) - float(current)) / rate) + + @staticmethod + def format_eta(eta): + if eta is None: + return '--:--' + return FileDownloader.format_seconds(eta) + + @staticmethod + def calc_speed(start, now, bytes): + dif = now - start + if bytes == 0 or dif < 0.001: # One millisecond + return None + return float(bytes) / dif + + @staticmethod + def format_speed(speed): + if speed is None: + return '%10s' % '---b/s' + return '%10s' % ('%s/s' % format_bytes(speed)) + + @staticmethod + def format_retries(retries): + return 'inf' if retries == float('inf') else '%.0f' % retries + + @staticmethod + def best_block_size(elapsed_time, bytes): + new_min = max(bytes / 2.0, 1.0) + new_max = min(max(bytes * 2.0, 1.0), 4194304) # Do not surpass 4 MB + if elapsed_time < 0.001: + return int(new_max) + rate = bytes / elapsed_time + if rate > new_max: + return int(new_max) + if rate < new_min: + return int(new_min) + return int(rate) + + @staticmethod + def parse_bytes(bytestr): + """Parse a string indicating a byte quantity into an integer.""" + matchobj = re.match(r'(?i)^(\d+(?:\.\d+)?)([kMGTPEZY]?)$', bytestr) + if matchobj is None: + return None + number = float(matchobj.group(1)) + multiplier = 1024.0 ** 'bkmgtpezy'.index(matchobj.group(2).lower()) + return int(round(number * multiplier)) + + def to_screen(self, *args, **kargs): + self.ydl.to_screen(*args, **kargs) + + def to_stderr(self, message): + self.ydl.to_screen(message) + + def to_console_title(self, message): + self.ydl.to_console_title(message) + + def trouble(self, *args, **kargs): + self.ydl.trouble(*args, **kargs) + + def report_warning(self, *args, **kargs): + self.ydl.report_warning(*args, **kargs) + + def report_error(self, *args, **kargs): + self.ydl.report_error(*args, **kargs) + + def slow_down(self, start_time, now, byte_counter): + """Sleep if the download speed is over the rate limit.""" + rate_limit = self.params.get('ratelimit') + if rate_limit is None or byte_counter == 0: + return + if now is None: + now = time.time() + elapsed = now - start_time + if elapsed <= 0.0: + return + speed = float(byte_counter) / elapsed + if speed > rate_limit: + sleep_time = float(byte_counter) / rate_limit - elapsed + if sleep_time > 0: + time.sleep(sleep_time) + + def temp_name(self, filename): + """Returns a temporary filename for the given filename.""" + if self.params.get('nopart', False) or filename == '-' or \ + (os.path.exists(encodeFilename(filename)) and not os.path.isfile(encodeFilename(filename))): + return filename + return filename + '.part' + + def undo_temp_name(self, filename): + if filename.endswith('.part'): + return filename[:-len('.part')] + return filename + + def ytdl_filename(self, filename): + return filename + '.ytdl' + + def try_rename(self, old_filename, new_filename): + try: + if old_filename == new_filename: + return + os.rename(encodeFilename(old_filename), encodeFilename(new_filename)) + except (IOError, OSError) as err: + self.report_error('unable to rename file: %s' % error_to_compat_str(err)) + + def try_utime(self, filename, last_modified_hdr): + """Try to set the last-modified time of the given file.""" + if last_modified_hdr is None: + return + if not os.path.isfile(encodeFilename(filename)): + return + timestr = last_modified_hdr + if timestr is None: + return + filetime = timeconvert(timestr) + if filetime is None: + return filetime + # Ignore obviously invalid dates + if filetime == 0: + return + try: + os.utime(filename, (time.time(), filetime)) + except Exception: + pass + return filetime + + def report_destination(self, filename): + """Report destination filename.""" + self.to_screen('[download] Destination: ' + filename) + + def _report_progress_status(self, msg, is_last_line=False): + fullmsg = '[download] ' + msg + if self.params.get('progress_with_newline', False): + self.to_screen(fullmsg) + else: + if compat_os_name == 'nt': + prev_len = getattr(self, '_report_progress_prev_line_length', + 0) + if prev_len > len(fullmsg): + fullmsg += ' ' * (prev_len - len(fullmsg)) + self._report_progress_prev_line_length = len(fullmsg) + clear_line = '\r' + else: + clear_line = ('\r\x1b[K' if sys.stderr.isatty() else '\r') + self.to_screen(clear_line + fullmsg, skip_eol=not is_last_line) + self.to_console_title('youtube-dlc ' + msg) + + def report_progress(self, s): + if s['status'] == 'finished': + if self.params.get('noprogress', False): + self.to_screen('[download] Download completed') + else: + msg_template = '100%%' + if s.get('total_bytes') is not None: + s['_total_bytes_str'] = format_bytes(s['total_bytes']) + msg_template += ' of %(_total_bytes_str)s' + if s.get('elapsed') is not None: + s['_elapsed_str'] = self.format_seconds(s['elapsed']) + msg_template += ' in %(_elapsed_str)s' + self._report_progress_status( + msg_template % s, is_last_line=True) + + if self.params.get('noprogress'): + return + + if s['status'] != 'downloading': + return + + if s.get('eta') is not None: + s['_eta_str'] = self.format_eta(s['eta']) + else: + s['_eta_str'] = 'Unknown ETA' + + if s.get('total_bytes') and s.get('downloaded_bytes') is not None: + s['_percent_str'] = self.format_percent(100 * s['downloaded_bytes'] / s['total_bytes']) + elif s.get('total_bytes_estimate') and s.get('downloaded_bytes') is not None: + s['_percent_str'] = self.format_percent(100 * s['downloaded_bytes'] / s['total_bytes_estimate']) + else: + if s.get('downloaded_bytes') == 0: + s['_percent_str'] = self.format_percent(0) + else: + s['_percent_str'] = 'Unknown %' + + if s.get('speed') is not None: + s['_speed_str'] = self.format_speed(s['speed']) + else: + s['_speed_str'] = 'Unknown speed' + + if s.get('total_bytes') is not None: + s['_total_bytes_str'] = format_bytes(s['total_bytes']) + msg_template = '%(_percent_str)s of %(_total_bytes_str)s at %(_speed_str)s ETA %(_eta_str)s' + elif s.get('total_bytes_estimate') is not None: + s['_total_bytes_estimate_str'] = format_bytes(s['total_bytes_estimate']) + msg_template = '%(_percent_str)s of ~%(_total_bytes_estimate_str)s at %(_speed_str)s ETA %(_eta_str)s' + else: + if s.get('downloaded_bytes') is not None: + s['_downloaded_bytes_str'] = format_bytes(s['downloaded_bytes']) + if s.get('elapsed'): + s['_elapsed_str'] = self.format_seconds(s['elapsed']) + msg_template = '%(_downloaded_bytes_str)s at %(_speed_str)s (%(_elapsed_str)s)' + else: + msg_template = '%(_downloaded_bytes_str)s at %(_speed_str)s' + else: + msg_template = '%(_percent_str)s % at %(_speed_str)s ETA %(_eta_str)s' + + self._report_progress_status(msg_template % s) + + def report_resuming_byte(self, resume_len): + """Report attempt to resume at given byte.""" + self.to_screen('[download] Resuming download at byte %s' % resume_len) + + def report_retry(self, err, count, retries): + """Report retry in case of HTTP error 5xx""" + self.to_screen( + '[download] Got server HTTP error: %s. Retrying (attempt %d of %s)...' + % (error_to_compat_str(err), count, self.format_retries(retries))) + + def report_file_already_downloaded(self, file_name): + """Report file has already been fully downloaded.""" + try: + self.to_screen('[download] %s has already been downloaded' % file_name) + except UnicodeEncodeError: + self.to_screen('[download] The file has already been downloaded') + + def report_unable_to_resume(self): + """Report it was impossible to resume download.""" + self.to_screen('[download] Unable to resume') + + def download(self, filename, info_dict): + """Download to a filename using the info from info_dict + Return True on success and False otherwise + """ + + nooverwrites_and_exists = ( + self.params.get('nooverwrites', False) + and os.path.exists(encodeFilename(filename)) + ) + + if not hasattr(filename, 'write'): + continuedl_and_exists = ( + self.params.get('continuedl', True) + and os.path.isfile(encodeFilename(filename)) + and not self.params.get('nopart', False) + ) + + # Check file already present + if filename != '-' and (nooverwrites_and_exists or continuedl_and_exists): + self.report_file_already_downloaded(filename) + self._hook_progress({ + 'filename': filename, + 'status': 'finished', + 'total_bytes': os.path.getsize(encodeFilename(filename)), + }) + return True + + min_sleep_interval = self.params.get('sleep_interval') + if min_sleep_interval: + max_sleep_interval = self.params.get('max_sleep_interval', min_sleep_interval) + sleep_interval = random.uniform(min_sleep_interval, max_sleep_interval) + self.to_screen( + '[download] Sleeping %s seconds...' % ( + int(sleep_interval) if sleep_interval.is_integer() + else '%.2f' % sleep_interval)) + time.sleep(sleep_interval) + + return self.real_download(filename, info_dict) + + def real_download(self, filename, info_dict): + """Real download process. Redefine in subclasses.""" + raise NotImplementedError('This method must be implemented by subclasses') + + def _hook_progress(self, status): + for ph in self._progress_hooks: + ph(status) + + def add_progress_hook(self, ph): + # See YoutubeDl.py (search for progress_hooks) for a description of + # this interface + self._progress_hooks.append(ph) + + def _debug_cmd(self, args, exe=None): + if not self.params.get('verbose', False): + return + + str_args = [decodeArgument(a) for a in args] + + if exe is None: + exe = os.path.basename(str_args[0]) + + self.to_screen('[debug] %s command line: %s' % ( + exe, shell_quote(str_args))) diff --git a/youtube_dl/downloader/dash.py b/youtube_dl/downloader/dash.py new file mode 100644 index 000000000..c6d674bc6 --- /dev/null +++ b/youtube_dl/downloader/dash.py @@ -0,0 +1,80 @@ +from __future__ import unicode_literals + +from .fragment import FragmentFD +from ..compat import compat_urllib_error +from ..utils import ( + DownloadError, + urljoin, +) + + +class DashSegmentsFD(FragmentFD): + """ + Download segments in a DASH manifest + """ + + FD_NAME = 'dashsegments' + + def real_download(self, filename, info_dict): + fragment_base_url = info_dict.get('fragment_base_url') + fragments = info_dict['fragments'][:1] if self.params.get( + 'test', False) else info_dict['fragments'] + + ctx = { + 'filename': filename, + 'total_frags': len(fragments), + } + + self._prepare_and_start_frag_download(ctx) + + fragment_retries = self.params.get('fragment_retries', 0) + skip_unavailable_fragments = self.params.get('skip_unavailable_fragments', True) + + frag_index = 0 + for i, fragment in enumerate(fragments): + frag_index += 1 + if frag_index <= ctx['fragment_index']: + continue + # In DASH, the first segment contains necessary headers to + # generate a valid MP4 file, so always abort for the first segment + fatal = i == 0 or not skip_unavailable_fragments + count = 0 + while count <= fragment_retries: + try: + fragment_url = fragment.get('url') + if not fragment_url: + assert fragment_base_url + fragment_url = urljoin(fragment_base_url, fragment['path']) + success, frag_content = self._download_fragment(ctx, fragment_url, info_dict) + if not success: + return False + self._append_fragment(ctx, frag_content) + break + except compat_urllib_error.HTTPError as err: + # YouTube may often return 404 HTTP error for a fragment causing the + # whole download to fail. However if the same fragment is immediately + # retried with the same request data this usually succeeds (1-2 attempts + # is usually enough) thus allowing to download the whole file successfully. + # To be future-proof we will retry all fragments that fail with any + # HTTP error. + count += 1 + if count <= fragment_retries: + self.report_retry_fragment(err, frag_index, count, fragment_retries) + except DownloadError: + # Don't retry fragment if error occurred during HTTP downloading + # itself since it has own retry settings + if not fatal: + self.report_skip_fragment(frag_index) + break + raise + + if count > fragment_retries: + if not fatal: + self.report_skip_fragment(frag_index) + continue + self.report_error('giving up after %s fragment retries' % fragment_retries) + return False + + self._finish_frag_download(ctx) + + return True diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py new file mode 100644 index 000000000..c31f8910a --- /dev/null +++ b/youtube_dl/downloader/external.py @@ -0,0 +1,371 @@ +from __future__ import unicode_literals + +import os.path +import re +import subprocess +import sys +import time + +from .common import FileDownloader +from ..compat import ( + compat_setenv, + compat_str, +) +from ..postprocessor.ffmpeg import FFmpegPostProcessor, EXT_TO_OUT_FORMATS +from ..utils import ( + cli_option, + cli_valueless_option, + cli_bool_option, + cli_configuration_args, + encodeFilename, + encodeArgument, + handle_youtubedl_headers, + check_executable, + is_outdated_version, +) + + +class ExternalFD(FileDownloader): + def real_download(self, filename, info_dict): + self.report_destination(filename) + tmpfilename = self.temp_name(filename) + + try: + started = time.time() + retval = self._call_downloader(tmpfilename, info_dict) + except KeyboardInterrupt: + if not info_dict.get('is_live'): + raise + # Live stream downloading cancellation should be considered as + # correct and expected termination thus all postprocessing + # should take place + retval = 0 + self.to_screen('[%s] Interrupted by user' % self.get_basename()) + + if retval == 0: + status = { + 'filename': filename, + 'status': 'finished', + 'elapsed': time.time() - started, + } + if filename != '-': + fsize = os.path.getsize(encodeFilename(tmpfilename)) + self.to_screen('\r[%s] Downloaded %s bytes' % (self.get_basename(), fsize)) + self.try_rename(tmpfilename, filename) + status.update({ + 'downloaded_bytes': fsize, + 'total_bytes': fsize, + }) + self._hook_progress(status) + return True + else: + self.to_stderr('\n') + self.report_error('%s exited with code %d' % ( + self.get_basename(), retval)) + return False + + @classmethod + def get_basename(cls): + return cls.__name__[:-2].lower() + + @property + def exe(self): + return self.params.get('external_downloader') + + @classmethod + def available(cls): + return check_executable(cls.get_basename(), [cls.AVAILABLE_OPT]) + + @classmethod + def supports(cls, info_dict): + return info_dict['protocol'] in ('http', 'https', 'ftp', 'ftps') + + @classmethod + def can_download(cls, info_dict): + return cls.available() and cls.supports(info_dict) + + def _option(self, command_option, param): + return cli_option(self.params, command_option, param) + + def _bool_option(self, command_option, param, true_value='true', false_value='false', separator=None): + return cli_bool_option(self.params, command_option, param, true_value, false_value, separator) + + def _valueless_option(self, command_option, param, expected_value=True): + return cli_valueless_option(self.params, command_option, param, expected_value) + + def _configuration_args(self, default=[]): + return cli_configuration_args(self.params, 'external_downloader_args', default) + + def _call_downloader(self, tmpfilename, info_dict): + """ Either overwrite this or implement _make_cmd """ + cmd = [encodeArgument(a) for a in self._make_cmd(tmpfilename, info_dict)] + + self._debug_cmd(cmd) + + p = subprocess.Popen( + cmd, stderr=subprocess.PIPE) + _, stderr = p.communicate() + if p.returncode != 0: + self.to_stderr(stderr.decode('utf-8', 'replace')) + return p.returncode + + +class CurlFD(ExternalFD): + AVAILABLE_OPT = '-V' + + def _make_cmd(self, tmpfilename, info_dict): + cmd = [self.exe, '--location', '-o', tmpfilename] + for key, val in info_dict['http_headers'].items(): + cmd += ['--header', '%s: %s' % (key, val)] + cmd += self._bool_option('--continue-at', 'continuedl', '-', '0') + cmd += self._valueless_option('--silent', 'noprogress') + cmd += self._valueless_option('--verbose', 'verbose') + cmd += self._option('--limit-rate', 'ratelimit') + retry = self._option('--retry', 'retries') + if len(retry) == 2: + if retry[1] in ('inf', 'infinite'): + retry[1] = '2147483647' + cmd += retry + cmd += self._option('--max-filesize', 'max_filesize') + cmd += self._option('--interface', 'source_address') + cmd += self._option('--proxy', 'proxy') + cmd += self._valueless_option('--insecure', 'nocheckcertificate') + cmd += self._configuration_args() + cmd += ['--', info_dict['url']] + return cmd + + def _call_downloader(self, tmpfilename, info_dict): + cmd = [encodeArgument(a) for a in self._make_cmd(tmpfilename, info_dict)] + + self._debug_cmd(cmd) + + # curl writes the progress to stderr so don't capture it. + p = subprocess.Popen(cmd) + p.communicate() + return p.returncode + + +class AxelFD(ExternalFD): + AVAILABLE_OPT = '-V' + + def _make_cmd(self, tmpfilename, info_dict): + cmd = [self.exe, '-o', tmpfilename] + for key, val in info_dict['http_headers'].items(): + cmd += ['-H', '%s: %s' % (key, val)] + cmd += self._configuration_args() + cmd += ['--', info_dict['url']] + return cmd + + +class WgetFD(ExternalFD): + AVAILABLE_OPT = '--version' + + def _make_cmd(self, tmpfilename, info_dict): + cmd = [self.exe, '-O', tmpfilename, '-nv', '--no-cookies'] + for key, val in info_dict['http_headers'].items(): + cmd += ['--header', '%s: %s' % (key, val)] + cmd += self._option('--limit-rate', 'ratelimit') + retry = self._option('--tries', 'retries') + if len(retry) == 2: + if retry[1] in ('inf', 'infinite'): + retry[1] = '0' + cmd += retry + cmd += self._option('--bind-address', 'source_address') + cmd += self._option('--proxy', 'proxy') + cmd += self._valueless_option('--no-check-certificate', 'nocheckcertificate') + cmd += self._configuration_args() + cmd += ['--', info_dict['url']] + return cmd + + +class Aria2cFD(ExternalFD): + AVAILABLE_OPT = '-v' + + def _make_cmd(self, tmpfilename, info_dict): + cmd = [self.exe, '-c'] + cmd += self._configuration_args([ + '--min-split-size', '1M', '--max-connection-per-server', '4']) + dn = os.path.dirname(tmpfilename) + if dn: + cmd += ['--dir', dn] + cmd += ['--out', os.path.basename(tmpfilename)] + for key, val in info_dict['http_headers'].items(): + cmd += ['--header', '%s: %s' % (key, val)] + cmd += self._option('--interface', 'source_address') + cmd += self._option('--all-proxy', 'proxy') + cmd += self._bool_option('--check-certificate', 'nocheckcertificate', 'false', 'true', '=') + cmd += self._bool_option('--remote-time', 'updatetime', 'true', 'false', '=') + cmd += ['--', info_dict['url']] + return cmd + + +class HttpieFD(ExternalFD): + @classmethod + def available(cls): + return check_executable('http', ['--version']) + + def _make_cmd(self, tmpfilename, info_dict): + cmd = ['http', '--download', '--output', tmpfilename, info_dict['url']] + for key, val in info_dict['http_headers'].items(): + cmd += ['%s:%s' % (key, val)] + return cmd + + +class FFmpegFD(ExternalFD): + @classmethod + def supports(cls, info_dict): + return info_dict['protocol'] in ('http', 'https', 'ftp', 'ftps', 'm3u8', 'rtsp', 'rtmp', 'mms') + + @classmethod + def available(cls): + return FFmpegPostProcessor().available + + def _call_downloader(self, tmpfilename, info_dict): + url = info_dict['url'] + ffpp = FFmpegPostProcessor(downloader=self) + if not ffpp.available: + self.report_error('m3u8 download detected but ffmpeg or avconv could not be found. Please install one.') + return False + ffpp.check_version() + + args = [ffpp.executable, '-y'] + + for log_level in ('quiet', 'verbose'): + if self.params.get(log_level, False): + args += ['-loglevel', log_level] + break + + seekable = info_dict.get('_seekable') + if seekable is not None: + # setting -seekable prevents ffmpeg from guessing if the server + # supports seeking(by adding the header `Range: bytes=0-`), which + # can cause problems in some cases + # https://github.com/ytdl-org/youtube-dl/issues/11800#issuecomment-275037127 + # http://trac.ffmpeg.org/ticket/6125#comment:10 + args += ['-seekable', '1' if seekable else '0'] + + args += self._configuration_args() + + # start_time = info_dict.get('start_time') or 0 + # if start_time: + # args += ['-ss', compat_str(start_time)] + # end_time = info_dict.get('end_time') + # if end_time: + # args += ['-t', compat_str(end_time - start_time)] + + if info_dict['http_headers'] and re.match(r'^https?://', url): + # Trailing \r\n after each HTTP header is important to prevent warning from ffmpeg/avconv: + # [http @ 00000000003d2fa0] No trailing CRLF found in HTTP header. + headers = handle_youtubedl_headers(info_dict['http_headers']) + args += [ + '-headers', + ''.join('%s: %s\r\n' % (key, val) for key, val in headers.items())] + + env = None + proxy = self.params.get('proxy') + if proxy: + if not re.match(r'^[\da-zA-Z]+://', proxy): + proxy = 'http://%s' % proxy + + if proxy.startswith('socks'): + self.report_warning( + '%s does not support SOCKS proxies. Downloading is likely to fail. ' + 'Consider adding --hls-prefer-native to your command.' % self.get_basename()) + + # Since December 2015 ffmpeg supports -http_proxy option (see + # http://git.videolan.org/?p=ffmpeg.git;a=commit;h=b4eb1f29ebddd60c41a2eb39f5af701e38e0d3fd) + # We could switch to the following code if we are able to detect version properly + # args += ['-http_proxy', proxy] + env = os.environ.copy() + compat_setenv('HTTP_PROXY', proxy, env=env) + compat_setenv('http_proxy', proxy, env=env) + + protocol = info_dict.get('protocol') + + if protocol == 'rtmp': + player_url = info_dict.get('player_url') + page_url = info_dict.get('page_url') + app = info_dict.get('app') + play_path = info_dict.get('play_path') + tc_url = info_dict.get('tc_url') + flash_version = info_dict.get('flash_version') + live = info_dict.get('rtmp_live', False) + conn = info_dict.get('rtmp_conn') + if player_url is not None: + args += ['-rtmp_swfverify', player_url] + if page_url is not None: + args += ['-rtmp_pageurl', page_url] + if app is not None: + args += ['-rtmp_app', app] + if play_path is not None: + args += ['-rtmp_playpath', play_path] + if tc_url is not None: + args += ['-rtmp_tcurl', tc_url] + if flash_version is not None: + args += ['-rtmp_flashver', flash_version] + if live: + args += ['-rtmp_live', 'live'] + if isinstance(conn, list): + for entry in conn: + args += ['-rtmp_conn', entry] + elif isinstance(conn, compat_str): + args += ['-rtmp_conn', conn] + + args += ['-i', url, '-c', 'copy'] + + if self.params.get('test', False): + args += ['-fs', compat_str(self._TEST_FILE_SIZE)] + + if protocol in ('m3u8', 'm3u8_native'): + if self.params.get('hls_use_mpegts', False) or tmpfilename == '-': + args += ['-f', 'mpegts'] + else: + args += ['-f', 'mp4'] + if (ffpp.basename == 'ffmpeg' and is_outdated_version(ffpp._versions['ffmpeg'], '3.2', False)) and (not info_dict.get('acodec') or info_dict['acodec'].split('.')[0] in ('aac', 'mp4a')): + args += ['-bsf:a', 'aac_adtstoasc'] + elif protocol == 'rtmp': + args += ['-f', 'flv'] + else: + args += ['-f', EXT_TO_OUT_FORMATS.get(info_dict['ext'], info_dict['ext'])] + + args = [encodeArgument(opt) for opt in args] + args.append(encodeFilename(ffpp._ffmpeg_filename_argument(tmpfilename), True)) + + self._debug_cmd(args) + + proc = subprocess.Popen(args, stdin=subprocess.PIPE, env=env) + try: + retval = proc.wait() + except KeyboardInterrupt: + # subprocces.run would send the SIGKILL signal to ffmpeg and the + # mp4 file couldn't be played, but if we ask ffmpeg to quit it + # produces a file that is playable (this is mostly useful for live + # streams). Note that Windows is not affected and produces playable + # files (see https://github.com/ytdl-org/youtube-dl/issues/8300). + if sys.platform != 'win32': + proc.communicate(b'q') + raise + return retval + + +class AVconvFD(FFmpegFD): + pass + + +_BY_NAME = dict( + (klass.get_basename(), klass) + for name, klass in globals().items() + if name.endswith('FD') and name != 'ExternalFD' +) + + +def list_external_downloaders(): + return sorted(_BY_NAME.keys()) + + +def get_external_downloader(external_downloader): + """ Given the name of the executable, see whether we support the given + downloader . """ + # Drop .exe extension on Windows + bn = os.path.splitext(os.path.basename(external_downloader))[0] + return _BY_NAME[bn] diff --git a/youtube_dl/downloader/f4m.py b/youtube_dl/downloader/f4m.py new file mode 100644 index 000000000..8dd3c2eeb --- /dev/null +++ b/youtube_dl/downloader/f4m.py @@ -0,0 +1,438 @@ +from __future__ import division, unicode_literals + +import io +import itertools +import time + +from .fragment import FragmentFD +from ..compat import ( + compat_b64decode, + compat_etree_fromstring, + compat_urlparse, + compat_urllib_error, + compat_urllib_parse_urlparse, + compat_struct_pack, + compat_struct_unpack, +) +from ..utils import ( + fix_xml_ampersands, + xpath_text, +) + + +class DataTruncatedError(Exception): + pass + + +class FlvReader(io.BytesIO): + """ + Reader for Flv files + The file format is documented in https://www.adobe.com/devnet/f4v.html + """ + + def read_bytes(self, n): + data = self.read(n) + if len(data) < n: + raise DataTruncatedError( + 'FlvReader error: need %d bytes while only %d bytes got' % ( + n, len(data))) + return data + + # Utility functions for reading numbers and strings + def read_unsigned_long_long(self): + return compat_struct_unpack('!Q', self.read_bytes(8))[0] + + def read_unsigned_int(self): + return compat_struct_unpack('!I', self.read_bytes(4))[0] + + def read_unsigned_char(self): + return compat_struct_unpack('!B', self.read_bytes(1))[0] + + def read_string(self): + res = b'' + while True: + char = self.read_bytes(1) + if char == b'\x00': + break + res += char + return res + + def read_box_info(self): + """ + Read a box and return the info as a tuple: (box_size, box_type, box_data) + """ + real_size = size = self.read_unsigned_int() + box_type = self.read_bytes(4) + header_end = 8 + if size == 1: + real_size = self.read_unsigned_long_long() + header_end = 16 + return real_size, box_type, self.read_bytes(real_size - header_end) + + def read_asrt(self): + # version + self.read_unsigned_char() + # flags + self.read_bytes(3) + quality_entry_count = self.read_unsigned_char() + # QualityEntryCount + for i in range(quality_entry_count): + self.read_string() + + segment_run_count = self.read_unsigned_int() + segments = [] + for i in range(segment_run_count): + first_segment = self.read_unsigned_int() + fragments_per_segment = self.read_unsigned_int() + segments.append((first_segment, fragments_per_segment)) + + return { + 'segment_run': segments, + } + + def read_afrt(self): + # version + self.read_unsigned_char() + # flags + self.read_bytes(3) + # time scale + self.read_unsigned_int() + + quality_entry_count = self.read_unsigned_char() + # QualitySegmentUrlModifiers + for i in range(quality_entry_count): + self.read_string() + + fragments_count = self.read_unsigned_int() + fragments = [] + for i in range(fragments_count): + first = self.read_unsigned_int() + first_ts = self.read_unsigned_long_long() + duration = self.read_unsigned_int() + if duration == 0: + discontinuity_indicator = self.read_unsigned_char() + else: + discontinuity_indicator = None + fragments.append({ + 'first': first, + 'ts': first_ts, + 'duration': duration, + 'discontinuity_indicator': discontinuity_indicator, + }) + + return { + 'fragments': fragments, + } + + def read_abst(self): + # version + self.read_unsigned_char() + # flags + self.read_bytes(3) + + self.read_unsigned_int() # BootstrapinfoVersion + # Profile,Live,Update,Reserved + flags = self.read_unsigned_char() + live = flags & 0x20 != 0 + # time scale + self.read_unsigned_int() + # CurrentMediaTime + self.read_unsigned_long_long() + # SmpteTimeCodeOffset + self.read_unsigned_long_long() + + self.read_string() # MovieIdentifier + server_count = self.read_unsigned_char() + # ServerEntryTable + for i in range(server_count): + self.read_string() + quality_count = self.read_unsigned_char() + # QualityEntryTable + for i in range(quality_count): + self.read_string() + # DrmData + self.read_string() + # MetaData + self.read_string() + + segments_count = self.read_unsigned_char() + segments = [] + for i in range(segments_count): + box_size, box_type, box_data = self.read_box_info() + assert box_type == b'asrt' + segment = FlvReader(box_data).read_asrt() + segments.append(segment) + fragments_run_count = self.read_unsigned_char() + fragments = [] + for i in range(fragments_run_count): + box_size, box_type, box_data = self.read_box_info() + assert box_type == b'afrt' + fragments.append(FlvReader(box_data).read_afrt()) + + return { + 'segments': segments, + 'fragments': fragments, + 'live': live, + } + + def read_bootstrap_info(self): + total_size, box_type, box_data = self.read_box_info() + assert box_type == b'abst' + return FlvReader(box_data).read_abst() + + +def read_bootstrap_info(bootstrap_bytes): + return FlvReader(bootstrap_bytes).read_bootstrap_info() + + +def build_fragments_list(boot_info): + """ Return a list of (segment, fragment) for each fragment in the video """ + res = [] + segment_run_table = boot_info['segments'][0] + fragment_run_entry_table = boot_info['fragments'][0]['fragments'] + first_frag_number = fragment_run_entry_table[0]['first'] + fragments_counter = itertools.count(first_frag_number) + for segment, fragments_count in segment_run_table['segment_run']: + # In some live HDS streams (for example Rai), `fragments_count` is + # abnormal and causing out-of-memory errors. It's OK to change the + # number of fragments for live streams as they are updated periodically + if fragments_count == 4294967295 and boot_info['live']: + fragments_count = 2 + for _ in range(fragments_count): + res.append((segment, next(fragments_counter))) + + if boot_info['live']: + res = res[-2:] + + return res + + +def write_unsigned_int(stream, val): + stream.write(compat_struct_pack('!I', val)) + + +def write_unsigned_int_24(stream, val): + stream.write(compat_struct_pack('!I', val)[1:]) + + +def write_flv_header(stream): + """Writes the FLV header to stream""" + # FLV header + stream.write(b'FLV\x01') + stream.write(b'\x05') + stream.write(b'\x00\x00\x00\x09') + stream.write(b'\x00\x00\x00\x00') + + +def write_metadata_tag(stream, metadata): + """Writes optional metadata tag to stream""" + SCRIPT_TAG = b'\x12' + FLV_TAG_HEADER_LEN = 11 + + if metadata: + stream.write(SCRIPT_TAG) + write_unsigned_int_24(stream, len(metadata)) + stream.write(b'\x00\x00\x00\x00\x00\x00\x00') + stream.write(metadata) + write_unsigned_int(stream, FLV_TAG_HEADER_LEN + len(metadata)) + + +def remove_encrypted_media(media): + return list(filter(lambda e: 'drmAdditionalHeaderId' not in e.attrib + and 'drmAdditionalHeaderSetId' not in e.attrib, + media)) + + +def _add_ns(prop, ver=1): + return '{http://ns.adobe.com/f4m/%d.0}%s' % (ver, prop) + + +def get_base_url(manifest): + base_url = xpath_text( + manifest, [_add_ns('baseURL'), _add_ns('baseURL', 2)], + 'base URL', default=None) + if base_url: + base_url = base_url.strip() + return base_url + + +class F4mFD(FragmentFD): + """ + A downloader for f4m manifests or AdobeHDS. + """ + + FD_NAME = 'f4m' + + def _get_unencrypted_media(self, doc): + media = doc.findall(_add_ns('media')) + if not media: + self.report_error('No media found') + for e in (doc.findall(_add_ns('drmAdditionalHeader')) + + doc.findall(_add_ns('drmAdditionalHeaderSet'))): + # If id attribute is missing it's valid for all media nodes + # without drmAdditionalHeaderId or drmAdditionalHeaderSetId attribute + if 'id' not in e.attrib: + self.report_error('Missing ID in f4m DRM') + media = remove_encrypted_media(media) + if not media: + self.report_error('Unsupported DRM') + return media + + def _get_bootstrap_from_url(self, bootstrap_url): + bootstrap = self.ydl.urlopen(bootstrap_url).read() + return read_bootstrap_info(bootstrap) + + def _update_live_fragments(self, bootstrap_url, latest_fragment): + fragments_list = [] + retries = 30 + while (not fragments_list) and (retries > 0): + boot_info = self._get_bootstrap_from_url(bootstrap_url) + fragments_list = build_fragments_list(boot_info) + fragments_list = [f for f in fragments_list if f[1] > latest_fragment] + if not fragments_list: + # Retry after a while + time.sleep(5.0) + retries -= 1 + + if not fragments_list: + self.report_error('Failed to update fragments') + + return fragments_list + + def _parse_bootstrap_node(self, node, base_url): + # Sometimes non empty inline bootstrap info can be specified along + # with bootstrap url attribute (e.g. dummy inline bootstrap info + # contains whitespace characters in [1]). We will prefer bootstrap + # url over inline bootstrap info when present. + # 1. http://live-1-1.rutube.ru/stream/1024/HDS/SD/C2NKsS85HQNckgn5HdEmOQ/1454167650/S-s604419906/move/four/dirs/upper/1024-576p.f4m + bootstrap_url = node.get('url') + if bootstrap_url: + bootstrap_url = compat_urlparse.urljoin( + base_url, bootstrap_url) + boot_info = self._get_bootstrap_from_url(bootstrap_url) + else: + bootstrap_url = None + bootstrap = compat_b64decode(node.text) + boot_info = read_bootstrap_info(bootstrap) + return boot_info, bootstrap_url + + def real_download(self, filename, info_dict): + man_url = info_dict['url'] + requested_bitrate = info_dict.get('tbr') + self.to_screen('[%s] Downloading f4m manifest' % self.FD_NAME) + + urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url)) + man_url = urlh.geturl() + # Some manifests may be malformed, e.g. prosiebensat1 generated manifests + # (see https://github.com/ytdl-org/youtube-dl/issues/6215#issuecomment-121704244 + # and https://github.com/ytdl-org/youtube-dl/issues/7823) + manifest = fix_xml_ampersands(urlh.read().decode('utf-8', 'ignore')).strip() + + doc = compat_etree_fromstring(manifest) + formats = [(int(f.attrib.get('bitrate', -1)), f) + for f in self._get_unencrypted_media(doc)] + if requested_bitrate is None or len(formats) == 1: + # get the best format + formats = sorted(formats, key=lambda f: f[0]) + rate, media = formats[-1] + else: + rate, media = list(filter( + lambda f: int(f[0]) == requested_bitrate, formats))[0] + + # Prefer baseURL for relative URLs as per 11.2 of F4M 3.0 spec. + man_base_url = get_base_url(doc) or man_url + + base_url = compat_urlparse.urljoin(man_base_url, media.attrib['url']) + bootstrap_node = doc.find(_add_ns('bootstrapInfo')) + boot_info, bootstrap_url = self._parse_bootstrap_node( + bootstrap_node, man_base_url) + live = boot_info['live'] + metadata_node = media.find(_add_ns('metadata')) + if metadata_node is not None: + metadata = compat_b64decode(metadata_node.text) + else: + metadata = None + + fragments_list = build_fragments_list(boot_info) + test = self.params.get('test', False) + if test: + # We only download the first fragment + fragments_list = fragments_list[:1] + total_frags = len(fragments_list) + # For some akamai manifests we'll need to add a query to the fragment url + akamai_pv = xpath_text(doc, _add_ns('pv-2.0')) + + ctx = { + 'filename': filename, + 'total_frags': total_frags, + 'live': live, + } + + self._prepare_frag_download(ctx) + + dest_stream = ctx['dest_stream'] + + if ctx['complete_frags_downloaded_bytes'] == 0: + write_flv_header(dest_stream) + if not live: + write_metadata_tag(dest_stream, metadata) + + base_url_parsed = compat_urllib_parse_urlparse(base_url) + + self._start_frag_download(ctx) + + frag_index = 0 + while fragments_list: + seg_i, frag_i = fragments_list.pop(0) + frag_index += 1 + if frag_index <= ctx['fragment_index']: + continue + name = 'Seg%d-Frag%d' % (seg_i, frag_i) + query = [] + if base_url_parsed.query: + query.append(base_url_parsed.query) + if akamai_pv: + query.append(akamai_pv.strip(';')) + if info_dict.get('extra_param_to_segment_url'): + query.append(info_dict['extra_param_to_segment_url']) + url_parsed = base_url_parsed._replace(path=base_url_parsed.path + name, query='&'.join(query)) + try: + success, down_data = self._download_fragment(ctx, url_parsed.geturl(), info_dict) + if not success: + return False + reader = FlvReader(down_data) + while True: + try: + _, box_type, box_data = reader.read_box_info() + except DataTruncatedError: + if test: + # In tests, segments may be truncated, and thus + # FlvReader may not be able to parse the whole + # chunk. If so, write the segment as is + # See https://github.com/ytdl-org/youtube-dl/issues/9214 + dest_stream.write(down_data) + break + raise + if box_type == b'mdat': + self._append_fragment(ctx, box_data) + break + except (compat_urllib_error.HTTPError, ) as err: + if live and (err.code == 404 or err.code == 410): + # We didn't keep up with the live window. Continue + # with the next available fragment. + msg = 'Fragment %d unavailable' % frag_i + self.report_warning(msg) + fragments_list = [] + else: + raise + + if not fragments_list and not test and live and bootstrap_url: + fragments_list = self._update_live_fragments(bootstrap_url, frag_i) + total_frags += len(fragments_list) + if fragments_list and (fragments_list[0][1] > frag_i + 1): + msg = 'Missed %d fragments' % (fragments_list[0][1] - (frag_i + 1)) + self.report_warning(msg) + + self._finish_frag_download(ctx) + + return True diff --git a/youtube_dl/downloader/fragment.py b/youtube_dl/downloader/fragment.py new file mode 100644 index 000000000..9339b3a62 --- /dev/null +++ b/youtube_dl/downloader/fragment.py @@ -0,0 +1,269 @@ +from __future__ import division, unicode_literals + +import os +import time +import json + +from .common import FileDownloader +from .http import HttpFD +from ..utils import ( + error_to_compat_str, + encodeFilename, + sanitize_open, + sanitized_Request, +) + + +class HttpQuietDownloader(HttpFD): + def to_screen(self, *args, **kargs): + pass + + +class FragmentFD(FileDownloader): + """ + A base file downloader class for fragmented media (e.g. f4m/m3u8 manifests). + + Available options: + + fragment_retries: Number of times to retry a fragment for HTTP error (DASH + and hlsnative only) + skip_unavailable_fragments: + Skip unavailable fragments (DASH and hlsnative only) + keep_fragments: Keep downloaded fragments on disk after downloading is + finished + + For each incomplete fragment download youtube-dlc keeps on disk a special + bookkeeping file with download state and metadata (in future such files will + be used for any incomplete download handled by youtube-dlc). This file is + used to properly handle resuming, check download file consistency and detect + potential errors. The file has a .ytdl extension and represents a standard + JSON file of the following format: + + extractor: + Dictionary of extractor related data. TBD. + + downloader: + Dictionary of downloader related data. May contain following data: + current_fragment: + Dictionary with current (being downloaded) fragment data: + index: 0-based index of current fragment among all fragments + fragment_count: + Total count of fragments + + This feature is experimental and file format may change in future. + """ + + def report_retry_fragment(self, err, frag_index, count, retries): + self.to_screen( + '[download] Got server HTTP error: %s. Retrying fragment %d (attempt %d of %s)...' + % (error_to_compat_str(err), frag_index, count, self.format_retries(retries))) + + def report_skip_fragment(self, frag_index): + self.to_screen('[download] Skipping fragment %d...' % frag_index) + + def _prepare_url(self, info_dict, url): + headers = info_dict.get('http_headers') + return sanitized_Request(url, None, headers) if headers else url + + def _prepare_and_start_frag_download(self, ctx): + self._prepare_frag_download(ctx) + self._start_frag_download(ctx) + + @staticmethod + def __do_ytdl_file(ctx): + return not ctx['live'] and not ctx['tmpfilename'] == '-' + + def _read_ytdl_file(self, ctx): + assert 'ytdl_corrupt' not in ctx + stream, _ = sanitize_open(self.ytdl_filename(ctx['filename']), 'r') + try: + ctx['fragment_index'] = json.loads(stream.read())['downloader']['current_fragment']['index'] + except Exception: + ctx['ytdl_corrupt'] = True + finally: + stream.close() + + def _write_ytdl_file(self, ctx): + frag_index_stream, _ = sanitize_open(self.ytdl_filename(ctx['filename']), 'w') + downloader = { + 'current_fragment': { + 'index': ctx['fragment_index'], + }, + } + if ctx.get('fragment_count') is not None: + downloader['fragment_count'] = ctx['fragment_count'] + frag_index_stream.write(json.dumps({'downloader': downloader})) + frag_index_stream.close() + + def _download_fragment(self, ctx, frag_url, info_dict, headers=None): + fragment_filename = '%s-Frag%d' % (ctx['tmpfilename'], ctx['fragment_index']) + success = ctx['dl'].download(fragment_filename, { + 'url': frag_url, + 'http_headers': headers or info_dict.get('http_headers'), + }) + if not success: + return False, None + down, frag_sanitized = sanitize_open(fragment_filename, 'rb') + ctx['fragment_filename_sanitized'] = frag_sanitized + frag_content = down.read() + down.close() + return True, frag_content + + def _append_fragment(self, ctx, frag_content): + try: + ctx['dest_stream'].write(frag_content) + ctx['dest_stream'].flush() + finally: + if self.__do_ytdl_file(ctx): + self._write_ytdl_file(ctx) + if not self.params.get('keep_fragments', False): + os.remove(encodeFilename(ctx['fragment_filename_sanitized'])) + del ctx['fragment_filename_sanitized'] + + def _prepare_frag_download(self, ctx): + if 'live' not in ctx: + ctx['live'] = False + if not ctx['live']: + total_frags_str = '%d' % ctx['total_frags'] + ad_frags = ctx.get('ad_frags', 0) + if ad_frags: + total_frags_str += ' (not including %d ad)' % ad_frags + else: + total_frags_str = 'unknown (live)' + self.to_screen( + '[%s] Total fragments: %s' % (self.FD_NAME, total_frags_str)) + self.report_destination(ctx['filename']) + dl = HttpQuietDownloader( + self.ydl, + { + 'continuedl': True, + 'quiet': True, + 'noprogress': True, + 'ratelimit': self.params.get('ratelimit'), + 'retries': self.params.get('retries', 0), + 'nopart': self.params.get('nopart', False), + 'test': self.params.get('test', False), + } + ) + tmpfilename = self.temp_name(ctx['filename']) + open_mode = 'wb' + resume_len = 0 + + # Establish possible resume length + if os.path.isfile(encodeFilename(tmpfilename)): + open_mode = 'ab' + resume_len = os.path.getsize(encodeFilename(tmpfilename)) + + # Should be initialized before ytdl file check + ctx.update({ + 'tmpfilename': tmpfilename, + 'fragment_index': 0, + }) + + if self.__do_ytdl_file(ctx): + if os.path.isfile(encodeFilename(self.ytdl_filename(ctx['filename']))): + self._read_ytdl_file(ctx) + is_corrupt = ctx.get('ytdl_corrupt') is True + is_inconsistent = ctx['fragment_index'] > 0 and resume_len == 0 + if is_corrupt or is_inconsistent: + message = ( + '.ytdl file is corrupt' if is_corrupt else + 'Inconsistent state of incomplete fragment download') + self.report_warning( + '%s. Restarting from the beginning...' % message) + ctx['fragment_index'] = resume_len = 0 + if 'ytdl_corrupt' in ctx: + del ctx['ytdl_corrupt'] + self._write_ytdl_file(ctx) + else: + self._write_ytdl_file(ctx) + assert ctx['fragment_index'] == 0 + + dest_stream, tmpfilename = sanitize_open(tmpfilename, open_mode) + + ctx.update({ + 'dl': dl, + 'dest_stream': dest_stream, + 'tmpfilename': tmpfilename, + # Total complete fragments downloaded so far in bytes + 'complete_frags_downloaded_bytes': resume_len, + }) + + def _start_frag_download(self, ctx): + resume_len = ctx['complete_frags_downloaded_bytes'] + total_frags = ctx['total_frags'] + # This dict stores the download progress, it's updated by the progress + # hook + state = { + 'status': 'downloading', + 'downloaded_bytes': resume_len, + 'fragment_index': ctx['fragment_index'], + 'fragment_count': total_frags, + 'filename': ctx['filename'], + 'tmpfilename': ctx['tmpfilename'], + } + + start = time.time() + ctx.update({ + 'started': start, + # Amount of fragment's bytes downloaded by the time of the previous + # frag progress hook invocation + 'prev_frag_downloaded_bytes': 0, + }) + + def frag_progress_hook(s): + if s['status'] not in ('downloading', 'finished'): + return + + time_now = time.time() + state['elapsed'] = time_now - start + frag_total_bytes = s.get('total_bytes') or 0 + if not ctx['live']: + estimated_size = ( + (ctx['complete_frags_downloaded_bytes'] + frag_total_bytes) + / (state['fragment_index'] + 1) * total_frags) + state['total_bytes_estimate'] = estimated_size + + if s['status'] == 'finished': + state['fragment_index'] += 1 + ctx['fragment_index'] = state['fragment_index'] + state['downloaded_bytes'] += frag_total_bytes - ctx['prev_frag_downloaded_bytes'] + ctx['complete_frags_downloaded_bytes'] = state['downloaded_bytes'] + ctx['prev_frag_downloaded_bytes'] = 0 + else: + frag_downloaded_bytes = s['downloaded_bytes'] + state['downloaded_bytes'] += frag_downloaded_bytes - ctx['prev_frag_downloaded_bytes'] + if not ctx['live']: + state['eta'] = self.calc_eta( + start, time_now, estimated_size - resume_len, + state['downloaded_bytes'] - resume_len) + state['speed'] = s.get('speed') or ctx.get('speed') + ctx['speed'] = state['speed'] + ctx['prev_frag_downloaded_bytes'] = frag_downloaded_bytes + self._hook_progress(state) + + ctx['dl'].add_progress_hook(frag_progress_hook) + + return start + + def _finish_frag_download(self, ctx): + ctx['dest_stream'].close() + if self.__do_ytdl_file(ctx): + ytdl_filename = encodeFilename(self.ytdl_filename(ctx['filename'])) + if os.path.isfile(ytdl_filename): + os.remove(ytdl_filename) + elapsed = time.time() - ctx['started'] + + if ctx['tmpfilename'] == '-': + downloaded_bytes = ctx['complete_frags_downloaded_bytes'] + else: + self.try_rename(ctx['tmpfilename'], ctx['filename']) + downloaded_bytes = os.path.getsize(encodeFilename(ctx['filename'])) + + self._hook_progress({ + 'downloaded_bytes': downloaded_bytes, + 'total_bytes': downloaded_bytes, + 'filename': ctx['filename'], + 'status': 'finished', + 'elapsed': elapsed, + }) diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py new file mode 100644 index 000000000..84bc34928 --- /dev/null +++ b/youtube_dl/downloader/hls.py @@ -0,0 +1,210 @@ +from __future__ import unicode_literals + +import re +import binascii +try: + from Crypto.Cipher import AES + can_decrypt_frag = True +except ImportError: + can_decrypt_frag = False + +from .fragment import FragmentFD +from .external import FFmpegFD + +from ..compat import ( + compat_urllib_error, + compat_urlparse, + compat_struct_pack, +) +from ..utils import ( + parse_m3u8_attributes, + update_url_query, +) + + +class HlsFD(FragmentFD): + """ A limited implementation that does not require ffmpeg """ + + FD_NAME = 'hlsnative' + + @staticmethod + def can_download(manifest, info_dict): + UNSUPPORTED_FEATURES = ( + r'#EXT-X-KEY:METHOD=(?!NONE|AES-128)', # encrypted streams [1] + # r'#EXT-X-BYTERANGE', # playlists composed of byte ranges of media files [2] + + # Live streams heuristic does not always work (e.g. geo restricted to Germany + # http://hls-geo.daserste.de/i/videoportal/Film/c_620000/622873/format,716451,716457,716450,716458,716459,.mp4.csmil/index_4_av.m3u8?null=0) + # r'#EXT-X-MEDIA-SEQUENCE:(?!0$)', # live streams [3] + + # This heuristic also is not correct since segments may not be appended as well. + # Twitch vods of finished streams have EXT-X-PLAYLIST-TYPE:EVENT despite + # no segments will definitely be appended to the end of the playlist. + # r'#EXT-X-PLAYLIST-TYPE:EVENT', # media segments may be appended to the end of + # # event media playlists [4] + + # 1. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.2.4 + # 2. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.2.2 + # 3. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.3.2 + # 4. https://tools.ietf.org/html/draft-pantos-http-live-streaming-17#section-4.3.3.5 + ) + check_results = [not re.search(feature, manifest) for feature in UNSUPPORTED_FEATURES] + is_aes128_enc = '#EXT-X-KEY:METHOD=AES-128' in manifest + check_results.append(can_decrypt_frag or not is_aes128_enc) + check_results.append(not (is_aes128_enc and r'#EXT-X-BYTERANGE' in manifest)) + check_results.append(not info_dict.get('is_live')) + return all(check_results) + + def real_download(self, filename, info_dict): + man_url = info_dict['url'] + self.to_screen('[%s] Downloading m3u8 manifest' % self.FD_NAME) + + urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url)) + man_url = urlh.geturl() + s = urlh.read().decode('utf-8', 'ignore') + + if not self.can_download(s, info_dict): + if info_dict.get('extra_param_to_segment_url') or info_dict.get('_decryption_key_url'): + self.report_error('pycrypto not found. Please install it.') + return False + self.report_warning( + 'hlsnative has detected features it does not support, ' + 'extraction will be delegated to ffmpeg') + fd = FFmpegFD(self.ydl, self.params) + for ph in self._progress_hooks: + fd.add_progress_hook(ph) + return fd.real_download(filename, info_dict) + + def is_ad_fragment_start(s): + return (s.startswith('#ANVATO-SEGMENT-INFO') and 'type=ad' in s + or s.startswith('#UPLYNK-SEGMENT') and s.endswith(',ad')) + + def is_ad_fragment_end(s): + return (s.startswith('#ANVATO-SEGMENT-INFO') and 'type=master' in s + or s.startswith('#UPLYNK-SEGMENT') and s.endswith(',segment')) + + media_frags = 0 + ad_frags = 0 + ad_frag_next = False + for line in s.splitlines(): + line = line.strip() + if not line: + continue + if line.startswith('#'): + if is_ad_fragment_start(line): + ad_frag_next = True + elif is_ad_fragment_end(line): + ad_frag_next = False + continue + if ad_frag_next: + ad_frags += 1 + continue + media_frags += 1 + + ctx = { + 'filename': filename, + 'total_frags': media_frags, + 'ad_frags': ad_frags, + } + + self._prepare_and_start_frag_download(ctx) + + fragment_retries = self.params.get('fragment_retries', 0) + skip_unavailable_fragments = self.params.get('skip_unavailable_fragments', True) + test = self.params.get('test', False) + + extra_query = None + extra_param_to_segment_url = info_dict.get('extra_param_to_segment_url') + if extra_param_to_segment_url: + extra_query = compat_urlparse.parse_qs(extra_param_to_segment_url) + i = 0 + media_sequence = 0 + decrypt_info = {'METHOD': 'NONE'} + byte_range = {} + frag_index = 0 + ad_frag_next = False + for line in s.splitlines(): + line = line.strip() + if line: + if not line.startswith('#'): + if ad_frag_next: + continue + frag_index += 1 + if frag_index <= ctx['fragment_index']: + continue + frag_url = ( + line + if re.match(r'^https?://', line) + else compat_urlparse.urljoin(man_url, line)) + if extra_query: + frag_url = update_url_query(frag_url, extra_query) + count = 0 + headers = info_dict.get('http_headers', {}) + if byte_range: + headers['Range'] = 'bytes=%d-%d' % (byte_range['start'], byte_range['end']) + while count <= fragment_retries: + try: + success, frag_content = self._download_fragment( + ctx, frag_url, info_dict, headers) + if not success: + return False + break + except compat_urllib_error.HTTPError as err: + # Unavailable (possibly temporary) fragments may be served. + # First we try to retry then either skip or abort. + # See https://github.com/ytdl-org/youtube-dl/issues/10165, + # https://github.com/ytdl-org/youtube-dl/issues/10448). + count += 1 + if count <= fragment_retries: + self.report_retry_fragment(err, frag_index, count, fragment_retries) + if count > fragment_retries: + if skip_unavailable_fragments: + i += 1 + media_sequence += 1 + self.report_skip_fragment(frag_index) + continue + self.report_error( + 'giving up after %s fragment retries' % fragment_retries) + return False + if decrypt_info['METHOD'] == 'AES-128': + iv = decrypt_info.get('IV') or compat_struct_pack('>8xq', media_sequence) + decrypt_info['KEY'] = decrypt_info.get('KEY') or self.ydl.urlopen( + self._prepare_url(info_dict, info_dict.get('_decryption_key_url') or decrypt_info['URI'])).read() + frag_content = AES.new( + decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(frag_content) + self._append_fragment(ctx, frag_content) + # We only download the first fragment during the test + if test: + break + i += 1 + media_sequence += 1 + elif line.startswith('#EXT-X-KEY'): + decrypt_url = decrypt_info.get('URI') + decrypt_info = parse_m3u8_attributes(line[11:]) + if decrypt_info['METHOD'] == 'AES-128': + if 'IV' in decrypt_info: + decrypt_info['IV'] = binascii.unhexlify(decrypt_info['IV'][2:].zfill(32)) + if not re.match(r'^https?://', decrypt_info['URI']): + decrypt_info['URI'] = compat_urlparse.urljoin( + man_url, decrypt_info['URI']) + if extra_query: + decrypt_info['URI'] = update_url_query(decrypt_info['URI'], extra_query) + if decrypt_url != decrypt_info['URI']: + decrypt_info['KEY'] = None + elif line.startswith('#EXT-X-MEDIA-SEQUENCE'): + media_sequence = int(line[22:]) + elif line.startswith('#EXT-X-BYTERANGE'): + splitted_byte_range = line[17:].split('@') + sub_range_start = int(splitted_byte_range[1]) if len(splitted_byte_range) == 2 else byte_range['end'] + byte_range = { + 'start': sub_range_start, + 'end': sub_range_start + int(splitted_byte_range[0]), + } + elif is_ad_fragment_start(line): + ad_frag_next = True + elif is_ad_fragment_end(line): + ad_frag_next = False + + self._finish_frag_download(ctx) + + return True diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py new file mode 100644 index 000000000..5046878df --- /dev/null +++ b/youtube_dl/downloader/http.py @@ -0,0 +1,354 @@ +from __future__ import unicode_literals + +import errno +import os +import socket +import time +import random +import re + +from .common import FileDownloader +from ..compat import ( + compat_str, + compat_urllib_error, +) +from ..utils import ( + ContentTooShortError, + encodeFilename, + int_or_none, + sanitize_open, + sanitized_Request, + write_xattr, + XAttrMetadataError, + XAttrUnavailableError, +) + + +class HttpFD(FileDownloader): + def real_download(self, filename, info_dict): + url = info_dict['url'] + + class DownloadContext(dict): + __getattr__ = dict.get + __setattr__ = dict.__setitem__ + __delattr__ = dict.__delitem__ + + ctx = DownloadContext() + ctx.filename = filename + ctx.tmpfilename = self.temp_name(filename) + ctx.stream = None + + # Do not include the Accept-Encoding header + headers = {'Youtubedl-no-compression': 'True'} + add_headers = info_dict.get('http_headers') + if add_headers: + headers.update(add_headers) + + is_test = self.params.get('test', False) + chunk_size = self._TEST_FILE_SIZE if is_test else ( + info_dict.get('downloader_options', {}).get('http_chunk_size') + or self.params.get('http_chunk_size') or 0) + + ctx.open_mode = 'wb' + ctx.resume_len = 0 + ctx.data_len = None + ctx.block_size = self.params.get('buffersize', 1024) + ctx.start_time = time.time() + ctx.chunk_size = None + + if self.params.get('continuedl', True): + # Establish possible resume length + if os.path.isfile(encodeFilename(ctx.tmpfilename)): + ctx.resume_len = os.path.getsize( + encodeFilename(ctx.tmpfilename)) + + ctx.is_resume = ctx.resume_len > 0 + + count = 0 + retries = self.params.get('retries', 0) + + class SucceedDownload(Exception): + pass + + class RetryDownload(Exception): + def __init__(self, source_error): + self.source_error = source_error + + class NextFragment(Exception): + pass + + def set_range(req, start, end): + range_header = 'bytes=%d-' % start + if end: + range_header += compat_str(end) + req.add_header('Range', range_header) + + def establish_connection(): + ctx.chunk_size = (random.randint(int(chunk_size * 0.95), chunk_size) + if not is_test and chunk_size else chunk_size) + if ctx.resume_len > 0: + range_start = ctx.resume_len + if ctx.is_resume: + self.report_resuming_byte(ctx.resume_len) + ctx.open_mode = 'ab' + elif ctx.chunk_size > 0: + range_start = 0 + else: + range_start = None + ctx.is_resume = False + range_end = range_start + ctx.chunk_size - 1 if ctx.chunk_size else None + if range_end and ctx.data_len is not None and range_end >= ctx.data_len: + range_end = ctx.data_len - 1 + has_range = range_start is not None + ctx.has_range = has_range + request = sanitized_Request(url, None, headers) + if has_range: + set_range(request, range_start, range_end) + # Establish connection + try: + ctx.data = self.ydl.urlopen(request) + # When trying to resume, Content-Range HTTP header of response has to be checked + # to match the value of requested Range HTTP header. This is due to a webservers + # that don't support resuming and serve a whole file with no Content-Range + # set in response despite of requested Range (see + # https://github.com/ytdl-org/youtube-dl/issues/6057#issuecomment-126129799) + if has_range: + content_range = ctx.data.headers.get('Content-Range') + if content_range: + content_range_m = re.search(r'bytes (\d+)-(\d+)?(?:/(\d+))?', content_range) + # Content-Range is present and matches requested Range, resume is possible + if content_range_m: + if range_start == int(content_range_m.group(1)): + content_range_end = int_or_none(content_range_m.group(2)) + content_len = int_or_none(content_range_m.group(3)) + accept_content_len = ( + # Non-chunked download + not ctx.chunk_size + # Chunked download and requested piece or + # its part is promised to be served + or content_range_end == range_end + or content_len < range_end) + if accept_content_len: + ctx.data_len = content_len + return + # Content-Range is either not present or invalid. Assuming remote webserver is + # trying to send the whole file, resume is not possible, so wiping the local file + # and performing entire redownload + self.report_unable_to_resume() + ctx.resume_len = 0 + ctx.open_mode = 'wb' + ctx.data_len = int_or_none(ctx.data.info().get('Content-length', None)) + return + except (compat_urllib_error.HTTPError, ) as err: + if err.code == 416: + # Unable to resume (requested range not satisfiable) + try: + # Open the connection again without the range header + ctx.data = self.ydl.urlopen( + sanitized_Request(url, None, headers)) + content_length = ctx.data.info()['Content-Length'] + except (compat_urllib_error.HTTPError, ) as err: + if err.code < 500 or err.code >= 600: + raise + else: + # Examine the reported length + if (content_length is not None + and (ctx.resume_len - 100 < int(content_length) < ctx.resume_len + 100)): + # The file had already been fully downloaded. + # Explanation to the above condition: in issue #175 it was revealed that + # YouTube sometimes adds or removes a few bytes from the end of the file, + # changing the file size slightly and causing problems for some users. So + # I decided to implement a suggested change and consider the file + # completely downloaded if the file size differs less than 100 bytes from + # the one in the hard drive. + self.report_file_already_downloaded(ctx.filename) + self.try_rename(ctx.tmpfilename, ctx.filename) + self._hook_progress({ + 'filename': ctx.filename, + 'status': 'finished', + 'downloaded_bytes': ctx.resume_len, + 'total_bytes': ctx.resume_len, + }) + raise SucceedDownload() + else: + # The length does not match, we start the download over + self.report_unable_to_resume() + ctx.resume_len = 0 + ctx.open_mode = 'wb' + return + elif err.code < 500 or err.code >= 600: + # Unexpected HTTP error + raise + raise RetryDownload(err) + except socket.error as err: + if err.errno != errno.ECONNRESET: + # Connection reset is no problem, just retry + raise + raise RetryDownload(err) + + def download(): + data_len = ctx.data.info().get('Content-length', None) + + # Range HTTP header may be ignored/unsupported by a webserver + # (e.g. extractor/scivee.py, extractor/bambuser.py). + # However, for a test we still would like to download just a piece of a file. + # To achieve this we limit data_len to _TEST_FILE_SIZE and manually control + # block size when downloading a file. + if is_test and (data_len is None or int(data_len) > self._TEST_FILE_SIZE): + data_len = self._TEST_FILE_SIZE + + if data_len is not None: + data_len = int(data_len) + ctx.resume_len + min_data_len = self.params.get('min_filesize') + max_data_len = self.params.get('max_filesize') + if min_data_len is not None and data_len < min_data_len: + self.to_screen('\r[download] File is smaller than min-filesize (%s bytes < %s bytes). Aborting.' % (data_len, min_data_len)) + return False + if max_data_len is not None and data_len > max_data_len: + self.to_screen('\r[download] File is larger than max-filesize (%s bytes > %s bytes). Aborting.' % (data_len, max_data_len)) + return False + + byte_counter = 0 + ctx.resume_len + block_size = ctx.block_size + start = time.time() + + # measure time over whole while-loop, so slow_down() and best_block_size() work together properly + now = None # needed for slow_down() in the first loop run + before = start # start measuring + + def retry(e): + to_stdout = ctx.tmpfilename == '-' + if not to_stdout: + ctx.stream.close() + ctx.stream = None + ctx.resume_len = byte_counter if to_stdout else os.path.getsize(encodeFilename(ctx.tmpfilename)) + raise RetryDownload(e) + + while True: + try: + # Download and write + data_block = ctx.data.read(block_size if data_len is None else min(block_size, data_len - byte_counter)) + # socket.timeout is a subclass of socket.error but may not have + # errno set + except socket.timeout as e: + retry(e) + except socket.error as e: + if e.errno not in (errno.ECONNRESET, errno.ETIMEDOUT): + raise + retry(e) + + byte_counter += len(data_block) + + # exit loop when download is finished + if len(data_block) == 0: + break + + # Open destination file just in time + if ctx.stream is None: + try: + ctx.stream, ctx.tmpfilename = sanitize_open( + ctx.tmpfilename, ctx.open_mode) + assert ctx.stream is not None + ctx.filename = self.undo_temp_name(ctx.tmpfilename) + self.report_destination(ctx.filename) + except (OSError, IOError) as err: + self.report_error('unable to open for writing: %s' % str(err)) + return False + + if self.params.get('xattr_set_filesize', False) and data_len is not None: + try: + write_xattr(ctx.tmpfilename, 'user.ytdl.filesize', str(data_len).encode('utf-8')) + except (XAttrUnavailableError, XAttrMetadataError) as err: + self.report_error('unable to set filesize xattr: %s' % str(err)) + + try: + ctx.stream.write(data_block) + except (IOError, OSError) as err: + self.to_stderr('\n') + self.report_error('unable to write data: %s' % str(err)) + return False + + # Apply rate limit + self.slow_down(start, now, byte_counter - ctx.resume_len) + + # end measuring of one loop run + now = time.time() + after = now + + # Adjust block size + if not self.params.get('noresizebuffer', False): + block_size = self.best_block_size(after - before, len(data_block)) + + before = after + + # Progress message + speed = self.calc_speed(start, now, byte_counter - ctx.resume_len) + if ctx.data_len is None: + eta = None + else: + eta = self.calc_eta(start, time.time(), ctx.data_len - ctx.resume_len, byte_counter - ctx.resume_len) + + self._hook_progress({ + 'status': 'downloading', + 'downloaded_bytes': byte_counter, + 'total_bytes': ctx.data_len, + 'tmpfilename': ctx.tmpfilename, + 'filename': ctx.filename, + 'eta': eta, + 'speed': speed, + 'elapsed': now - ctx.start_time, + }) + + if data_len is not None and byte_counter == data_len: + break + + if not is_test and ctx.chunk_size and ctx.data_len is not None and byte_counter < ctx.data_len: + ctx.resume_len = byte_counter + # ctx.block_size = block_size + raise NextFragment() + + if ctx.stream is None: + self.to_stderr('\n') + self.report_error('Did not get any data blocks') + return False + if ctx.tmpfilename != '-': + ctx.stream.close() + + if data_len is not None and byte_counter != data_len: + err = ContentTooShortError(byte_counter, int(data_len)) + if count <= retries: + retry(err) + raise err + + self.try_rename(ctx.tmpfilename, ctx.filename) + + # Update file modification time + if self.params.get('updatetime', True): + info_dict['filetime'] = self.try_utime(ctx.filename, ctx.data.info().get('last-modified', None)) + + self._hook_progress({ + 'downloaded_bytes': byte_counter, + 'total_bytes': byte_counter, + 'filename': ctx.filename, + 'status': 'finished', + 'elapsed': time.time() - ctx.start_time, + }) + + return True + + while count <= retries: + try: + establish_connection() + return download() + except RetryDownload as e: + count += 1 + if count <= retries: + self.report_retry(e.source_error, count, retries) + continue + except NextFragment: + continue + except SucceedDownload: + return True + + self.report_error('giving up after %s retries' % retries) + return False diff --git a/youtube_dl/downloader/ism.py b/youtube_dl/downloader/ism.py new file mode 100644 index 000000000..1ca666b4a --- /dev/null +++ b/youtube_dl/downloader/ism.py @@ -0,0 +1,259 @@ +from __future__ import unicode_literals + +import time +import binascii +import io + +from .fragment import FragmentFD +from ..compat import ( + compat_Struct, + compat_urllib_error, +) + + +u8 = compat_Struct('>B') +u88 = compat_Struct('>Bx') +u16 = compat_Struct('>H') +u1616 = compat_Struct('>Hxx') +u32 = compat_Struct('>I') +u64 = compat_Struct('>Q') + +s88 = compat_Struct('>bx') +s16 = compat_Struct('>h') +s1616 = compat_Struct('>hxx') +s32 = compat_Struct('>i') + +unity_matrix = (s32.pack(0x10000) + s32.pack(0) * 3) * 2 + s32.pack(0x40000000) + +TRACK_ENABLED = 0x1 +TRACK_IN_MOVIE = 0x2 +TRACK_IN_PREVIEW = 0x4 + +SELF_CONTAINED = 0x1 + + +def box(box_type, payload): + return u32.pack(8 + len(payload)) + box_type + payload + + +def full_box(box_type, version, flags, payload): + return box(box_type, u8.pack(version) + u32.pack(flags)[1:] + payload) + + +def write_piff_header(stream, params): + track_id = params['track_id'] + fourcc = params['fourcc'] + duration = params['duration'] + timescale = params.get('timescale', 10000000) + language = params.get('language', 'und') + height = params.get('height', 0) + width = params.get('width', 0) + is_audio = width == 0 and height == 0 + creation_time = modification_time = int(time.time()) + + ftyp_payload = b'isml' # major brand + ftyp_payload += u32.pack(1) # minor version + ftyp_payload += b'piff' + b'iso2' # compatible brands + stream.write(box(b'ftyp', ftyp_payload)) # File Type Box + + mvhd_payload = u64.pack(creation_time) + mvhd_payload += u64.pack(modification_time) + mvhd_payload += u32.pack(timescale) + mvhd_payload += u64.pack(duration) + mvhd_payload += s1616.pack(1) # rate + mvhd_payload += s88.pack(1) # volume + mvhd_payload += u16.pack(0) # reserved + mvhd_payload += u32.pack(0) * 2 # reserved + mvhd_payload += unity_matrix + mvhd_payload += u32.pack(0) * 6 # pre defined + mvhd_payload += u32.pack(0xffffffff) # next track id + moov_payload = full_box(b'mvhd', 1, 0, mvhd_payload) # Movie Header Box + + tkhd_payload = u64.pack(creation_time) + tkhd_payload += u64.pack(modification_time) + tkhd_payload += u32.pack(track_id) # track id + tkhd_payload += u32.pack(0) # reserved + tkhd_payload += u64.pack(duration) + tkhd_payload += u32.pack(0) * 2 # reserved + tkhd_payload += s16.pack(0) # layer + tkhd_payload += s16.pack(0) # alternate group + tkhd_payload += s88.pack(1 if is_audio else 0) # volume + tkhd_payload += u16.pack(0) # reserved + tkhd_payload += unity_matrix + tkhd_payload += u1616.pack(width) + tkhd_payload += u1616.pack(height) + trak_payload = full_box(b'tkhd', 1, TRACK_ENABLED | TRACK_IN_MOVIE | TRACK_IN_PREVIEW, tkhd_payload) # Track Header Box + + mdhd_payload = u64.pack(creation_time) + mdhd_payload += u64.pack(modification_time) + mdhd_payload += u32.pack(timescale) + mdhd_payload += u64.pack(duration) + mdhd_payload += u16.pack(((ord(language[0]) - 0x60) << 10) | ((ord(language[1]) - 0x60) << 5) | (ord(language[2]) - 0x60)) + mdhd_payload += u16.pack(0) # pre defined + mdia_payload = full_box(b'mdhd', 1, 0, mdhd_payload) # Media Header Box + + hdlr_payload = u32.pack(0) # pre defined + hdlr_payload += b'soun' if is_audio else b'vide' # handler type + hdlr_payload += u32.pack(0) * 3 # reserved + hdlr_payload += (b'Sound' if is_audio else b'Video') + b'Handler\0' # name + mdia_payload += full_box(b'hdlr', 0, 0, hdlr_payload) # Handler Reference Box + + if is_audio: + smhd_payload = s88.pack(0) # balance + smhd_payload += u16.pack(0) # reserved + media_header_box = full_box(b'smhd', 0, 0, smhd_payload) # Sound Media Header + else: + vmhd_payload = u16.pack(0) # graphics mode + vmhd_payload += u16.pack(0) * 3 # opcolor + media_header_box = full_box(b'vmhd', 0, 1, vmhd_payload) # Video Media Header + minf_payload = media_header_box + + dref_payload = u32.pack(1) # entry count + dref_payload += full_box(b'url ', 0, SELF_CONTAINED, b'') # Data Entry URL Box + dinf_payload = full_box(b'dref', 0, 0, dref_payload) # Data Reference Box + minf_payload += box(b'dinf', dinf_payload) # Data Information Box + + stsd_payload = u32.pack(1) # entry count + + sample_entry_payload = u8.pack(0) * 6 # reserved + sample_entry_payload += u16.pack(1) # data reference index + if is_audio: + sample_entry_payload += u32.pack(0) * 2 # reserved + sample_entry_payload += u16.pack(params.get('channels', 2)) + sample_entry_payload += u16.pack(params.get('bits_per_sample', 16)) + sample_entry_payload += u16.pack(0) # pre defined + sample_entry_payload += u16.pack(0) # reserved + sample_entry_payload += u1616.pack(params['sampling_rate']) + + if fourcc == 'AACL': + sample_entry_box = box(b'mp4a', sample_entry_payload) + else: + sample_entry_payload += u16.pack(0) # pre defined + sample_entry_payload += u16.pack(0) # reserved + sample_entry_payload += u32.pack(0) * 3 # pre defined + sample_entry_payload += u16.pack(width) + sample_entry_payload += u16.pack(height) + sample_entry_payload += u1616.pack(0x48) # horiz resolution 72 dpi + sample_entry_payload += u1616.pack(0x48) # vert resolution 72 dpi + sample_entry_payload += u32.pack(0) # reserved + sample_entry_payload += u16.pack(1) # frame count + sample_entry_payload += u8.pack(0) * 32 # compressor name + sample_entry_payload += u16.pack(0x18) # depth + sample_entry_payload += s16.pack(-1) # pre defined + + codec_private_data = binascii.unhexlify(params['codec_private_data'].encode('utf-8')) + if fourcc in ('H264', 'AVC1'): + sps, pps = codec_private_data.split(u32.pack(1))[1:] + avcc_payload = u8.pack(1) # configuration version + avcc_payload += sps[1:4] # avc profile indication + profile compatibility + avc level indication + avcc_payload += u8.pack(0xfc | (params.get('nal_unit_length_field', 4) - 1)) # complete representation (1) + reserved (11111) + length size minus one + avcc_payload += u8.pack(1) # reserved (0) + number of sps (0000001) + avcc_payload += u16.pack(len(sps)) + avcc_payload += sps + avcc_payload += u8.pack(1) # number of pps + avcc_payload += u16.pack(len(pps)) + avcc_payload += pps + sample_entry_payload += box(b'avcC', avcc_payload) # AVC Decoder Configuration Record + sample_entry_box = box(b'avc1', sample_entry_payload) # AVC Simple Entry + stsd_payload += sample_entry_box + + stbl_payload = full_box(b'stsd', 0, 0, stsd_payload) # Sample Description Box + + stts_payload = u32.pack(0) # entry count + stbl_payload += full_box(b'stts', 0, 0, stts_payload) # Decoding Time to Sample Box + + stsc_payload = u32.pack(0) # entry count + stbl_payload += full_box(b'stsc', 0, 0, stsc_payload) # Sample To Chunk Box + + stco_payload = u32.pack(0) # entry count + stbl_payload += full_box(b'stco', 0, 0, stco_payload) # Chunk Offset Box + + minf_payload += box(b'stbl', stbl_payload) # Sample Table Box + + mdia_payload += box(b'minf', minf_payload) # Media Information Box + + trak_payload += box(b'mdia', mdia_payload) # Media Box + + moov_payload += box(b'trak', trak_payload) # Track Box + + mehd_payload = u64.pack(duration) + mvex_payload = full_box(b'mehd', 1, 0, mehd_payload) # Movie Extends Header Box + + trex_payload = u32.pack(track_id) # track id + trex_payload += u32.pack(1) # default sample description index + trex_payload += u32.pack(0) # default sample duration + trex_payload += u32.pack(0) # default sample size + trex_payload += u32.pack(0) # default sample flags + mvex_payload += full_box(b'trex', 0, 0, trex_payload) # Track Extends Box + + moov_payload += box(b'mvex', mvex_payload) # Movie Extends Box + stream.write(box(b'moov', moov_payload)) # Movie Box + + +def extract_box_data(data, box_sequence): + data_reader = io.BytesIO(data) + while True: + box_size = u32.unpack(data_reader.read(4))[0] + box_type = data_reader.read(4) + if box_type == box_sequence[0]: + box_data = data_reader.read(box_size - 8) + if len(box_sequence) == 1: + return box_data + return extract_box_data(box_data, box_sequence[1:]) + data_reader.seek(box_size - 8, 1) + + +class IsmFD(FragmentFD): + """ + Download segments in a ISM manifest + """ + + FD_NAME = 'ism' + + def real_download(self, filename, info_dict): + segments = info_dict['fragments'][:1] if self.params.get( + 'test', False) else info_dict['fragments'] + + ctx = { + 'filename': filename, + 'total_frags': len(segments), + } + + self._prepare_and_start_frag_download(ctx) + + fragment_retries = self.params.get('fragment_retries', 0) + skip_unavailable_fragments = self.params.get('skip_unavailable_fragments', True) + + track_written = False + frag_index = 0 + for i, segment in enumerate(segments): + frag_index += 1 + if frag_index <= ctx['fragment_index']: + continue + count = 0 + while count <= fragment_retries: + try: + success, frag_content = self._download_fragment(ctx, segment['url'], info_dict) + if not success: + return False + if not track_written: + tfhd_data = extract_box_data(frag_content, [b'moof', b'traf', b'tfhd']) + info_dict['_download_params']['track_id'] = u32.unpack(tfhd_data[4:8])[0] + write_piff_header(ctx['dest_stream'], info_dict['_download_params']) + track_written = True + self._append_fragment(ctx, frag_content) + break + except compat_urllib_error.HTTPError as err: + count += 1 + if count <= fragment_retries: + self.report_retry_fragment(err, frag_index, count, fragment_retries) + if count > fragment_retries: + if skip_unavailable_fragments: + self.report_skip_fragment(frag_index) + continue + self.report_error('giving up after %s fragment retries' % fragment_retries) + return False + + self._finish_frag_download(ctx) + + return True diff --git a/youtube_dl/downloader/rtmp.py b/youtube_dl/downloader/rtmp.py new file mode 100644 index 000000000..fbb7f51b0 --- /dev/null +++ b/youtube_dl/downloader/rtmp.py @@ -0,0 +1,214 @@ +from __future__ import unicode_literals + +import os +import re +import subprocess +import time + +from .common import FileDownloader +from ..compat import compat_str +from ..utils import ( + check_executable, + encodeFilename, + encodeArgument, + get_exe_version, +) + + +def rtmpdump_version(): + return get_exe_version( + 'rtmpdump', ['--help'], r'(?i)RTMPDump\s*v?([0-9a-zA-Z._-]+)') + + +class RtmpFD(FileDownloader): + def real_download(self, filename, info_dict): + def run_rtmpdump(args): + start = time.time() + resume_percent = None + resume_downloaded_data_len = None + proc = subprocess.Popen(args, stderr=subprocess.PIPE) + cursor_in_new_line = True + proc_stderr_closed = False + try: + while not proc_stderr_closed: + # read line from stderr + line = '' + while True: + char = proc.stderr.read(1) + if not char: + proc_stderr_closed = True + break + if char in [b'\r', b'\n']: + break + line += char.decode('ascii', 'replace') + if not line: + # proc_stderr_closed is True + continue + mobj = re.search(r'([0-9]+\.[0-9]{3}) kB / [0-9]+\.[0-9]{2} sec \(([0-9]{1,2}\.[0-9])%\)', line) + if mobj: + downloaded_data_len = int(float(mobj.group(1)) * 1024) + percent = float(mobj.group(2)) + if not resume_percent: + resume_percent = percent + resume_downloaded_data_len = downloaded_data_len + time_now = time.time() + eta = self.calc_eta(start, time_now, 100 - resume_percent, percent - resume_percent) + speed = self.calc_speed(start, time_now, downloaded_data_len - resume_downloaded_data_len) + data_len = None + if percent > 0: + data_len = int(downloaded_data_len * 100 / percent) + self._hook_progress({ + 'status': 'downloading', + 'downloaded_bytes': downloaded_data_len, + 'total_bytes_estimate': data_len, + 'tmpfilename': tmpfilename, + 'filename': filename, + 'eta': eta, + 'elapsed': time_now - start, + 'speed': speed, + }) + cursor_in_new_line = False + else: + # no percent for live streams + mobj = re.search(r'([0-9]+\.[0-9]{3}) kB / [0-9]+\.[0-9]{2} sec', line) + if mobj: + downloaded_data_len = int(float(mobj.group(1)) * 1024) + time_now = time.time() + speed = self.calc_speed(start, time_now, downloaded_data_len) + self._hook_progress({ + 'downloaded_bytes': downloaded_data_len, + 'tmpfilename': tmpfilename, + 'filename': filename, + 'status': 'downloading', + 'elapsed': time_now - start, + 'speed': speed, + }) + cursor_in_new_line = False + elif self.params.get('verbose', False): + if not cursor_in_new_line: + self.to_screen('') + cursor_in_new_line = True + self.to_screen('[rtmpdump] ' + line) + finally: + proc.wait() + if not cursor_in_new_line: + self.to_screen('') + return proc.returncode + + url = info_dict['url'] + player_url = info_dict.get('player_url') + page_url = info_dict.get('page_url') + app = info_dict.get('app') + play_path = info_dict.get('play_path') + tc_url = info_dict.get('tc_url') + flash_version = info_dict.get('flash_version') + live = info_dict.get('rtmp_live', False) + conn = info_dict.get('rtmp_conn') + protocol = info_dict.get('rtmp_protocol') + real_time = info_dict.get('rtmp_real_time', False) + no_resume = info_dict.get('no_resume', False) + continue_dl = self.params.get('continuedl', True) + + self.report_destination(filename) + tmpfilename = self.temp_name(filename) + test = self.params.get('test', False) + + # Check for rtmpdump first + if not check_executable('rtmpdump', ['-h']): + self.report_error('RTMP download detected but "rtmpdump" could not be run. Please install it.') + return False + + # Download using rtmpdump. rtmpdump returns exit code 2 when + # the connection was interrupted and resuming appears to be + # possible. This is part of rtmpdump's normal usage, AFAIK. + basic_args = [ + 'rtmpdump', '--verbose', '-r', url, + '-o', tmpfilename] + if player_url is not None: + basic_args += ['--swfVfy', player_url] + if page_url is not None: + basic_args += ['--pageUrl', page_url] + if app is not None: + basic_args += ['--app', app] + if play_path is not None: + basic_args += ['--playpath', play_path] + if tc_url is not None: + basic_args += ['--tcUrl', tc_url] + if test: + basic_args += ['--stop', '1'] + if flash_version is not None: + basic_args += ['--flashVer', flash_version] + if live: + basic_args += ['--live'] + if isinstance(conn, list): + for entry in conn: + basic_args += ['--conn', entry] + elif isinstance(conn, compat_str): + basic_args += ['--conn', conn] + if protocol is not None: + basic_args += ['--protocol', protocol] + if real_time: + basic_args += ['--realtime'] + + args = basic_args + if not no_resume and continue_dl and not live: + args += ['--resume'] + if not live and continue_dl: + args += ['--skip', '1'] + + args = [encodeArgument(a) for a in args] + + self._debug_cmd(args, exe='rtmpdump') + + RD_SUCCESS = 0 + RD_FAILED = 1 + RD_INCOMPLETE = 2 + RD_NO_CONNECT = 3 + + started = time.time() + + try: + retval = run_rtmpdump(args) + except KeyboardInterrupt: + if not info_dict.get('is_live'): + raise + retval = RD_SUCCESS + self.to_screen('\n[rtmpdump] Interrupted by user') + + if retval == RD_NO_CONNECT: + self.report_error('[rtmpdump] Could not connect to RTMP server.') + return False + + while retval in (RD_INCOMPLETE, RD_FAILED) and not test and not live: + prevsize = os.path.getsize(encodeFilename(tmpfilename)) + self.to_screen('[rtmpdump] Downloaded %s bytes' % prevsize) + time.sleep(5.0) # This seems to be needed + args = basic_args + ['--resume'] + if retval == RD_FAILED: + args += ['--skip', '1'] + args = [encodeArgument(a) for a in args] + retval = run_rtmpdump(args) + cursize = os.path.getsize(encodeFilename(tmpfilename)) + if prevsize == cursize and retval == RD_FAILED: + break + # Some rtmp streams seem abort after ~ 99.8%. Don't complain for those + if prevsize == cursize and retval == RD_INCOMPLETE and cursize > 1024: + self.to_screen('[rtmpdump] Could not download the whole video. This can happen for some advertisements.') + retval = RD_SUCCESS + break + if retval == RD_SUCCESS or (test and retval == RD_INCOMPLETE): + fsize = os.path.getsize(encodeFilename(tmpfilename)) + self.to_screen('[rtmpdump] Downloaded %s bytes' % fsize) + self.try_rename(tmpfilename, filename) + self._hook_progress({ + 'downloaded_bytes': fsize, + 'total_bytes': fsize, + 'filename': filename, + 'status': 'finished', + 'elapsed': time.time() - started, + }) + return True + else: + self.to_stderr('\n') + self.report_error('rtmpdump exited with code %d' % retval) + return False diff --git a/youtube_dl/downloader/rtsp.py b/youtube_dl/downloader/rtsp.py new file mode 100644 index 000000000..939358b2a --- /dev/null +++ b/youtube_dl/downloader/rtsp.py @@ -0,0 +1,47 @@ +from __future__ import unicode_literals + +import os +import subprocess + +from .common import FileDownloader +from ..utils import ( + check_executable, + encodeFilename, +) + + +class RtspFD(FileDownloader): + def real_download(self, filename, info_dict): + url = info_dict['url'] + self.report_destination(filename) + tmpfilename = self.temp_name(filename) + + if check_executable('mplayer', ['-h']): + args = [ + 'mplayer', '-really-quiet', '-vo', 'null', '-vc', 'dummy', + '-dumpstream', '-dumpfile', tmpfilename, url] + elif check_executable('mpv', ['-h']): + args = [ + 'mpv', '-really-quiet', '--vo=null', '--stream-dump=' + tmpfilename, url] + else: + self.report_error('MMS or RTSP download detected but neither "mplayer" nor "mpv" could be run. Please install any.') + return False + + self._debug_cmd(args) + + retval = subprocess.call(args) + if retval == 0: + fsize = os.path.getsize(encodeFilename(tmpfilename)) + self.to_screen('\r[%s] %s bytes' % (args[0], fsize)) + self.try_rename(tmpfilename, filename) + self._hook_progress({ + 'downloaded_bytes': fsize, + 'total_bytes': fsize, + 'filename': filename, + 'status': 'finished', + }) + return True + else: + self.to_stderr('\n') + self.report_error('%s exited with code %d' % (args[0], retval)) + return False diff --git a/youtube_dl/downloader/youtube_live_chat.py b/youtube_dl/downloader/youtube_live_chat.py new file mode 100644 index 000000000..4932dd9c5 --- /dev/null +++ b/youtube_dl/downloader/youtube_live_chat.py @@ -0,0 +1,94 @@ +from __future__ import division, unicode_literals + +import re +import json + +from .fragment import FragmentFD + + +class YoutubeLiveChatReplayFD(FragmentFD): + """ Downloads YouTube live chat replays fragment by fragment """ + + FD_NAME = 'youtube_live_chat_replay' + + def real_download(self, filename, info_dict): + video_id = info_dict['video_id'] + self.to_screen('[%s] Downloading live chat' % self.FD_NAME) + + test = self.params.get('test', False) + + ctx = { + 'filename': filename, + 'live': True, + 'total_frags': None, + } + + def dl_fragment(url): + headers = info_dict.get('http_headers', {}) + return self._download_fragment(ctx, url, info_dict, headers) + + def parse_yt_initial_data(data): + window_patt = b'window\\["ytInitialData"\\]\\s*=\\s*(.*?)(?<=});' + var_patt = b'var\\s+ytInitialData\\s*=\\s*(.*?)(?<=});' + for patt in window_patt, var_patt: + try: + raw_json = re.search(patt, data).group(1) + return json.loads(raw_json) + except AttributeError: + continue + + self._prepare_and_start_frag_download(ctx) + + success, raw_fragment = dl_fragment( + 'https://www.youtube.com/watch?v={}'.format(video_id)) + if not success: + return False + data = parse_yt_initial_data(raw_fragment) + continuation_id = data['contents']['twoColumnWatchNextResults']['conversationBar']['liveChatRenderer']['continuations'][0]['reloadContinuationData']['continuation'] + # no data yet but required to call _append_fragment + self._append_fragment(ctx, b'') + + first = True + offset = None + while continuation_id is not None: + data = None + if first: + url = 'https://www.youtube.com/live_chat_replay?continuation={}'.format(continuation_id) + success, raw_fragment = dl_fragment(url) + if not success: + return False + data = parse_yt_initial_data(raw_fragment) + else: + url = ('https://www.youtube.com/live_chat_replay/get_live_chat_replay' + + '?continuation={}'.format(continuation_id) + + '&playerOffsetMs={}'.format(offset - 5000) + + '&hidden=false' + + '&pbj=1') + success, raw_fragment = dl_fragment(url) + if not success: + return False + data = json.loads(raw_fragment)['response'] + + first = False + continuation_id = None + + live_chat_continuation = data['continuationContents']['liveChatContinuation'] + offset = None + processed_fragment = bytearray() + if 'actions' in live_chat_continuation: + for action in live_chat_continuation['actions']: + if 'replayChatItemAction' in action: + replay_chat_item_action = action['replayChatItemAction'] + offset = int(replay_chat_item_action['videoOffsetTimeMsec']) + processed_fragment.extend( + json.dumps(action, ensure_ascii=False).encode('utf-8') + b'\n') + continuation_id = live_chat_continuation['continuations'][0]['liveChatReplayContinuationData']['continuation'] + + self._append_fragment(ctx, processed_fragment) + + if test or offset is None: + break + + self._finish_frag_download(ctx) + + return True diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py new file mode 100644 index 000000000..18d8dbcd6 --- /dev/null +++ b/youtube_dl/extractor/__init__.py @@ -0,0 +1,46 @@ +from __future__ import unicode_literals + +try: + from .lazy_extractors import * + from .lazy_extractors import _ALL_CLASSES + _LAZY_LOADER = True +except ImportError: + _LAZY_LOADER = False + from .extractors import * + + _ALL_CLASSES = [ + klass + for name, klass in globals().items() + if name.endswith('IE') and name != 'GenericIE' + ] + _ALL_CLASSES.append(GenericIE) + + +def gen_extractor_classes(): + """ Return a list of supported extractors. + The order does matter; the first extractor matched is the one handling the URL. + """ + return _ALL_CLASSES + + +def gen_extractors(): + """ Return a list of an instance of every supported extractor. + The order does matter; the first extractor matched is the one handling the URL. + """ + return [klass() for klass in gen_extractor_classes()] + + +def list_extractors(age_limit): + """ + Return a list of extractors that are suitable for the given age, + sorted by extractor ID. + """ + + return sorted( + filter(lambda ie: ie.is_suitable(age_limit), gen_extractors()), + key=lambda ie: ie.IE_NAME.lower()) + + +def get_info_extractor(ie_name): + """Returns the info extractor class with the given ie_name""" + return globals()[ie_name + 'IE'] diff --git a/youtube_dl/extractor/abc.py b/youtube_dl/extractor/abc.py new file mode 100644 index 000000000..6637f4f35 --- /dev/null +++ b/youtube_dl/extractor/abc.py @@ -0,0 +1,193 @@ +from __future__ import unicode_literals + +import hashlib +import hmac +import re +import time + +from .common import InfoExtractor +from ..compat import compat_str +from ..utils import ( + ExtractorError, + js_to_json, + int_or_none, + parse_iso8601, + try_get, + unescapeHTML, + update_url_query, +) + + +class ABCIE(InfoExtractor): + IE_NAME = 'abc.net.au' + _VALID_URL = r'https?://(?:www\.)?abc\.net\.au/news/(?:[^/]+/){1,2}(?P<id>\d+)' + + _TESTS = [{ + 'url': 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebola-treatment-centre-in-sierra-leone/5868334', + 'md5': 'cb3dd03b18455a661071ee1e28344d9f', + 'info_dict': { + 'id': '5868334', + 'ext': 'mp4', + 'title': 'Australia to help staff Ebola treatment centre in Sierra Leone', + 'description': 'md5:809ad29c67a05f54eb41f2a105693a67', + }, + 'skip': 'this video has expired', + }, { + 'url': 'http://www.abc.net.au/news/2015-08-17/warren-entsch-introduces-same-sex-marriage-bill/6702326', + 'md5': 'db2a5369238b51f9811ad815b69dc086', + 'info_dict': { + 'id': 'NvqvPeNZsHU', + 'ext': 'mp4', + 'upload_date': '20150816', + 'uploader': 'ABC News (Australia)', + 'description': 'Government backbencher Warren Entsch introduces a cross-party sponsored bill to legalise same-sex marriage, saying the bill is designed to promote "an inclusive Australia, not a divided one.". Read more here: http://ab.co/1Mwc6ef', + 'uploader_id': 'NewsOnABC', + 'title': 'Marriage Equality: Warren Entsch introduces same sex marriage bill', + }, + 'add_ie': ['Youtube'], + 'skip': 'Not accessible from Travis CI server', + }, { + 'url': 'http://www.abc.net.au/news/2015-10-23/nab-lifts-interest-rates-following-westpac-and-cba/6880080', + 'md5': 'b96eee7c9edf4fc5a358a0252881cc1f', + 'info_dict': { + 'id': '6880080', + 'ext': 'mp3', + 'title': 'NAB lifts interest rates, following Westpac and CBA', + 'description': 'md5:f13d8edc81e462fce4a0437c7dc04728', + }, + }, { + 'url': 'http://www.abc.net.au/news/2015-10-19/6866214', + 'only_matching': True, + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + mobj = re.search( + r'inline(?P<type>Video|Audio|YouTube)Data\.push\((?P<json_data>[^)]+)\);', + webpage) + if mobj is None: + expired = self._html_search_regex(r'(?s)class="expired-(?:video|audio)".+?<span>(.+?)</span>', webpage, 'expired', None) + if expired: + raise ExtractorError('%s said: %s' % (self.IE_NAME, expired), expected=True) + raise ExtractorError('Unable to extract video urls') + + urls_info = self._parse_json( + mobj.group('json_data'), video_id, transform_source=js_to_json) + + if not isinstance(urls_info, list): + urls_info = [urls_info] + + if mobj.group('type') == 'YouTube': + return self.playlist_result([ + self.url_result(url_info['url']) for url_info in urls_info]) + + formats = [{ + 'url': url_info['url'], + 'vcodec': url_info.get('codec') if mobj.group('type') == 'Video' else 'none', + 'width': int_or_none(url_info.get('width')), + 'height': int_or_none(url_info.get('height')), + 'tbr': int_or_none(url_info.get('bitrate')), + 'filesize': int_or_none(url_info.get('filesize')), + } for url_info in urls_info] + + self._sort_formats(formats) + + return { + 'id': video_id, + 'title': self._og_search_title(webpage), + 'formats': formats, + 'description': self._og_search_description(webpage), + 'thumbnail': self._og_search_thumbnail(webpage), + } + + +class ABCIViewIE(InfoExtractor): + IE_NAME = 'abc.net.au:iview' + _VALID_URL = r'https?://iview\.abc\.net\.au/(?:[^/]+/)*video/(?P<id>[^/?#]+)' + _GEO_COUNTRIES = ['AU'] + + # ABC iview programs are normally available for 14 days only. + _TESTS = [{ + 'url': 'https://iview.abc.net.au/show/gruen/series/11/video/LE1927H001S00', + 'md5': '67715ce3c78426b11ba167d875ac6abf', + 'info_dict': { + 'id': 'LE1927H001S00', + 'ext': 'mp4', + 'title': "Series 11 Ep 1", + 'series': "Gruen", + 'description': 'md5:52cc744ad35045baf6aded2ce7287f67', + 'upload_date': '20190925', + 'uploader_id': 'abc1', + 'timestamp': 1569445289, + }, + 'params': { + 'skip_download': True, + }, + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + video_params = self._download_json( + 'https://iview.abc.net.au/api/programs/' + video_id, video_id) + title = unescapeHTML(video_params.get('title') or video_params['seriesTitle']) + stream = next(s for s in video_params['playlist'] if s.get('type') in ('program', 'livestream')) + + house_number = video_params.get('episodeHouseNumber') or video_id + path = '/auth/hls/sign?ts={0}&hn={1}&d=android-tablet'.format( + int(time.time()), house_number) + sig = hmac.new( + b'android.content.res.Resources', + path.encode('utf-8'), hashlib.sha256).hexdigest() + token = self._download_webpage( + 'http://iview.abc.net.au{0}&sig={1}'.format(path, sig), video_id) + + def tokenize_url(url, token): + return update_url_query(url, { + 'hdnea': token, + }) + + for sd in ('720', 'sd', 'sd-low'): + sd_url = try_get( + stream, lambda x: x['streams']['hls'][sd], compat_str) + if not sd_url: + continue + formats = self._extract_m3u8_formats( + tokenize_url(sd_url, token), video_id, 'mp4', + entry_protocol='m3u8_native', m3u8_id='hls', fatal=False) + if formats: + break + self._sort_formats(formats) + + subtitles = {} + src_vtt = stream.get('captions', {}).get('src-vtt') + if src_vtt: + subtitles['en'] = [{ + 'url': src_vtt, + 'ext': 'vtt', + }] + + is_live = video_params.get('livestream') == '1' + if is_live: + title = self._live_title(title) + + return { + 'id': video_id, + 'title': title, + 'description': video_params.get('description'), + 'thumbnail': video_params.get('thumbnail'), + 'duration': int_or_none(video_params.get('eventDuration')), + 'timestamp': parse_iso8601(video_params.get('pubDate'), ' '), + 'series': unescapeHTML(video_params.get('seriesTitle')), + 'series_id': video_params.get('seriesHouseNumber') or video_id[:7], + 'season_number': int_or_none(self._search_regex( + r'\bSeries\s+(\d+)\b', title, 'season number', default=None)), + 'episode_number': int_or_none(self._search_regex( + r'\bEp\s+(\d+)\b', title, 'episode number', default=None)), + 'episode_id': house_number, + 'uploader_id': video_params.get('channel'), + 'formats': formats, + 'subtitles': subtitles, + 'is_live': is_live, + } diff --git a/youtube_dl/extractor/abcnews.py b/youtube_dl/extractor/abcnews.py new file mode 100644 index 000000000..8b407bf9c --- /dev/null +++ b/youtube_dl/extractor/abcnews.py @@ -0,0 +1,148 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import calendar +import re +import time + +from .amp import AMPIE +from .common import InfoExtractor +from .youtube import YoutubeIE +from ..compat import compat_urlparse + + +class AbcNewsVideoIE(AMPIE): + IE_NAME = 'abcnews:video' + _VALID_URL = r'''(?x) + https?:// + (?: + abcnews\.go\.com/ + (?: + [^/]+/video/(?P<display_id>[0-9a-z-]+)-| + video/embed\?.*?\bid= + )| + fivethirtyeight\.abcnews\.go\.com/video/embed/\d+/ + ) + (?P<id>\d+) + ''' + + _TESTS = [{ + 'url': 'http://abcnews.go.com/ThisWeek/video/week-exclusive-irans-foreign-minister-zarif-20411932', + 'info_dict': { + 'id': '20411932', + 'ext': 'mp4', + 'display_id': 'week-exclusive-irans-foreign-minister-zarif', + 'title': '\'This Week\' Exclusive: Iran\'s Foreign Minister Zarif', + 'description': 'George Stephanopoulos goes one-on-one with Iranian Foreign Minister Dr. Javad Zarif.', + 'duration': 180, + 'thumbnail': r're:^https?://.*\.jpg$', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + }, { + 'url': 'http://abcnews.go.com/video/embed?id=46979033', + 'only_matching': True, + }, { + 'url': 'http://abcnews.go.com/2020/video/2020-husband-stands-teacher-jail-student-affairs-26119478', + 'only_matching': True, + }] + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + display_id = mobj.group('display_id') + video_id = mobj.group('id') + info_dict = self._extract_feed_info( + 'http://abcnews.go.com/video/itemfeed?id=%s' % video_id) + info_dict.update({ + 'id': video_id, + 'display_id': display_id, + }) + return info_dict + + +class AbcNewsIE(InfoExtractor): + IE_NAME = 'abcnews' + _VALID_URL = r'https?://abcnews\.go\.com/(?:[^/]+/)+(?P<display_id>[0-9a-z-]+)/story\?id=(?P<id>\d+)' + + _TESTS = [{ + 'url': 'http://abcnews.go.com/Blotter/News/dramatic-video-rare-death-job-america/story?id=10498713#.UIhwosWHLjY', + 'info_dict': { + 'id': '10505354', + 'ext': 'flv', + 'display_id': 'dramatic-video-rare-death-job-america', + 'title': 'Occupational Hazards', + 'description': 'Nightline investigates the dangers that lurk at various jobs.', + 'thumbnail': r're:^https?://.*\.jpg$', + 'upload_date': '20100428', + 'timestamp': 1272412800, + }, + 'add_ie': ['AbcNewsVideo'], + }, { + 'url': 'http://abcnews.go.com/Entertainment/justin-timberlake-performs-stop-feeling-eurovision-2016/story?id=39125818', + 'info_dict': { + 'id': '38897857', + 'ext': 'mp4', + 'display_id': 'justin-timberlake-performs-stop-feeling-eurovision-2016', + 'title': 'Justin Timberlake Drops Hints For Secret Single', + 'description': 'Lara Spencer reports the buzziest stories of the day in "GMA" Pop News.', + 'upload_date': '20160515', + 'timestamp': 1463329500, + }, + 'params': { + # m3u8 download + 'skip_download': True, + # The embedded YouTube video is blocked due to copyright issues + 'playlist_items': '1', + }, + 'add_ie': ['AbcNewsVideo'], + }, { + 'url': 'http://abcnews.go.com/Technology/exclusive-apple-ceo-tim-cook-iphone-cracking-software/story?id=37173343', + 'only_matching': True, + }] + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + display_id = mobj.group('display_id') + video_id = mobj.group('id') + + webpage = self._download_webpage(url, video_id) + video_url = self._search_regex( + r'window\.abcnvideo\.url\s*=\s*"([^"]+)"', webpage, 'video URL') + full_video_url = compat_urlparse.urljoin(url, video_url) + + youtube_url = YoutubeIE._extract_url(webpage) + + timestamp = None + date_str = self._html_search_regex( + r'<span[^>]+class="timestamp">([^<]+)</span>', + webpage, 'timestamp', fatal=False) + if date_str: + tz_offset = 0 + if date_str.endswith(' ET'): # Eastern Time + tz_offset = -5 + date_str = date_str[:-3] + date_formats = ['%b. %d, %Y', '%b %d, %Y, %I:%M %p'] + for date_format in date_formats: + try: + timestamp = calendar.timegm(time.strptime(date_str.strip(), date_format)) + except ValueError: + continue + if timestamp is not None: + timestamp -= tz_offset * 3600 + + entry = { + '_type': 'url_transparent', + 'ie_key': AbcNewsVideoIE.ie_key(), + 'url': full_video_url, + 'id': video_id, + 'display_id': display_id, + 'timestamp': timestamp, + } + + if youtube_url: + entries = [entry, self.url_result(youtube_url, ie=YoutubeIE.ie_key())] + return self.playlist_result(entries) + + return entry diff --git a/youtube_dl/extractor/abcotvs.py b/youtube_dl/extractor/abcotvs.py new file mode 100644 index 000000000..0bc69a64f --- /dev/null +++ b/youtube_dl/extractor/abcotvs.py @@ -0,0 +1,137 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..compat import compat_str +from ..utils import ( + dict_get, + int_or_none, + try_get, +) + + +class ABCOTVSIE(InfoExtractor): + IE_NAME = 'abcotvs' + IE_DESC = 'ABC Owned Television Stations' + _VALID_URL = r'https?://(?P<site>abc(?:7(?:news|ny|chicago)?|11|13|30)|6abc)\.com(?:(?:/[^/]+)*/(?P<display_id>[^/]+))?/(?P<id>\d+)' + _TESTS = [ + { + 'url': 'http://abc7news.com/entertainment/east-bay-museum-celebrates-vintage-synthesizers/472581/', + 'info_dict': { + 'id': '472548', + 'display_id': 'east-bay-museum-celebrates-vintage-synthesizers', + 'ext': 'mp4', + 'title': 'East Bay museum celebrates synthesized music', + 'description': 'md5:24ed2bd527096ec2a5c67b9d5a9005f3', + 'thumbnail': r're:^https?://.*\.jpg$', + 'timestamp': 1421118520, + 'upload_date': '20150113', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + }, + { + 'url': 'http://abc7news.com/472581', + 'only_matching': True, + }, + { + 'url': 'https://6abc.com/man-75-killed-after-being-struck-by-vehicle-in-chester/5725182/', + 'only_matching': True, + }, + ] + _SITE_MAP = { + '6abc': 'wpvi', + 'abc11': 'wtvd', + 'abc13': 'ktrk', + 'abc30': 'kfsn', + 'abc7': 'kabc', + 'abc7chicago': 'wls', + 'abc7news': 'kgo', + 'abc7ny': 'wabc', + } + + def _real_extract(self, url): + site, display_id, video_id = re.match(self._VALID_URL, url).groups() + display_id = display_id or video_id + station = self._SITE_MAP[site] + + data = self._download_json( + 'https://api.abcotvs.com/v2/content', display_id, query={ + 'id': video_id, + 'key': 'otv.web.%s.story' % station, + 'station': station, + })['data'] + video = try_get(data, lambda x: x['featuredMedia']['video'], dict) or data + video_id = compat_str(dict_get(video, ('id', 'publishedKey'), video_id)) + title = video.get('title') or video['linkText'] + + formats = [] + m3u8_url = video.get('m3u8') + if m3u8_url: + formats = self._extract_m3u8_formats( + video['m3u8'].split('?')[0], display_id, 'mp4', m3u8_id='hls', fatal=False) + mp4_url = video.get('mp4') + if mp4_url: + formats.append({ + 'abr': 128, + 'format_id': 'https', + 'height': 360, + 'url': mp4_url, + 'width': 640, + }) + self._sort_formats(formats) + + image = video.get('image') or {} + + return { + 'id': video_id, + 'display_id': display_id, + 'title': title, + 'description': dict_get(video, ('description', 'caption'), try_get(video, lambda x: x['meta']['description'])), + 'thumbnail': dict_get(image, ('source', 'dynamicSource')), + 'timestamp': int_or_none(video.get('date')), + 'duration': int_or_none(video.get('length')), + 'formats': formats, + } + + +class ABCOTVSClipsIE(InfoExtractor): + IE_NAME = 'abcotvs:clips' + _VALID_URL = r'https?://clips\.abcotvs\.com/(?:[^/]+/)*video/(?P<id>\d+)' + _TEST = { + 'url': 'https://clips.abcotvs.com/kabc/video/214814', + 'info_dict': { + 'id': '214814', + 'ext': 'mp4', + 'title': 'SpaceX launch pad explosion destroys rocket, satellite', + 'description': 'md5:9f186e5ad8f490f65409965ee9c7be1b', + 'upload_date': '20160901', + 'timestamp': 1472756695, + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + } + + def _real_extract(self, url): + video_id = self._match_id(url) + video_data = self._download_json('https://clips.abcotvs.com/vogo/video/getByIds?ids=' + video_id, video_id)['results'][0] + title = video_data['title'] + formats = self._extract_m3u8_formats( + video_data['videoURL'].split('?')[0], video_id, 'mp4') + self._sort_formats(formats) + + return { + 'id': video_id, + 'title': title, + 'description': video_data.get('description'), + 'thumbnail': video_data.get('thumbnailURL'), + 'duration': int_or_none(video_data.get('duration')), + 'timestamp': int_or_none(video_data.get('pubDate')), + 'formats': formats, + } diff --git a/youtube_dl/extractor/academicearth.py b/youtube_dl/extractor/academicearth.py new file mode 100644 index 000000000..34095501c --- /dev/null +++ b/youtube_dl/extractor/academicearth.py @@ -0,0 +1,41 @@ +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor + + +class AcademicEarthCourseIE(InfoExtractor): + _VALID_URL = r'^https?://(?:www\.)?academicearth\.org/playlists/(?P<id>[^?#/]+)' + IE_NAME = 'AcademicEarth:Course' + _TEST = { + 'url': 'http://academicearth.org/playlists/laws-of-nature/', + 'info_dict': { + 'id': 'laws-of-nature', + 'title': 'Laws of Nature', + 'description': 'Introduce yourself to the laws of nature with these free online college lectures from Yale, Harvard, and MIT.', + }, + 'playlist_count': 3, + } + + def _real_extract(self, url): + playlist_id = self._match_id(url) + + webpage = self._download_webpage(url, playlist_id) + title = self._html_search_regex( + r'<h1 class="playlist-name"[^>]*?>(.*?)</h1>', webpage, 'title') + description = self._html_search_regex( + r'<p class="excerpt"[^>]*?>(.*?)</p>', + webpage, 'description', fatal=False) + urls = re.findall( + r'<li class="lecture-preview">\s*?<a target="_blank" href="([^"]+)">', + webpage) + entries = [self.url_result(u) for u in urls] + + return { + '_type': 'playlist', + 'id': playlist_id, + 'title': title, + 'description': description, + 'entries': entries, + } diff --git a/youtube_dl/extractor/acast.py b/youtube_dl/extractor/acast.py new file mode 100644 index 000000000..b17c792d2 --- /dev/null +++ b/youtube_dl/extractor/acast.py @@ -0,0 +1,135 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re +import functools + +from .common import InfoExtractor +from ..compat import compat_str +from ..utils import ( + clean_html, + float_or_none, + int_or_none, + try_get, + unified_timestamp, + OnDemandPagedList, +) + + +class ACastIE(InfoExtractor): + IE_NAME = 'acast' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:(?:embed|www)\.)?acast\.com/| + play\.acast\.com/s/ + ) + (?P<channel>[^/]+)/(?P<id>[^/#?]+) + ''' + _TESTS = [{ + 'url': 'https://www.acast.com/sparpodcast/2.raggarmordet-rosterurdetforflutna', + 'md5': '16d936099ec5ca2d5869e3a813ee8dc4', + 'info_dict': { + 'id': '2a92b283-1a75-4ad8-8396-499c641de0d9', + 'ext': 'mp3', + 'title': '2. Raggarmordet - Röster ur det förflutna', + 'description': 'md5:4f81f6d8cf2e12ee21a321d8bca32db4', + 'timestamp': 1477346700, + 'upload_date': '20161024', + 'duration': 2766.602563, + 'creator': 'Anton Berg & Martin Johnson', + 'series': 'Spår', + 'episode': '2. Raggarmordet - Röster ur det förflutna', + } + }, { + 'url': 'http://embed.acast.com/adambuxton/ep.12-adam-joeschristmaspodcast2015', + 'only_matching': True, + }, { + 'url': 'https://play.acast.com/s/rattegangspodden/s04e09-styckmordet-i-helenelund-del-22', + 'only_matching': True, + }, { + 'url': 'https://play.acast.com/s/sparpodcast/2a92b283-1a75-4ad8-8396-499c641de0d9', + 'only_matching': True, + }] + + def _real_extract(self, url): + channel, display_id = re.match(self._VALID_URL, url).groups() + s = self._download_json( + 'https://feeder.acast.com/api/v1/shows/%s/episodes/%s' % (channel, display_id), + display_id) + media_url = s['url'] + if re.search(r'[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}', display_id): + episode_url = s.get('episodeUrl') + if episode_url: + display_id = episode_url + else: + channel, display_id = re.match(self._VALID_URL, s['link']).groups() + cast_data = self._download_json( + 'https://play-api.acast.com/splash/%s/%s' % (channel, display_id), + display_id)['result'] + e = cast_data['episode'] + title = e.get('name') or s['title'] + return { + 'id': compat_str(e['id']), + 'display_id': display_id, + 'url': media_url, + 'title': title, + 'description': e.get('summary') or clean_html(e.get('description') or s.get('description')), + 'thumbnail': e.get('image'), + 'timestamp': unified_timestamp(e.get('publishingDate') or s.get('publishDate')), + 'duration': float_or_none(e.get('duration') or s.get('duration')), + 'filesize': int_or_none(e.get('contentLength')), + 'creator': try_get(cast_data, lambda x: x['show']['author'], compat_str), + 'series': try_get(cast_data, lambda x: x['show']['name'], compat_str), + 'season_number': int_or_none(e.get('seasonNumber')), + 'episode': title, + 'episode_number': int_or_none(e.get('episodeNumber')), + } + + +class ACastChannelIE(InfoExtractor): + IE_NAME = 'acast:channel' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:www\.)?acast\.com/| + play\.acast\.com/s/ + ) + (?P<id>[^/#?]+) + ''' + _TESTS = [{ + 'url': 'https://www.acast.com/todayinfocus', + 'info_dict': { + 'id': '4efc5294-5385-4847-98bd-519799ce5786', + 'title': 'Today in Focus', + 'description': 'md5:9ba5564de5ce897faeb12963f4537a64', + }, + 'playlist_mincount': 35, + }, { + 'url': 'http://play.acast.com/s/ft-banking-weekly', + 'only_matching': True, + }] + _API_BASE_URL = 'https://play.acast.com/api/' + _PAGE_SIZE = 10 + + @classmethod + def suitable(cls, url): + return False if ACastIE.suitable(url) else super(ACastChannelIE, cls).suitable(url) + + def _fetch_page(self, channel_slug, page): + casts = self._download_json( + self._API_BASE_URL + 'channels/%s/acasts?page=%s' % (channel_slug, page), + channel_slug, note='Download page %d of channel data' % page) + for cast in casts: + yield self.url_result( + 'https://play.acast.com/s/%s/%s' % (channel_slug, cast['url']), + 'ACast', cast['id']) + + def _real_extract(self, url): + channel_slug = self._match_id(url) + channel_data = self._download_json( + self._API_BASE_URL + 'channels/%s' % channel_slug, channel_slug) + entries = OnDemandPagedList(functools.partial( + self._fetch_page, channel_slug), self._PAGE_SIZE) + return self.playlist_result(entries, compat_str( + channel_data['id']), channel_data['name'], channel_data.get('description')) diff --git a/youtube_dl/extractor/adn.py b/youtube_dl/extractor/adn.py new file mode 100644 index 000000000..c95ad2173 --- /dev/null +++ b/youtube_dl/extractor/adn.py @@ -0,0 +1,207 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import base64 +import binascii +import json +import os +import random + +from .common import InfoExtractor +from ..aes import aes_cbc_decrypt +from ..compat import ( + compat_b64decode, + compat_ord, +) +from ..utils import ( + bytes_to_intlist, + bytes_to_long, + ExtractorError, + float_or_none, + intlist_to_bytes, + long_to_bytes, + pkcs1pad, + strip_or_none, + urljoin, +) + + +class ADNIE(InfoExtractor): + IE_DESC = 'Anime Digital Network' + _VALID_URL = r'https?://(?:www\.)?animedigitalnetwork\.fr/video/[^/]+/(?P<id>\d+)' + _TEST = { + 'url': 'http://animedigitalnetwork.fr/video/blue-exorcist-kyoto-saga/7778-episode-1-debut-des-hostilites', + 'md5': 'e497370d847fd79d9d4c74be55575c7a', + 'info_dict': { + 'id': '7778', + 'ext': 'mp4', + 'title': 'Blue Exorcist - Kyôto Saga - Épisode 1', + 'description': 'md5:2f7b5aa76edbc1a7a92cedcda8a528d5', + } + } + _BASE_URL = 'http://animedigitalnetwork.fr' + _RSA_KEY = (0xc35ae1e4356b65a73b551493da94b8cb443491c0aa092a357a5aee57ffc14dda85326f42d716e539a34542a0d3f363adf16c5ec222d713d5997194030ee2e4f0d1fb328c01a81cf6868c090d50de8e169c6b13d1675b9eeed1cbc51e1fffca9b38af07f37abd790924cd3bee59d0257cfda4fe5f3f0534877e21ce5821447d1b, 65537) + _POS_ALIGN_MAP = { + 'start': 1, + 'end': 3, + } + _LINE_ALIGN_MAP = { + 'middle': 8, + 'end': 4, + } + + @staticmethod + def _ass_subtitles_timecode(seconds): + return '%01d:%02d:%02d.%02d' % (seconds / 3600, (seconds % 3600) / 60, seconds % 60, (seconds % 1) * 100) + + def _get_subtitles(self, sub_path, video_id): + if not sub_path: + return None + + enc_subtitles = self._download_webpage( + urljoin(self._BASE_URL, sub_path), + video_id, 'Downloading subtitles location', fatal=False) or '{}' + subtitle_location = (self._parse_json(enc_subtitles, video_id, fatal=False) or {}).get('location') + if subtitle_location: + enc_subtitles = self._download_webpage( + urljoin(self._BASE_URL, subtitle_location), + video_id, 'Downloading subtitles data', fatal=False, + headers={'Origin': 'https://animedigitalnetwork.fr'}) + if not enc_subtitles: + return None + + # http://animedigitalnetwork.fr/components/com_vodvideo/videojs/adn-vjs.min.js + dec_subtitles = intlist_to_bytes(aes_cbc_decrypt( + bytes_to_intlist(compat_b64decode(enc_subtitles[24:])), + bytes_to_intlist(binascii.unhexlify(self._K + '4b8ef13ec1872730')), + bytes_to_intlist(compat_b64decode(enc_subtitles[:24])) + )) + subtitles_json = self._parse_json( + dec_subtitles[:-compat_ord(dec_subtitles[-1])].decode(), + None, fatal=False) + if not subtitles_json: + return None + + subtitles = {} + for sub_lang, sub in subtitles_json.items(): + ssa = '''[Script Info] +ScriptType:V4.00 +[V4 Styles] +Format: Name,Fontname,Fontsize,PrimaryColour,SecondaryColour,TertiaryColour,BackColour,Bold,Italic,BorderStyle,Outline,Shadow,Alignment,MarginL,MarginR,MarginV,AlphaLevel,Encoding +Style: Default,Arial,18,16777215,16777215,16777215,0,-1,0,1,1,0,2,20,20,20,0,0 +[Events] +Format: Marked,Start,End,Style,Name,MarginL,MarginR,MarginV,Effect,Text''' + for current in sub: + start, end, text, line_align, position_align = ( + float_or_none(current.get('startTime')), + float_or_none(current.get('endTime')), + current.get('text'), current.get('lineAlign'), + current.get('positionAlign')) + if start is None or end is None or text is None: + continue + alignment = self._POS_ALIGN_MAP.get(position_align, 2) + self._LINE_ALIGN_MAP.get(line_align, 0) + ssa += os.linesep + 'Dialogue: Marked=0,%s,%s,Default,,0,0,0,,%s%s' % ( + self._ass_subtitles_timecode(start), + self._ass_subtitles_timecode(end), + '{\\a%d}' % alignment if alignment != 2 else '', + text.replace('\n', '\\N').replace('<i>', '{\\i1}').replace('</i>', '{\\i0}')) + + if sub_lang == 'vostf': + sub_lang = 'fr' + subtitles.setdefault(sub_lang, []).extend([{ + 'ext': 'json', + 'data': json.dumps(sub), + }, { + 'ext': 'ssa', + 'data': ssa, + }]) + return subtitles + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + player_config = self._parse_json(self._search_regex( + r'playerConfig\s*=\s*({.+});', webpage, + 'player config', default='{}'), video_id, fatal=False) + if not player_config: + config_url = urljoin(self._BASE_URL, self._search_regex( + r'(?:id="player"|class="[^"]*adn-player-container[^"]*")[^>]+data-url="([^"]+)"', + webpage, 'config url')) + player_config = self._download_json( + config_url, video_id, + 'Downloading player config JSON metadata')['player'] + + video_info = {} + video_info_str = self._search_regex( + r'videoInfo\s*=\s*({.+});', webpage, + 'video info', fatal=False) + if video_info_str: + video_info = self._parse_json( + video_info_str, video_id, fatal=False) or {} + + options = player_config.get('options') or {} + metas = options.get('metas') or {} + links = player_config.get('links') or {} + sub_path = player_config.get('subtitles') + error = None + if not links: + links_url = player_config.get('linksurl') or options['videoUrl'] + token = options['token'] + self._K = ''.join([random.choice('0123456789abcdef') for _ in range(16)]) + message = bytes_to_intlist(json.dumps({ + 'k': self._K, + 'e': 60, + 't': token, + })) + padded_message = intlist_to_bytes(pkcs1pad(message, 128)) + n, e = self._RSA_KEY + encrypted_message = long_to_bytes(pow(bytes_to_long(padded_message), e, n)) + authorization = base64.b64encode(encrypted_message).decode() + links_data = self._download_json( + urljoin(self._BASE_URL, links_url), video_id, + 'Downloading links JSON metadata', headers={ + 'Authorization': 'Bearer ' + authorization, + }) + links = links_data.get('links') or {} + metas = metas or links_data.get('meta') or {} + sub_path = sub_path or links_data.get('subtitles') or \ + 'index.php?option=com_vodapi&task=subtitles.getJSON&format=json&id=' + video_id + sub_path += '&token=' + token + error = links_data.get('error') + title = metas.get('title') or video_info['title'] + + formats = [] + for format_id, qualities in links.items(): + if not isinstance(qualities, dict): + continue + for quality, load_balancer_url in qualities.items(): + load_balancer_data = self._download_json( + load_balancer_url, video_id, + 'Downloading %s %s JSON metadata' % (format_id, quality), + fatal=False) or {} + m3u8_url = load_balancer_data.get('location') + if not m3u8_url: + continue + m3u8_formats = self._extract_m3u8_formats( + m3u8_url, video_id, 'mp4', 'm3u8_native', + m3u8_id=format_id, fatal=False) + if format_id == 'vf': + for f in m3u8_formats: + f['language'] = 'fr' + formats.extend(m3u8_formats) + if not error: + error = options.get('error') + if not formats and error: + raise ExtractorError('%s said: %s' % (self.IE_NAME, error), expected=True) + self._sort_formats(formats) + + return { + 'id': video_id, + 'title': title, + 'description': strip_or_none(metas.get('summary') or video_info.get('resume')), + 'thumbnail': video_info.get('image'), + 'formats': formats, + 'subtitles': self.extract_subtitles(sub_path, video_id), + 'episode': metas.get('subtitle') or video_info.get('videoTitle'), + 'series': video_info.get('playlistTitle'), + } diff --git a/youtube_dl/extractor/adobeconnect.py b/youtube_dl/extractor/adobeconnect.py new file mode 100644 index 000000000..728549eb9 --- /dev/null +++ b/youtube_dl/extractor/adobeconnect.py @@ -0,0 +1,37 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..compat import ( + compat_parse_qs, + compat_urlparse, +) + + +class AdobeConnectIE(InfoExtractor): + _VALID_URL = r'https?://\w+\.adobeconnect\.com/(?P<id>[\w-]+)' + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + title = self._html_search_regex(r'<title>(.+?)', webpage, 'title') + qs = compat_parse_qs(self._search_regex(r"swfUrl\s*=\s*'([^']+)'", webpage, 'swf url').split('?')[1]) + is_live = qs.get('isLive', ['false'])[0] == 'true' + formats = [] + for con_string in qs['conStrings'][0].split(','): + formats.append({ + 'format_id': con_string.split('://')[0], + 'app': compat_urlparse.quote('?' + con_string.split('?')[1] + 'flvplayerapp/' + qs['appInstance'][0]), + 'ext': 'flv', + 'play_path': 'mp4:' + qs['streamName'][0], + 'rtmp_conn': 'S:' + qs['ticket'][0], + 'rtmp_live': is_live, + 'url': con_string, + }) + + return { + 'id': video_id, + 'title': self._live_title(title) if is_live else title, + 'formats': formats, + 'is_live': is_live, + } diff --git a/youtube_dl/extractor/adobepass.py b/youtube_dl/extractor/adobepass.py new file mode 100644 index 000000000..38dca1b0a --- /dev/null +++ b/youtube_dl/extractor/adobepass.py @@ -0,0 +1,1572 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re +import time +import xml.etree.ElementTree as etree + +from .common import InfoExtractor +from ..compat import ( + compat_kwargs, + compat_urlparse, +) +from ..utils import ( + unescapeHTML, + urlencode_postdata, + unified_timestamp, + ExtractorError, + NO_DEFAULT, +) + + +MSO_INFO = { + 'DTV': { + 'name': 'DIRECTV', + 'username_field': 'username', + 'password_field': 'password', + }, + 'ATT': { + 'name': 'AT&T U-verse', + 'username_field': 'userid', + 'password_field': 'password', + }, + 'ATTOTT': { + 'name': 'DIRECTV NOW', + 'username_field': 'email', + 'password_field': 'loginpassword', + }, + 'Rogers': { + 'name': 'Rogers', + 'username_field': 'UserName', + 'password_field': 'UserPassword', + }, + 'Comcast_SSO': { + 'name': 'Comcast XFINITY', + 'username_field': 'user', + 'password_field': 'passwd', + }, + 'TWC': { + 'name': 'Time Warner Cable | Spectrum', + 'username_field': 'Ecom_User_ID', + 'password_field': 'Ecom_Password', + }, + 'Brighthouse': { + 'name': 'Bright House Networks | Spectrum', + 'username_field': 'j_username', + 'password_field': 'j_password', + }, + 'Charter_Direct': { + 'name': 'Charter Spectrum', + 'username_field': 'IDToken1', + 'password_field': 'IDToken2', + }, + 'Verizon': { + 'name': 'Verizon FiOS', + 'username_field': 'IDToken1', + 'password_field': 'IDToken2', + }, + 'thr030': { + 'name': '3 Rivers Communications' + }, + 'com140': { + 'name': 'Access Montana' + }, + 'acecommunications': { + 'name': 'AcenTek' + }, + 'acm010': { + 'name': 'Acme Communications' + }, + 'ada020': { + 'name': 'Adams Cable Service' + }, + 'alb020': { + 'name': 'Albany Mutual Telephone' + }, + 'algona': { + 'name': 'Algona Municipal Utilities' + }, + 'allwest': { + 'name': 'All West Communications' + }, + 'all025': { + 'name': 'Allen\'s Communications' + }, + 'spl010': { + 'name': 'Alliance Communications' + }, + 'all070': { + 'name': 'ALLO Communications' + }, + 'alpine': { + 'name': 'Alpine Communications' + }, + 'hun015': { + 'name': 'American Broadband' + }, + 'nwc010': { + 'name': 'American Broadband Missouri' + }, + 'com130-02': { + 'name': 'American Community Networks' + }, + 'com130-01': { + 'name': 'American Warrior Networks' + }, + 'tom020': { + 'name': 'Amherst Telephone/Tomorrow Valley' + }, + 'tvc020': { + 'name': 'Andycable' + }, + 'arkwest': { + 'name': 'Arkwest Communications' + }, + 'art030': { + 'name': 'Arthur Mutual Telephone Company' + }, + 'arvig': { + 'name': 'Arvig' + }, + 'nttcash010': { + 'name': 'Ashland Home Net' + }, + 'astound': { + 'name': 'Astound (now Wave)' + }, + 'dix030': { + 'name': 'ATC Broadband' + }, + 'ara010': { + 'name': 'ATC Communications' + }, + 'she030-02': { + 'name': 'Ayersville Communications' + }, + 'baldwin': { + 'name': 'Baldwin Lightstream' + }, + 'bal040': { + 'name': 'Ballard TV' + }, + 'cit025': { + 'name': 'Bardstown Cable TV' + }, + 'bay030': { + 'name': 'Bay Country Communications' + }, + 'tel095': { + 'name': 'Beaver Creek Cooperative Telephone' + }, + 'bea020': { + 'name': 'Beaver Valley Cable' + }, + 'bee010': { + 'name': 'Bee Line Cable' + }, + 'wir030': { + 'name': 'Beehive Broadband' + }, + 'bra020': { + 'name': 'BELD' + }, + 'bel020': { + 'name': 'Bellevue Municipal Cable' + }, + 'vol040-01': { + 'name': 'Ben Lomand Connect / BLTV' + }, + 'bev010': { + 'name': 'BEVCOMM' + }, + 'big020': { + 'name': 'Big Sandy Broadband' + }, + 'ble020': { + 'name': 'Bledsoe Telephone Cooperative' + }, + 'bvt010': { + 'name': 'Blue Valley Tele-Communications' + }, + 'bra050': { + 'name': 'Brandenburg Telephone Co.' + }, + 'bte010': { + 'name': 'Bristol Tennessee Essential Services' + }, + 'annearundel': { + 'name': 'Broadstripe' + }, + 'btc010': { + 'name': 'BTC Communications' + }, + 'btc040': { + 'name': 'BTC Vision - Nahunta' + }, + 'bul010': { + 'name': 'Bulloch Telephone Cooperative' + }, + 'but010': { + 'name': 'Butler-Bremer Communications' + }, + 'tel160-csp': { + 'name': 'C Spire SNAP' + }, + 'csicable': { + 'name': 'Cable Services Inc.' + }, + 'cableamerica': { + 'name': 'CableAmerica' + }, + 'cab038': { + 'name': 'CableSouth Media 3' + }, + 'weh010-camtel': { + 'name': 'Cam-Tel Company' + }, + 'car030': { + 'name': 'Cameron Communications' + }, + 'canbytel': { + 'name': 'Canby Telcom' + }, + 'crt020': { + 'name': 'CapRock Tv' + }, + 'car050': { + 'name': 'Carnegie Cable' + }, + 'cas': { + 'name': 'CAS Cable' + }, + 'casscomm': { + 'name': 'CASSCOMM' + }, + 'mid180-02': { + 'name': 'Catalina Broadband Solutions' + }, + 'cccomm': { + 'name': 'CC Communications' + }, + 'nttccde010': { + 'name': 'CDE Lightband' + }, + 'cfunet': { + 'name': 'Cedar Falls Utilities' + }, + 'dem010-01': { + 'name': 'Celect-Bloomer Telephone Area' + }, + 'dem010-02': { + 'name': 'Celect-Bruce Telephone Area' + }, + 'dem010-03': { + 'name': 'Celect-Citizens Connected Area' + }, + 'dem010-04': { + 'name': 'Celect-Elmwood/Spring Valley Area' + }, + 'dem010-06': { + 'name': 'Celect-Mosaic Telecom' + }, + 'dem010-05': { + 'name': 'Celect-West WI Telephone Area' + }, + 'net010-02': { + 'name': 'Cellcom/Nsight Telservices' + }, + 'cen100': { + 'name': 'CentraCom' + }, + 'nttccst010': { + 'name': 'Central Scott / CSTV' + }, + 'cha035': { + 'name': 'Chaparral CableVision' + }, + 'cha050': { + 'name': 'Chariton Valley Communication Corporation, Inc.' + }, + 'cha060': { + 'name': 'Chatmoss Cablevision' + }, + 'nttcche010': { + 'name': 'Cherokee Communications' + }, + 'che050': { + 'name': 'Chesapeake Bay Communications' + }, + 'cimtel': { + 'name': 'Cim-Tel Cable, LLC.' + }, + 'cit180': { + 'name': 'Citizens Cablevision - Floyd, VA' + }, + 'cit210': { + 'name': 'Citizens Cablevision, Inc.' + }, + 'cit040': { + 'name': 'Citizens Fiber' + }, + 'cit250': { + 'name': 'Citizens Mutual' + }, + 'war040': { + 'name': 'Citizens Telephone Corporation' + }, + 'wat025': { + 'name': 'City Of Monroe' + }, + 'wadsworth': { + 'name': 'CityLink' + }, + 'nor100': { + 'name': 'CL Tel' + }, + 'cla010': { + 'name': 'Clarence Telephone and Cedar Communications' + }, + 'ser060': { + 'name': 'Clear Choice Communications' + }, + 'tac020': { + 'name': 'Click! Cable TV' + }, + 'war020': { + 'name': 'CLICK1.NET' + }, + 'cml010': { + 'name': 'CML Telephone Cooperative Association' + }, + 'cns': { + 'name': 'CNS' + }, + 'com160': { + 'name': 'Co-Mo Connect' + }, + 'coa020': { + 'name': 'Coast Communications' + }, + 'coa030': { + 'name': 'Coaxial Cable TV' + }, + 'mid055': { + 'name': 'Cobalt TV (Mid-State Community TV)' + }, + 'col070': { + 'name': 'Columbia Power & Water Systems' + }, + 'col080': { + 'name': 'Columbus Telephone' + }, + 'nor105': { + 'name': 'Communications 1 Cablevision, Inc.' + }, + 'com150': { + 'name': 'Community Cable & Broadband' + }, + 'com020': { + 'name': 'Community Communications Company' + }, + 'coy010': { + 'name': 'commZoom' + }, + 'com025': { + 'name': 'Complete Communication Services' + }, + 'cat020': { + 'name': 'Comporium' + }, + 'com071': { + 'name': 'ComSouth Telesys' + }, + 'consolidatedcable': { + 'name': 'Consolidated' + }, + 'conwaycorp': { + 'name': 'Conway Corporation' + }, + 'coo050': { + 'name': 'Coon Valley Telecommunications Inc' + }, + 'coo080': { + 'name': 'Cooperative Telephone Company' + }, + 'cpt010': { + 'name': 'CP-TEL' + }, + 'cra010': { + 'name': 'Craw-Kan Telephone' + }, + 'crestview': { + 'name': 'Crestview Cable Communications' + }, + 'cross': { + 'name': 'Cross TV' + }, + 'cro030': { + 'name': 'Crosslake Communications' + }, + 'ctc040': { + 'name': 'CTC - Brainerd MN' + }, + 'phe030': { + 'name': 'CTV-Beam - East Alabama' + }, + 'cun010': { + 'name': 'Cunningham Telephone & Cable' + }, + 'dpc010': { + 'name': 'D & P Communications' + }, + 'dak030': { + 'name': 'Dakota Central Telecommunications' + }, + 'nttcdel010': { + 'name': 'Delcambre Telephone LLC' + }, + 'tel160-del': { + 'name': 'Delta Telephone Company' + }, + 'sal040': { + 'name': 'DiamondNet' + }, + 'ind060-dc': { + 'name': 'Direct Communications' + }, + 'doy010': { + 'name': 'Doylestown Cable TV' + }, + 'dic010': { + 'name': 'DRN' + }, + 'dtc020': { + 'name': 'DTC' + }, + 'dtc010': { + 'name': 'DTC Cable (Delhi)' + }, + 'dum010': { + 'name': 'Dumont Telephone Company' + }, + 'dun010': { + 'name': 'Dunkerton Telephone Cooperative' + }, + 'cci010': { + 'name': 'Duo County Telecom' + }, + 'eagle': { + 'name': 'Eagle Communications' + }, + 'weh010-east': { + 'name': 'East Arkansas Cable TV' + }, + 'eatel': { + 'name': 'EATEL Video, LLC' + }, + 'ell010': { + 'name': 'ECTA' + }, + 'emerytelcom': { + 'name': 'Emery Telcom Video LLC' + }, + 'nor200': { + 'name': 'Empire Access' + }, + 'endeavor': { + 'name': 'Endeavor Communications' + }, + 'sun045': { + 'name': 'Enhanced Telecommunications Corporation' + }, + 'mid030': { + 'name': 'enTouch' + }, + 'epb020': { + 'name': 'EPB Smartnet' + }, + 'jea010': { + 'name': 'EPlus Broadband' + }, + 'com065': { + 'name': 'ETC' + }, + 'ete010': { + 'name': 'Etex Communications' + }, + 'fbc-tele': { + 'name': 'F&B Communications' + }, + 'fal010': { + 'name': 'Falcon Broadband' + }, + 'fam010': { + 'name': 'FamilyView CableVision' + }, + 'far020': { + 'name': 'Farmers Mutual Telephone Company' + }, + 'fay010': { + 'name': 'Fayetteville Public Utilities' + }, + 'sal060': { + 'name': 'fibrant' + }, + 'fid010': { + 'name': 'Fidelity Communications' + }, + 'for030': { + 'name': 'FJ Communications' + }, + 'fli020': { + 'name': 'Flint River Communications' + }, + 'far030': { + 'name': 'FMT - Jesup' + }, + 'foo010': { + 'name': 'Foothills Communications' + }, + 'for080': { + 'name': 'Forsyth CableNet' + }, + 'fbcomm': { + 'name': 'Frankfort Plant Board' + }, + 'tel160-fra': { + 'name': 'Franklin Telephone Company' + }, + 'nttcftc010': { + 'name': 'FTC' + }, + 'fullchannel': { + 'name': 'Full Channel, Inc.' + }, + 'gar040': { + 'name': 'Gardonville Cooperative Telephone Association' + }, + 'gbt010': { + 'name': 'GBT Communications, Inc.' + }, + 'tec010': { + 'name': 'Genuine Telecom' + }, + 'clr010': { + 'name': 'Giant Communications' + }, + 'gla010': { + 'name': 'Glasgow EPB' + }, + 'gle010': { + 'name': 'Glenwood Telecommunications' + }, + 'gra060': { + 'name': 'GLW Broadband Inc.' + }, + 'goldenwest': { + 'name': 'Golden West Cablevision' + }, + 'vis030': { + 'name': 'Grantsburg Telcom' + }, + 'gpcom': { + 'name': 'Great Plains Communications' + }, + 'gri010': { + 'name': 'Gridley Cable Inc' + }, + 'hbc010': { + 'name': 'H&B Cable Services' + }, + 'hae010': { + 'name': 'Haefele TV Inc.' + }, + 'htc010': { + 'name': 'Halstad Telephone Company' + }, + 'har005': { + 'name': 'Harlan Municipal Utilities' + }, + 'har020': { + 'name': 'Hart Communications' + }, + 'ced010': { + 'name': 'Hartelco TV' + }, + 'hea040': { + 'name': 'Heart of Iowa Communications Cooperative' + }, + 'htc020': { + 'name': 'Hickory Telephone Company' + }, + 'nttchig010': { + 'name': 'Highland Communication Services' + }, + 'hig030': { + 'name': 'Highland Media' + }, + 'spc010': { + 'name': 'Hilliary Communications' + }, + 'hin020': { + 'name': 'Hinton CATV Co.' + }, + 'hometel': { + 'name': 'HomeTel Entertainment, Inc.' + }, + 'hoodcanal': { + 'name': 'Hood Canal Communications' + }, + 'weh010-hope': { + 'name': 'Hope - Prescott Cable TV' + }, + 'horizoncable': { + 'name': 'Horizon Cable TV, Inc.' + }, + 'hor040': { + 'name': 'Horizon Chillicothe Telephone' + }, + 'htc030': { + 'name': 'HTC Communications Co. - IL' + }, + 'htccomm': { + 'name': 'HTC Communications, Inc. - IA' + }, + 'wal005': { + 'name': 'Huxley Communications' + }, + 'imon': { + 'name': 'ImOn Communications' + }, + 'ind040': { + 'name': 'Independence Telecommunications' + }, + 'rrc010': { + 'name': 'Inland Networks' + }, + 'stc020': { + 'name': 'Innovative Cable TV St Croix' + }, + 'car100': { + 'name': 'Innovative Cable TV St Thomas-St John' + }, + 'icc010': { + 'name': 'Inside Connect Cable' + }, + 'int100': { + 'name': 'Integra Telecom' + }, + 'int050': { + 'name': 'Interstate Telecommunications Coop' + }, + 'irv010': { + 'name': 'Irvine Cable' + }, + 'k2c010': { + 'name': 'K2 Communications' + }, + 'kal010': { + 'name': 'Kalida Telephone Company, Inc.' + }, + 'kal030': { + 'name': 'Kalona Cooperative Telephone Company' + }, + 'kmt010': { + 'name': 'KMTelecom' + }, + 'kpu010': { + 'name': 'KPU Telecommunications' + }, + 'kuh010': { + 'name': 'Kuhn Communications, Inc.' + }, + 'lak130': { + 'name': 'Lakeland Communications' + }, + 'lan010': { + 'name': 'Langco' + }, + 'lau020': { + 'name': 'Laurel Highland Total Communications, Inc.' + }, + 'leh010': { + 'name': 'Lehigh Valley Cooperative Telephone' + }, + 'bra010': { + 'name': 'Limestone Cable/Bracken Cable' + }, + 'loc020': { + 'name': 'LISCO' + }, + 'lit020': { + 'name': 'Litestream' + }, + 'tel140': { + 'name': 'LivCom' + }, + 'loc010': { + 'name': 'LocalTel Communications' + }, + 'weh010-longview': { + 'name': 'Longview - Kilgore Cable TV' + }, + 'lon030': { + 'name': 'Lonsdale Video Ventures, LLC' + }, + 'lns010': { + 'name': 'Lost Nation-Elwood Telephone Co.' + }, + 'nttclpc010': { + 'name': 'LPC Connect' + }, + 'lumos': { + 'name': 'Lumos Networks' + }, + 'madison': { + 'name': 'Madison Communications' + }, + 'mad030': { + 'name': 'Madison County Cable Inc.' + }, + 'nttcmah010': { + 'name': 'Mahaska Communication Group' + }, + 'mar010': { + 'name': 'Marne & Elk Horn Telephone Company' + }, + 'mcc040': { + 'name': 'McClure Telephone Co.' + }, + 'mctv': { + 'name': 'MCTV' + }, + 'merrimac': { + 'name': 'Merrimac Communications Ltd.' + }, + 'metronet': { + 'name': 'Metronet' + }, + 'mhtc': { + 'name': 'MHTC' + }, + 'midhudson': { + 'name': 'Mid-Hudson Cable' + }, + 'midrivers': { + 'name': 'Mid-Rivers Communications' + }, + 'mid045': { + 'name': 'Midstate Communications' + }, + 'mil080': { + 'name': 'Milford Communications' + }, + 'min030': { + 'name': 'MINET' + }, + 'nttcmin010': { + 'name': 'Minford TV' + }, + 'san040-02': { + 'name': 'Mitchell Telecom' + }, + 'mlg010': { + 'name': 'MLGC' + }, + 'mon060': { + 'name': 'Mon-Cre TVE' + }, + 'mou110': { + 'name': 'Mountain Telephone' + }, + 'mou050': { + 'name': 'Mountain Village Cable' + }, + 'mtacomm': { + 'name': 'MTA Communications, LLC' + }, + 'mtc010': { + 'name': 'MTC Cable' + }, + 'med040': { + 'name': 'MTC Technologies' + }, + 'man060': { + 'name': 'MTCC' + }, + 'mtc030': { + 'name': 'MTCO Communications' + }, + 'mul050': { + 'name': 'Mulberry Telecommunications' + }, + 'mur010': { + 'name': 'Murray Electric System' + }, + 'musfiber': { + 'name': 'MUS FiberNET' + }, + 'mpw': { + 'name': 'Muscatine Power & Water' + }, + 'nttcsli010': { + 'name': 'myEVTV.com' + }, + 'nor115': { + 'name': 'NCC' + }, + 'nor260': { + 'name': 'NDTC' + }, + 'nctc': { + 'name': 'Nebraska Central Telecom, Inc.' + }, + 'nel020': { + 'name': 'Nelsonville TV Cable' + }, + 'nem010': { + 'name': 'Nemont' + }, + 'new075': { + 'name': 'New Hope Telephone Cooperative' + }, + 'nor240': { + 'name': 'NICP' + }, + 'cic010': { + 'name': 'NineStar Connect' + }, + 'nktelco': { + 'name': 'NKTelco' + }, + 'nortex': { + 'name': 'Nortex Communications' + }, + 'nor140': { + 'name': 'North Central Telephone Cooperative' + }, + 'nor030': { + 'name': 'Northland Communications' + }, + 'nor075': { + 'name': 'Northwest Communications' + }, + 'nor125': { + 'name': 'Norwood Light Broadband' + }, + 'net010': { + 'name': 'Nsight Telservices' + }, + 'dur010': { + 'name': 'Ntec' + }, + 'nts010': { + 'name': 'NTS Communications' + }, + 'new045': { + 'name': 'NU-Telecom' + }, + 'nulink': { + 'name': 'NuLink' + }, + 'jam030': { + 'name': 'NVC' + }, + 'far035': { + 'name': 'OmniTel Communications' + }, + 'onesource': { + 'name': 'OneSource Communications' + }, + 'cit230': { + 'name': 'Opelika Power Services' + }, + 'daltonutilities': { + 'name': 'OptiLink' + }, + 'mid140': { + 'name': 'OPTURA' + }, + 'ote010': { + 'name': 'OTEC Communication Company' + }, + 'cci020': { + 'name': 'Packerland Broadband' + }, + 'pan010': { + 'name': 'Panora Telco/Guthrie Center Communications' + }, + 'otter': { + 'name': 'Park Region Telephone & Otter Tail Telcom' + }, + 'mid050': { + 'name': 'Partner Communications Cooperative' + }, + 'fib010': { + 'name': 'Pathway' + }, + 'paulbunyan': { + 'name': 'Paul Bunyan Communications' + }, + 'pem020': { + 'name': 'Pembroke Telephone Company' + }, + 'mck010': { + 'name': 'Peoples Rural Telephone Cooperative' + }, + 'pul010': { + 'name': 'PES Energize' + }, + 'phi010': { + 'name': 'Philippi Communications System' + }, + 'phonoscope': { + 'name': 'Phonoscope Cable' + }, + 'pin070': { + 'name': 'Pine Belt Communications, Inc.' + }, + 'weh010-pine': { + 'name': 'Pine Bluff Cable TV' + }, + 'pin060': { + 'name': 'Pineland Telephone Cooperative' + }, + 'cam010': { + 'name': 'Pinpoint Communications' + }, + 'pio060': { + 'name': 'Pioneer Broadband' + }, + 'pioncomm': { + 'name': 'Pioneer Communications' + }, + 'pioneer': { + 'name': 'Pioneer DTV' + }, + 'pla020': { + 'name': 'Plant TiftNet, Inc.' + }, + 'par010': { + 'name': 'PLWC' + }, + 'pro035': { + 'name': 'PMT' + }, + 'vik011': { + 'name': 'Polar Cablevision' + }, + 'pottawatomie': { + 'name': 'Pottawatomie Telephone Co.' + }, + 'premiercomm': { + 'name': 'Premier Communications' + }, + 'psc010': { + 'name': 'PSC' + }, + 'pan020': { + 'name': 'PTCI' + }, + 'qco010': { + 'name': 'QCOL' + }, + 'qua010': { + 'name': 'Quality Cablevision' + }, + 'rad010': { + 'name': 'Radcliffe Telephone Company' + }, + 'car040': { + 'name': 'Rainbow Communications' + }, + 'rai030': { + 'name': 'Rainier Connect' + }, + 'ral010': { + 'name': 'Ralls Technologies' + }, + 'rct010': { + 'name': 'RC Technologies' + }, + 'red040': { + 'name': 'Red River Communications' + }, + 'ree010': { + 'name': 'Reedsburg Utility Commission' + }, + 'mol010': { + 'name': 'Reliance Connects- Oregon' + }, + 'res020': { + 'name': 'Reserve Telecommunications' + }, + 'weh010-resort': { + 'name': 'Resort TV Cable' + }, + 'rld010': { + 'name': 'Richland Grant Telephone Cooperative, Inc.' + }, + 'riv030': { + 'name': 'River Valley Telecommunications Coop' + }, + 'rockportcable': { + 'name': 'Rock Port Cablevision' + }, + 'rsf010': { + 'name': 'RS Fiber' + }, + 'rtc': { + 'name': 'RTC Communication Corp' + }, + 'res040': { + 'name': 'RTC-Reservation Telephone Coop.' + }, + 'rte010': { + 'name': 'RTEC Communications' + }, + 'stc010': { + 'name': 'S&T' + }, + 'san020': { + 'name': 'San Bruno Cable TV' + }, + 'san040-01': { + 'name': 'Santel' + }, + 'sav010': { + 'name': 'SCI Broadband-Savage Communications Inc.' + }, + 'sco050': { + 'name': 'Scottsboro Electric Power Board' + }, + 'scr010': { + 'name': 'Scranton Telephone Company' + }, + 'selco': { + 'name': 'SELCO' + }, + 'she010': { + 'name': 'Shentel' + }, + 'she030': { + 'name': 'Sherwood Mutual Telephone Association, Inc.' + }, + 'ind060-ssc': { + 'name': 'Silver Star Communications' + }, + 'sjoberg': { + 'name': 'Sjoberg\'s Inc.' + }, + 'sou025': { + 'name': 'SKT' + }, + 'sky050': { + 'name': 'SkyBest TV' + }, + 'nttcsmi010': { + 'name': 'Smithville Communications' + }, + 'woo010': { + 'name': 'Solarus' + }, + 'sou075': { + 'name': 'South Central Rural Telephone Cooperative' + }, + 'sou065': { + 'name': 'South Holt Cablevision, Inc.' + }, + 'sou035': { + 'name': 'South Slope Cooperative Communications' + }, + 'spa020': { + 'name': 'Spanish Fork Community Network' + }, + 'spe010': { + 'name': 'Spencer Municipal Utilities' + }, + 'spi005': { + 'name': 'Spillway Communications, Inc.' + }, + 'srt010': { + 'name': 'SRT' + }, + 'cccsmc010': { + 'name': 'St. Maarten Cable TV' + }, + 'sta025': { + 'name': 'Star Communications' + }, + 'sco020': { + 'name': 'STE' + }, + 'uin010': { + 'name': 'STRATA Networks' + }, + 'sum010': { + 'name': 'Sumner Cable TV' + }, + 'pie010': { + 'name': 'Surry TV/PCSI TV' + }, + 'swa010': { + 'name': 'Swayzee Communications' + }, + 'sweetwater': { + 'name': 'Sweetwater Cable Television Co' + }, + 'weh010-talequah': { + 'name': 'Tahlequah Cable TV' + }, + 'tct': { + 'name': 'TCT' + }, + 'tel050': { + 'name': 'Tele-Media Company' + }, + 'com050': { + 'name': 'The Community Agency' + }, + 'thr020': { + 'name': 'Three River' + }, + 'cab140': { + 'name': 'Town & Country Technologies' + }, + 'tra010': { + 'name': 'Trans-Video' + }, + 'tre010': { + 'name': 'Trenton TV Cable Company' + }, + 'tcc': { + 'name': 'Tri County Communications Cooperative' + }, + 'tri025': { + 'name': 'TriCounty Telecom' + }, + 'tri110': { + 'name': 'TrioTel Communications, Inc.' + }, + 'tro010': { + 'name': 'Troy Cablevision, Inc.' + }, + 'tsc': { + 'name': 'TSC' + }, + 'cit220': { + 'name': 'Tullahoma Utilities Board' + }, + 'tvc030': { + 'name': 'TV Cable of Rensselaer' + }, + 'tvc015': { + 'name': 'TVC Cable' + }, + 'cab180': { + 'name': 'TVision' + }, + 'twi040': { + 'name': 'Twin Lakes' + }, + 'tvtinc': { + 'name': 'Twin Valley' + }, + 'uis010': { + 'name': 'Union Telephone Company' + }, + 'uni110': { + 'name': 'United Communications - TN' + }, + 'uni120': { + 'name': 'United Services' + }, + 'uss020': { + 'name': 'US Sonet' + }, + 'cab060': { + 'name': 'USA Communications' + }, + 'she005': { + 'name': 'USA Communications/Shellsburg, IA' + }, + 'val040': { + 'name': 'Valley TeleCom Group' + }, + 'val025': { + 'name': 'Valley Telecommunications' + }, + 'val030': { + 'name': 'Valparaiso Broadband' + }, + 'cla050': { + 'name': 'Vast Broadband' + }, + 'sul015': { + 'name': 'Venture Communications Cooperative, Inc.' + }, + 'ver025': { + 'name': 'Vernon Communications Co-op' + }, + 'weh010-vicksburg': { + 'name': 'Vicksburg Video' + }, + 'vis070': { + 'name': 'Vision Communications' + }, + 'volcanotel': { + 'name': 'Volcano Vision, Inc.' + }, + 'vol040-02': { + 'name': 'VolFirst / BLTV' + }, + 'ver070': { + 'name': 'VTel' + }, + 'nttcvtx010': { + 'name': 'VTX1' + }, + 'bci010-02': { + 'name': 'Vyve Broadband' + }, + 'wab020': { + 'name': 'Wabash Mutual Telephone' + }, + 'waitsfield': { + 'name': 'Waitsfield Cable' + }, + 'wal010': { + 'name': 'Walnut Communications' + }, + 'wavebroadband': { + 'name': 'Wave' + }, + 'wav030': { + 'name': 'Waverly Communications Utility' + }, + 'wbi010': { + 'name': 'WBI' + }, + 'web020': { + 'name': 'Webster-Calhoun Cooperative Telephone Association' + }, + 'wes005': { + 'name': 'West Alabama TV Cable' + }, + 'carolinata': { + 'name': 'West Carolina Communications' + }, + 'wct010': { + 'name': 'West Central Telephone Association' + }, + 'wes110': { + 'name': 'West River Cooperative Telephone Company' + }, + 'ani030': { + 'name': 'WesTel Systems' + }, + 'westianet': { + 'name': 'Western Iowa Networks' + }, + 'nttcwhi010': { + 'name': 'Whidbey Telecom' + }, + 'weh010-white': { + 'name': 'White County Cable TV' + }, + 'wes130': { + 'name': 'Wiatel' + }, + 'wik010': { + 'name': 'Wiktel' + }, + 'wil070': { + 'name': 'Wilkes Communications, Inc./RiverStreet Networks' + }, + 'wil015': { + 'name': 'Wilson Communications' + }, + 'win010': { + 'name': 'Windomnet/SMBS' + }, + 'win090': { + 'name': 'Windstream Cable TV' + }, + 'wcta': { + 'name': 'Winnebago Cooperative Telecom Association' + }, + 'wtc010': { + 'name': 'WTC' + }, + 'wil040': { + 'name': 'WTC Communications, Inc.' + }, + 'wya010': { + 'name': 'Wyandotte Cable' + }, + 'hin020-02': { + 'name': 'X-Stream Services' + }, + 'xit010': { + 'name': 'XIT Communications' + }, + 'yel010': { + 'name': 'Yelcot Communications' + }, + 'mid180-01': { + 'name': 'yondoo' + }, + 'cou060': { + 'name': 'Zito Media' + }, +} + + +class AdobePassIE(InfoExtractor): + _SERVICE_PROVIDER_TEMPLATE = 'https://sp.auth.adobe.com/adobe-services/%s' + _USER_AGENT = 'Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0' + _MVPD_CACHE = 'ap-mvpd' + + _DOWNLOADING_LOGIN_PAGE = 'Downloading Provider Login Page' + + def _download_webpage_handle(self, *args, **kwargs): + headers = self.geo_verification_headers() + headers.update(kwargs.get('headers', {})) + kwargs['headers'] = headers + return super(AdobePassIE, self)._download_webpage_handle( + *args, **compat_kwargs(kwargs)) + + @staticmethod + def _get_mvpd_resource(provider_id, title, guid, rating): + channel = etree.Element('channel') + channel_title = etree.SubElement(channel, 'title') + channel_title.text = provider_id + item = etree.SubElement(channel, 'item') + resource_title = etree.SubElement(item, 'title') + resource_title.text = title + resource_guid = etree.SubElement(item, 'guid') + resource_guid.text = guid + resource_rating = etree.SubElement(item, 'media:rating') + resource_rating.attrib = {'scheme': 'urn:v-chip'} + resource_rating.text = rating + return '' + etree.tostring(channel).decode() + '' + + def _extract_mvpd_auth(self, url, video_id, requestor_id, resource): + def xml_text(xml_str, tag): + return self._search_regex( + '<%s>(.+?)' % (tag, tag), xml_str, tag) + + def is_expired(token, date_ele): + token_expires = unified_timestamp(re.sub(r'[_ ]GMT', '', xml_text(token, date_ele))) + return token_expires and token_expires <= int(time.time()) + + def post_form(form_page_res, note, data={}): + form_page, urlh = form_page_res + post_url = self._html_search_regex(r']+action=(["\'])(?P.+?)\1', form_page, 'post url', group='url') + if not re.match(r'https?://', post_url): + post_url = compat_urlparse.urljoin(urlh.geturl(), post_url) + form_data = self._hidden_inputs(form_page) + form_data.update(data) + return self._download_webpage_handle( + post_url, video_id, note, data=urlencode_postdata(form_data), headers={ + 'Content-Type': 'application/x-www-form-urlencoded', + }) + + def raise_mvpd_required(): + raise ExtractorError( + 'This video is only available for users of participating TV providers. ' + 'Use --ap-mso to specify Adobe Pass Multiple-system operator Identifier ' + 'and --ap-username and --ap-password or --netrc to provide account credentials.', expected=True) + + def extract_redirect_url(html, url=None, fatal=False): + # TODO: eliminate code duplication with generic extractor and move + # redirection code into _download_webpage_handle + REDIRECT_REGEX = r'[0-9]{,2};\s*(?:URL|url)=\'?([^\'"]+)' + redirect_url = self._search_regex( + r'(?i)Resume' in mvpd_confirm_page: + post_form(mvpd_confirm_page_res, 'Confirming Login') + elif mso_id == 'Verizon': + # In general, if you're connecting from a Verizon-assigned IP, + # you will not actually pass your credentials. + provider_redirect_page, urlh = provider_redirect_page_res + if 'Please wait ...' in provider_redirect_page: + saml_redirect_url = self._html_search_regex( + r'self\.parent\.location=(["\'])(?P.+?)\1', + provider_redirect_page, + 'SAML Redirect URL', group='url') + saml_login_page = self._download_webpage( + saml_redirect_url, video_id, + 'Downloading SAML Login Page') + else: + saml_login_page_res = post_form( + provider_redirect_page_res, 'Logging in', { + mso_info['username_field']: username, + mso_info['password_field']: password, + }) + saml_login_page, urlh = saml_login_page_res + if 'Please try again.' in saml_login_page: + raise ExtractorError( + 'We\'re sorry, but either the User ID or Password entered is not correct.') + saml_login_url = self._search_regex( + r'xmlHttp\.open\("POST"\s*,\s*(["\'])(?P.+?)\1', + saml_login_page, 'SAML Login URL', group='url') + saml_response_json = self._download_json( + saml_login_url, video_id, 'Downloading SAML Response', + headers={'Content-Type': 'text/xml'}) + self._download_webpage( + saml_response_json['targetValue'], video_id, + 'Confirming Login', data=urlencode_postdata({ + 'SAMLResponse': saml_response_json['SAMLResponse'], + 'RelayState': saml_response_json['RelayState'] + }), headers={ + 'Content-Type': 'application/x-www-form-urlencoded' + }) + else: + # Some providers (e.g. DIRECTV NOW) have another meta refresh + # based redirect that should be followed. + provider_redirect_page, urlh = provider_redirect_page_res + provider_refresh_redirect_url = extract_redirect_url( + provider_redirect_page, url=urlh.geturl()) + if provider_refresh_redirect_url: + provider_redirect_page_res = self._download_webpage_handle( + provider_refresh_redirect_url, video_id, + 'Downloading Provider Redirect Page (meta refresh)') + provider_login_page_res = post_form( + provider_redirect_page_res, self._DOWNLOADING_LOGIN_PAGE) + mvpd_confirm_page_res = post_form(provider_login_page_res, 'Logging in', { + mso_info.get('username_field', 'username'): username, + mso_info.get('password_field', 'password'): password, + }) + if mso_id != 'Rogers': + post_form(mvpd_confirm_page_res, 'Confirming Login') + + session = self._download_webpage( + self._SERVICE_PROVIDER_TEMPLATE % 'session', video_id, + 'Retrieving Session', data=urlencode_postdata({ + '_method': 'GET', + 'requestor_id': requestor_id, + }), headers=mvpd_headers) + if '\d+)' + _TEST = { + 'url': 'https://tv.adobe.com/embed/22/4153', + 'md5': 'c8c0461bf04d54574fc2b4d07ac6783a', + 'info_dict': { + 'id': '4153', + 'ext': 'flv', + 'title': 'Creating Graphics Optimized for BlackBerry', + 'description': 'md5:eac6e8dced38bdaae51cd94447927459', + 'thumbnail': r're:https?://.*\.jpg$', + 'upload_date': '20091109', + 'duration': 377, + 'view_count': int, + }, + } + + def _real_extract(self, url): + video_id = self._match_id(url) + + video_data = self._call_api( + 'episode/' + video_id, video_id, {'disclosure': 'standard'})[0] + return self._parse_video_data(video_data) + + +class AdobeTVIE(AdobeTVBaseIE): + IE_NAME = 'adobetv' + _VALID_URL = r'https?://tv\.adobe\.com/(?:(?Pfr|de|es|jp)/)?watch/(?P[^/]+)/(?P[^/]+)' + + _TEST = { + 'url': 'http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/quick-tip-how-to-draw-a-circle-around-an-object-in-photoshop/', + 'md5': '9bc5727bcdd55251f35ad311ca74fa1e', + 'info_dict': { + 'id': '10981', + 'ext': 'mp4', + 'title': 'Quick Tip - How to Draw a Circle Around an Object in Photoshop', + 'description': 'md5:99ec318dc909d7ba2a1f2b038f7d2311', + 'thumbnail': r're:https?://.*\.jpg$', + 'upload_date': '20110914', + 'duration': 60, + 'view_count': int, + }, + } + + def _real_extract(self, url): + language, show_urlname, urlname = re.match(self._VALID_URL, url).groups() + if not language: + language = 'en' + + video_data = self._call_api( + 'episode/get', urlname, { + 'disclosure': 'standard', + 'language': language, + 'show_urlname': show_urlname, + 'urlname': urlname, + })[0] + return self._parse_video_data(video_data) + + +class AdobeTVPlaylistBaseIE(AdobeTVBaseIE): + _PAGE_SIZE = 25 + + def _fetch_page(self, display_id, query, page): + page += 1 + query['page'] = page + for element_data in self._call_api( + self._RESOURCE, display_id, query, 'Download Page %d' % page): + yield self._process_data(element_data) + + def _extract_playlist_entries(self, display_id, query): + return OnDemandPagedList(functools.partial( + self._fetch_page, display_id, query), self._PAGE_SIZE) + + +class AdobeTVShowIE(AdobeTVPlaylistBaseIE): + IE_NAME = 'adobetv:show' + _VALID_URL = r'https?://tv\.adobe\.com/(?:(?Pfr|de|es|jp)/)?show/(?P[^/]+)' + + _TEST = { + 'url': 'http://tv.adobe.com/show/the-complete-picture-with-julieanne-kost', + 'info_dict': { + 'id': '36', + 'title': 'The Complete Picture with Julieanne Kost', + 'description': 'md5:fa50867102dcd1aa0ddf2ab039311b27', + }, + 'playlist_mincount': 136, + } + _RESOURCE = 'episode' + _process_data = AdobeTVBaseIE._parse_video_data + + def _real_extract(self, url): + language, show_urlname = re.match(self._VALID_URL, url).groups() + if not language: + language = 'en' + query = { + 'disclosure': 'standard', + 'language': language, + 'show_urlname': show_urlname, + } + + show_data = self._call_api( + 'show/get', show_urlname, query)[0] + + return self.playlist_result( + self._extract_playlist_entries(show_urlname, query), + str_or_none(show_data.get('id')), + show_data.get('show_name'), + show_data.get('show_description')) + + +class AdobeTVChannelIE(AdobeTVPlaylistBaseIE): + IE_NAME = 'adobetv:channel' + _VALID_URL = r'https?://tv\.adobe\.com/(?:(?Pfr|de|es|jp)/)?channel/(?P[^/]+)(?:/(?P[^/]+))?' + + _TEST = { + 'url': 'http://tv.adobe.com/channel/development', + 'info_dict': { + 'id': 'development', + }, + 'playlist_mincount': 96, + } + _RESOURCE = 'show' + + def _process_data(self, show_data): + return self.url_result( + show_data['url'], 'AdobeTVShow', str_or_none(show_data.get('id'))) + + def _real_extract(self, url): + language, channel_urlname, category_urlname = re.match(self._VALID_URL, url).groups() + if not language: + language = 'en' + query = { + 'channel_urlname': channel_urlname, + 'language': language, + } + if category_urlname: + query['category_urlname'] = category_urlname + + return self.playlist_result( + self._extract_playlist_entries(channel_urlname, query), + channel_urlname) + + +class AdobeTVVideoIE(AdobeTVBaseIE): + IE_NAME = 'adobetv:video' + _VALID_URL = r'https?://video\.tv\.adobe\.com/v/(?P\d+)' + + _TEST = { + # From https://helpx.adobe.com/acrobat/how-to/new-experience-acrobat-dc.html?set=acrobat--get-started--essential-beginners + 'url': 'https://video.tv.adobe.com/v/2456/', + 'md5': '43662b577c018ad707a63766462b1e87', + 'info_dict': { + 'id': '2456', + 'ext': 'mp4', + 'title': 'New experience with Acrobat DC', + 'description': 'New experience with Acrobat DC', + 'duration': 248.667, + }, + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + video_data = self._parse_json(self._search_regex( + r'var\s+bridge\s*=\s*([^;]+);', webpage, 'bridged data'), video_id) + title = video_data['title'] + + formats = [] + sources = video_data.get('sources') or [] + for source in sources: + source_src = source.get('src') + if not source_src: + continue + formats.append({ + 'filesize': int_or_none(source.get('kilobytes') or None, invscale=1000), + 'format_id': '-'.join(filter(None, [source.get('format'), source.get('label')])), + 'height': int_or_none(source.get('height') or None), + 'tbr': int_or_none(source.get('bitrate') or None), + 'width': int_or_none(source.get('width') or None), + 'url': source_src, + }) + self._sort_formats(formats) + + # For both metadata and downloaded files the duration varies among + # formats. I just pick the max one + duration = max(filter(None, [ + float_or_none(source.get('duration'), scale=1000) + for source in sources])) + + return { + 'id': video_id, + 'formats': formats, + 'title': title, + 'description': video_data.get('description'), + 'thumbnail': video_data.get('video', {}).get('poster'), + 'duration': duration, + 'subtitles': self._parse_subtitles(video_data, 'vttPath'), + } diff --git a/youtube_dl/extractor/adultswim.py b/youtube_dl/extractor/adultswim.py new file mode 100644 index 000000000..8d1d9ac7d --- /dev/null +++ b/youtube_dl/extractor/adultswim.py @@ -0,0 +1,202 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import json +import re + +from .turner import TurnerBaseIE +from ..utils import ( + determine_ext, + float_or_none, + int_or_none, + mimetype2ext, + parse_age_limit, + parse_iso8601, + strip_or_none, + try_get, +) + + +class AdultSwimIE(TurnerBaseIE): + _VALID_URL = r'https?://(?:www\.)?adultswim\.com/videos/(?P[^/?#]+)(?:/(?P[^/?#]+))?' + + _TESTS = [{ + 'url': 'http://adultswim.com/videos/rick-and-morty/pilot', + 'info_dict': { + 'id': 'rQxZvXQ4ROaSOqq-or2Mow', + 'ext': 'mp4', + 'title': 'Rick and Morty - Pilot', + 'description': 'Rick moves in with his daughter\'s family and establishes himself as a bad influence on his grandson, Morty.', + 'timestamp': 1543294800, + 'upload_date': '20181127', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + 'expected_warnings': ['Unable to download f4m manifest'], + }, { + 'url': 'http://www.adultswim.com/videos/tim-and-eric-awesome-show-great-job/dr-steve-brule-for-your-wine/', + 'info_dict': { + 'id': 'sY3cMUR_TbuE4YmdjzbIcQ', + 'ext': 'mp4', + 'title': 'Tim and Eric Awesome Show Great Job! - Dr. Steve Brule, For Your Wine', + 'description': 'Dr. Brule reports live from Wine Country with a special report on wines. \nWatch Tim and Eric Awesome Show Great Job! episode #20, "Embarrassed" on Adult Swim.', + 'upload_date': '20080124', + 'timestamp': 1201150800, + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + 'skip': '404 Not Found', + }, { + 'url': 'http://www.adultswim.com/videos/decker/inside-decker-a-new-hero/', + 'info_dict': { + 'id': 'I0LQFQkaSUaFp8PnAWHhoQ', + 'ext': 'mp4', + 'title': 'Decker - Inside Decker: A New Hero', + 'description': 'The guys recap the conclusion of the season. They announce a new hero, take a peek into the Victorville Film Archive and welcome back the talented James Dean.', + 'timestamp': 1469480460, + 'upload_date': '20160725', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + 'expected_warnings': ['Unable to download f4m manifest'], + }, { + 'url': 'http://www.adultswim.com/videos/attack-on-titan', + 'info_dict': { + 'id': 'attack-on-titan', + 'title': 'Attack on Titan', + 'description': 'md5:41caa9416906d90711e31dc00cb7db7e', + }, + 'playlist_mincount': 12, + }, { + 'url': 'http://www.adultswim.com/videos/streams/williams-stream', + 'info_dict': { + 'id': 'd8DEBj7QRfetLsRgFnGEyg', + 'ext': 'mp4', + 'title': r're:^Williams Stream \d{4}-\d{2}-\d{2} \d{2}:\d{2}$', + 'description': 'original programming', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + 'skip': '404 Not Found', + }] + + def _real_extract(self, url): + show_path, episode_path = re.match(self._VALID_URL, url).groups() + display_id = episode_path or show_path + query = '''query { + getShowBySlug(slug:"%s") { + %%s + } +}''' % show_path + if episode_path: + query = query % '''title + getVideoBySlug(slug:"%s") { + _id + auth + description + duration + episodeNumber + launchDate + mediaID + seasonNumber + poster + title + tvRating + }''' % episode_path + ['getVideoBySlug'] + else: + query = query % '''metaDescription + title + videos(first:1000,sort:["episode_number"]) { + edges { + node { + _id + slug + } + } + }''' + show_data = self._download_json( + 'https://www.adultswim.com/api/search', display_id, + data=json.dumps({'query': query}).encode(), + headers={'Content-Type': 'application/json'})['data']['getShowBySlug'] + if episode_path: + video_data = show_data['getVideoBySlug'] + video_id = video_data['_id'] + episode_title = title = video_data['title'] + series = show_data.get('title') + if series: + title = '%s - %s' % (series, title) + info = { + 'id': video_id, + 'title': title, + 'description': strip_or_none(video_data.get('description')), + 'duration': float_or_none(video_data.get('duration')), + 'formats': [], + 'subtitles': {}, + 'age_limit': parse_age_limit(video_data.get('tvRating')), + 'thumbnail': video_data.get('poster'), + 'timestamp': parse_iso8601(video_data.get('launchDate')), + 'series': series, + 'season_number': int_or_none(video_data.get('seasonNumber')), + 'episode': episode_title, + 'episode_number': int_or_none(video_data.get('episodeNumber')), + } + + auth = video_data.get('auth') + media_id = video_data.get('mediaID') + if media_id: + info.update(self._extract_ngtv_info(media_id, { + # CDN_TOKEN_APP_ID from: + # https://d2gg02c3xr550i.cloudfront.net/assets/asvp.e9c8bef24322d060ef87.bundle.js + 'appId': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6ImFzLXR2ZS1kZXNrdG9wLXB0enQ2bSIsInByb2R1Y3QiOiJ0dmUiLCJuZXR3b3JrIjoiYXMiLCJwbGF0Zm9ybSI6ImRlc2t0b3AiLCJpYXQiOjE1MzI3MDIyNzl9.BzSCk-WYOZ2GMCIaeVb8zWnzhlgnXuJTCu0jGp_VaZE', + }, { + 'url': url, + 'site_name': 'AdultSwim', + 'auth_required': auth, + })) + + if not auth: + extract_data = self._download_json( + 'https://www.adultswim.com/api/shows/v1/videos/' + video_id, + video_id, query={'fields': 'stream'}, fatal=False) or {} + assets = try_get(extract_data, lambda x: x['data']['video']['stream']['assets'], list) or [] + for asset in assets: + asset_url = asset.get('url') + if not asset_url: + continue + ext = determine_ext(asset_url, mimetype2ext(asset.get('mime_type'))) + if ext == 'm3u8': + info['formats'].extend(self._extract_m3u8_formats( + asset_url, video_id, 'mp4', m3u8_id='hls', fatal=False)) + elif ext == 'f4m': + continue + # info['formats'].extend(self._extract_f4m_formats( + # asset_url, video_id, f4m_id='hds', fatal=False)) + elif ext in ('scc', 'ttml', 'vtt'): + info['subtitles'].setdefault('en', []).append({ + 'url': asset_url, + }) + self._sort_formats(info['formats']) + + return info + else: + entries = [] + for edge in show_data.get('videos', {}).get('edges', []): + video = edge.get('node') or {} + slug = video.get('slug') + if not slug: + continue + entries.append(self.url_result( + 'http://adultswim.com/videos/%s/%s' % (show_path, slug), + 'AdultSwim', video.get('_id'))) + return self.playlist_result( + entries, show_path, show_data.get('title'), + strip_or_none(show_data.get('metaDescription'))) diff --git a/youtube_dl/extractor/aenetworks.py b/youtube_dl/extractor/aenetworks.py new file mode 100644 index 000000000..611b948f5 --- /dev/null +++ b/youtube_dl/extractor/aenetworks.py @@ -0,0 +1,247 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .theplatform import ThePlatformIE +from ..utils import ( + extract_attributes, + ExtractorError, + int_or_none, + smuggle_url, + update_url_query, +) +from ..compat import ( + compat_urlparse, +) + + +class AENetworksBaseIE(ThePlatformIE): + _THEPLATFORM_KEY = 'crazyjava' + _THEPLATFORM_SECRET = 's3cr3t' + + def _extract_aen_smil(self, smil_url, video_id, auth=None): + query = {'mbr': 'true'} + if auth: + query['auth'] = auth + TP_SMIL_QUERY = [{ + 'assetTypes': 'high_video_ak', + 'switch': 'hls_high_ak' + }, { + 'assetTypes': 'high_video_s3' + }, { + 'assetTypes': 'high_video_s3', + 'switch': 'hls_ingest_fastly' + }] + formats = [] + subtitles = {} + last_e = None + for q in TP_SMIL_QUERY: + q.update(query) + m_url = update_url_query(smil_url, q) + m_url = self._sign_url(m_url, self._THEPLATFORM_KEY, self._THEPLATFORM_SECRET) + try: + tp_formats, tp_subtitles = self._extract_theplatform_smil( + m_url, video_id, 'Downloading %s SMIL data' % (q.get('switch') or q['assetTypes'])) + except ExtractorError as e: + last_e = e + continue + formats.extend(tp_formats) + subtitles = self._merge_subtitles(subtitles, tp_subtitles) + if last_e and not formats: + raise last_e + self._sort_formats(formats) + return { + 'id': video_id, + 'formats': formats, + 'subtitles': subtitles, + } + + +class AENetworksIE(AENetworksBaseIE): + IE_NAME = 'aenetworks' + IE_DESC = 'A+E Networks: A&E, Lifetime, History.com, FYI Network and History Vault' + _VALID_URL = r'''(?x) + https?:// + (?:www\.)? + (?P + (?:history(?:vault)?|aetv|mylifetime|lifetimemovieclub)\.com| + fyi\.tv + )/ + (?: + shows/(?P[^/]+(?:/[^/]+){0,2})| + movies/(?P[^/]+)(?:/full-movie)?| + specials/(?P[^/]+)/(?:full-special|preview-)| + collections/[^/]+/(?P[^/]+) + ) + ''' + _TESTS = [{ + 'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1', + 'info_dict': { + 'id': '22253814', + 'ext': 'mp4', + 'title': 'Winter is Coming', + 'description': 'md5:641f424b7a19d8e24f26dea22cf59d74', + 'timestamp': 1338306241, + 'upload_date': '20120529', + 'uploader': 'AENE-NEW', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + 'add_ie': ['ThePlatform'], + }, { + 'url': 'http://www.history.com/shows/ancient-aliens/season-1', + 'info_dict': { + 'id': '71889446852', + }, + 'playlist_mincount': 5, + }, { + 'url': 'http://www.mylifetime.com/shows/atlanta-plastic', + 'info_dict': { + 'id': 'SERIES4317', + 'title': 'Atlanta Plastic', + }, + 'playlist_mincount': 2, + }, { + 'url': 'http://www.aetv.com/shows/duck-dynasty/season-9/episode-1', + 'only_matching': True + }, { + 'url': 'http://www.fyi.tv/shows/tiny-house-nation/season-1/episode-8', + 'only_matching': True + }, { + 'url': 'http://www.mylifetime.com/shows/project-runway-junior/season-1/episode-6', + 'only_matching': True + }, { + 'url': 'http://www.mylifetime.com/movies/center-stage-on-pointe/full-movie', + 'only_matching': True + }, { + 'url': 'https://www.lifetimemovieclub.com/movies/a-killer-among-us', + 'only_matching': True + }, { + 'url': 'http://www.history.com/specials/sniper-into-the-kill-zone/full-special', + 'only_matching': True + }, { + 'url': 'https://www.historyvault.com/collections/america-the-story-of-us/westward', + 'only_matching': True + }, { + 'url': 'https://www.aetv.com/specials/hunting-jonbenets-killer-the-untold-story/preview-hunting-jonbenets-killer-the-untold-story', + 'only_matching': True + }] + _DOMAIN_TO_REQUESTOR_ID = { + 'history.com': 'HISTORY', + 'aetv.com': 'AETV', + 'mylifetime.com': 'LIFETIME', + 'lifetimemovieclub.com': 'LIFETIMEMOVIECLUB', + 'fyi.tv': 'FYI', + } + + def _real_extract(self, url): + domain, show_path, movie_display_id, special_display_id, collection_display_id = re.match(self._VALID_URL, url).groups() + display_id = show_path or movie_display_id or special_display_id or collection_display_id + webpage = self._download_webpage(url, display_id, headers=self.geo_verification_headers()) + if show_path: + url_parts = show_path.split('/') + url_parts_len = len(url_parts) + if url_parts_len == 1: + entries = [] + for season_url_path in re.findall(r'(?s)]+data-href="(/shows/%s/season-\d+)"' % url_parts[0], webpage): + entries.append(self.url_result( + compat_urlparse.urljoin(url, season_url_path), 'AENetworks')) + if entries: + return self.playlist_result( + entries, self._html_search_meta('aetn:SeriesId', webpage), + self._html_search_meta('aetn:SeriesTitle', webpage)) + else: + # single season + url_parts_len = 2 + if url_parts_len == 2: + entries = [] + for episode_item in re.findall(r'(?s)<[^>]+class="[^"]*(?:episode|program)-item[^"]*"[^>]*>', webpage): + episode_attributes = extract_attributes(episode_item) + episode_url = compat_urlparse.urljoin( + url, episode_attributes['data-canonical']) + entries.append(self.url_result( + episode_url, 'AENetworks', + episode_attributes.get('data-videoid') or episode_attributes.get('data-video-id'))) + return self.playlist_result( + entries, self._html_search_meta('aetn:SeasonId', webpage)) + + video_id = self._html_search_meta('aetn:VideoID', webpage) + media_url = self._search_regex( + [r"media_url\s*=\s*'(?P[^']+)'", + r'data-media-url=(?P(?:https?:)?//[^\s>]+)', + r'data-media-url=(["\'])(?P(?:(?!\1).)+?)\1'], + webpage, 'video url', group='url') + theplatform_metadata = self._download_theplatform_metadata(self._search_regex( + r'https?://link\.theplatform\.com/s/([^?]+)', media_url, 'theplatform_path'), video_id) + info = self._parse_theplatform_metadata(theplatform_metadata) + auth = None + if theplatform_metadata.get('AETN$isBehindWall'): + requestor_id = self._DOMAIN_TO_REQUESTOR_ID[domain] + resource = self._get_mvpd_resource( + requestor_id, theplatform_metadata['title'], + theplatform_metadata.get('AETN$PPL_pplProgramId') or theplatform_metadata.get('AETN$PPL_pplProgramId_OLD'), + theplatform_metadata['ratings'][0]['rating']) + auth = self._extract_mvpd_auth( + url, video_id, requestor_id, resource) + info.update(self._search_json_ld(webpage, video_id, fatal=False)) + info.update(self._extract_aen_smil(media_url, video_id, auth)) + return info + + +class HistoryTopicIE(AENetworksBaseIE): + IE_NAME = 'history:topic' + IE_DESC = 'History.com Topic' + _VALID_URL = r'https?://(?:www\.)?history\.com/topics/[^/]+/(?P[\w+-]+?)-video' + _TESTS = [{ + 'url': 'https://www.history.com/topics/valentines-day/history-of-valentines-day-video', + 'info_dict': { + 'id': '40700995724', + 'ext': 'mp4', + 'title': "History of Valentine’s Day", + 'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7', + 'timestamp': 1375819729, + 'upload_date': '20130806', + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + 'add_ie': ['ThePlatform'], + }] + + def theplatform_url_result(self, theplatform_url, video_id, query): + return { + '_type': 'url_transparent', + 'id': video_id, + 'url': smuggle_url( + update_url_query(theplatform_url, query), + { + 'sig': { + 'key': self._THEPLATFORM_KEY, + 'secret': self._THEPLATFORM_SECRET, + }, + 'force_smil_url': True + }), + 'ie_key': 'ThePlatform', + } + + def _real_extract(self, url): + display_id = self._match_id(url) + webpage = self._download_webpage(url, display_id) + video_id = self._search_regex( + r']+src="[^"]+\btpid=(\d+)', webpage, 'tpid') + result = self._download_json( + 'https://feeds.video.aetnd.com/api/v2/history/videos', + video_id, query={'filter[id]': video_id})['results'][0] + title = result['title'] + info = self._extract_aen_smil(result['publicUrl'], video_id) + info.update({ + 'title': title, + 'description': result.get('description'), + 'duration': int_or_none(result.get('duration')), + 'timestamp': int_or_none(result.get('added'), 1000), + }) + return info diff --git a/youtube_dl/extractor/afreecatv.py b/youtube_dl/extractor/afreecatv.py new file mode 100644 index 000000000..6275e5209 --- /dev/null +++ b/youtube_dl/extractor/afreecatv.py @@ -0,0 +1,367 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..compat import compat_xpath +from ..utils import ( + determine_ext, + ExtractorError, + int_or_none, + url_or_none, + urlencode_postdata, + xpath_text, +) + + +class AfreecaTVIE(InfoExtractor): + IE_NAME = 'afreecatv' + IE_DESC = 'afreecatv.com' + _VALID_URL = r'''(?x) + https?:// + (?: + (?:(?:live|afbbs|www)\.)?afreeca(?:tv)?\.com(?::\d+)? + (?: + /app/(?:index|read_ucc_bbs)\.cgi| + /player/[Pp]layer\.(?:swf|html) + )\?.*?\bnTitleNo=| + vod\.afreecatv\.com/PLAYER/STATION/ + ) + (?P\d+) + ''' + _NETRC_MACHINE = 'afreecatv' + _TESTS = [{ + 'url': 'http://live.afreecatv.com:8079/app/index.cgi?szType=read_ucc_bbs&szBjId=dailyapril&nStationNo=16711924&nBbsNo=18605867&nTitleNo=36164052&szSkin=', + 'md5': 'f72c89fe7ecc14c1b5ce506c4996046e', + 'info_dict': { + 'id': '36164052', + 'ext': 'mp4', + 'title': '데일리 에이프릴 요정들의 시상식!', + 'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$', + 'uploader': 'dailyapril', + 'uploader_id': 'dailyapril', + 'upload_date': '20160503', + }, + 'skip': 'Video is gone', + }, { + 'url': 'http://afbbs.afreecatv.com:8080/app/read_ucc_bbs.cgi?nStationNo=16711924&nTitleNo=36153164&szBjId=dailyapril&nBbsNo=18605867', + 'info_dict': { + 'id': '36153164', + 'title': "BJ유트루와 함께하는 '팅커벨 메이크업!'", + 'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$', + 'uploader': 'dailyapril', + 'uploader_id': 'dailyapril', + }, + 'playlist_count': 2, + 'playlist': [{ + 'md5': 'd8b7c174568da61d774ef0203159bf97', + 'info_dict': { + 'id': '36153164_1', + 'ext': 'mp4', + 'title': "BJ유트루와 함께하는 '팅커벨 메이크업!'", + 'upload_date': '20160502', + }, + }, { + 'md5': '58f2ce7f6044e34439ab2d50612ab02b', + 'info_dict': { + 'id': '36153164_2', + 'ext': 'mp4', + 'title': "BJ유트루와 함께하는 '팅커벨 메이크업!'", + 'upload_date': '20160502', + }, + }], + 'skip': 'Video is gone', + }, { + 'url': 'http://vod.afreecatv.com/PLAYER/STATION/18650793', + 'info_dict': { + 'id': '18650793', + 'ext': 'mp4', + 'title': '오늘은 다르다! 쏘님의 우월한 위아래~ 댄스리액션!', + 'thumbnail': r're:^https?://.*\.jpg$', + 'uploader': '윈아디', + 'uploader_id': 'badkids', + 'duration': 107, + }, + 'params': { + 'skip_download': True, + }, + }, { + 'url': 'http://vod.afreecatv.com/PLAYER/STATION/10481652', + 'info_dict': { + 'id': '10481652', + 'title': "BJ유트루와 함께하는 '팅커벨 메이크업!'", + 'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$', + 'uploader': 'dailyapril', + 'uploader_id': 'dailyapril', + 'duration': 6492, + }, + 'playlist_count': 2, + 'playlist': [{ + 'md5': 'd8b7c174568da61d774ef0203159bf97', + 'info_dict': { + 'id': '20160502_c4c62b9d_174361386_1', + 'ext': 'mp4', + 'title': "BJ유트루와 함께하는 '팅커벨 메이크업!' (part 1)", + 'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$', + 'uploader': 'dailyapril', + 'uploader_id': 'dailyapril', + 'upload_date': '20160502', + 'duration': 3601, + }, + }, { + 'md5': '58f2ce7f6044e34439ab2d50612ab02b', + 'info_dict': { + 'id': '20160502_39e739bb_174361386_2', + 'ext': 'mp4', + 'title': "BJ유트루와 함께하는 '팅커벨 메이크업!' (part 2)", + 'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$', + 'uploader': 'dailyapril', + 'uploader_id': 'dailyapril', + 'upload_date': '20160502', + 'duration': 2891, + }, + }], + 'params': { + 'skip_download': True, + }, + }, { + # non standard key + 'url': 'http://vod.afreecatv.com/PLAYER/STATION/20515605', + 'info_dict': { + 'id': '20170411_BE689A0E_190960999_1_2_h', + 'ext': 'mp4', + 'title': '혼자사는여자집', + 'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$', + 'uploader': '♥이슬이', + 'uploader_id': 'dasl8121', + 'upload_date': '20170411', + 'duration': 213, + }, + 'params': { + 'skip_download': True, + }, + }, { + # PARTIAL_ADULT + 'url': 'http://vod.afreecatv.com/PLAYER/STATION/32028439', + 'info_dict': { + 'id': '20180327_27901457_202289533_1', + 'ext': 'mp4', + 'title': '[생]빨개요♥ (part 1)', + 'thumbnail': 're:^https?://(?:video|st)img.afreecatv.com/.*$', + 'uploader': '[SA]서아', + 'uploader_id': 'bjdyrksu', + 'upload_date': '20180327', + 'duration': 3601, + }, + 'params': { + 'skip_download': True, + }, + 'expected_warnings': ['adult content'], + }, { + 'url': 'http://www.afreecatv.com/player/Player.swf?szType=szBjId=djleegoon&nStationNo=11273158&nBbsNo=13161095&nTitleNo=36327652', + 'only_matching': True, + }, { + 'url': 'http://vod.afreecatv.com/PLAYER/STATION/15055030', + 'only_matching': True, + }] + + @staticmethod + def parse_video_key(key): + video_key = {} + m = re.match(r'^(?P\d{8})_\w+_(?P\d+)$', key) + if m: + video_key['upload_date'] = m.group('upload_date') + video_key['part'] = int(m.group('part')) + return video_key + + def _real_initialize(self): + self._login() + + def _login(self): + username, password = self._get_login_info() + if username is None: + return + + login_form = { + 'szWork': 'login', + 'szType': 'json', + 'szUid': username, + 'szPassword': password, + 'isSaveId': 'false', + 'szScriptVar': 'oLoginRet', + 'szAction': '', + } + + response = self._download_json( + 'https://login.afreecatv.com/app/LoginAction.php', None, + 'Logging in', data=urlencode_postdata(login_form)) + + _ERRORS = { + -4: 'Your account has been suspended due to a violation of our terms and policies.', + -5: 'https://member.afreecatv.com/app/user_delete_progress.php', + -6: 'https://login.afreecatv.com/membership/changeMember.php', + -8: "Hello! AfreecaTV here.\nThe username you have entered belongs to \n an account that requires a legal guardian's consent. \nIf you wish to use our services without restriction, \nplease make sure to go through the necessary verification process.", + -9: 'https://member.afreecatv.com/app/pop_login_block.php', + -11: 'https://login.afreecatv.com/afreeca/second_login.php', + -12: 'https://member.afreecatv.com/app/user_security.php', + 0: 'The username does not exist or you have entered the wrong password.', + -1: 'The username does not exist or you have entered the wrong password.', + -3: 'You have entered your username/password incorrectly.', + -7: 'You cannot use your Global AfreecaTV account to access Korean AfreecaTV.', + -10: 'Sorry for the inconvenience. \nYour account has been blocked due to an unauthorized access. \nPlease contact our Help Center for assistance.', + -32008: 'You have failed to log in. Please contact our Help Center.', + } + + result = int_or_none(response.get('RESULT')) + if result != 1: + error = _ERRORS.get(result, 'You have failed to log in.') + raise ExtractorError( + 'Unable to login: %s said: %s' % (self.IE_NAME, error), + expected=True) + + def _real_extract(self, url): + video_id = self._match_id(url) + + webpage = self._download_webpage(url, video_id) + + if re.search(r'alert\(["\']This video has been deleted', webpage): + raise ExtractorError( + 'Video %s has been deleted' % video_id, expected=True) + + station_id = self._search_regex( + r'nStationNo\s*=\s*(\d+)', webpage, 'station') + bbs_id = self._search_regex( + r'nBbsNo\s*=\s*(\d+)', webpage, 'bbs') + video_id = self._search_regex( + r'nTitleNo\s*=\s*(\d+)', webpage, 'title', default=video_id) + + partial_view = False + for _ in range(2): + query = { + 'nTitleNo': video_id, + 'nStationNo': station_id, + 'nBbsNo': bbs_id, + } + if partial_view: + query['partialView'] = 'SKIP_ADULT' + video_xml = self._download_xml( + 'http://afbbs.afreecatv.com:8080/api/video/get_video_info.php', + video_id, 'Downloading video info XML%s' + % (' (skipping adult)' if partial_view else ''), + video_id, headers={ + 'Referer': url, + }, query=query) + + flag = xpath_text(video_xml, './track/flag', 'flag', default=None) + if flag and flag == 'SUCCEED': + break + if flag == 'PARTIAL_ADULT': + self._downloader.report_warning( + 'In accordance with local laws and regulations, underage users are restricted from watching adult content. ' + 'Only content suitable for all ages will be downloaded. ' + 'Provide account credentials if you wish to download restricted content.') + partial_view = True + continue + elif flag == 'ADULT': + error = 'Only users older than 19 are able to watch this video. Provide account credentials to download this content.' + else: + error = flag + raise ExtractorError( + '%s said: %s' % (self.IE_NAME, error), expected=True) + else: + raise ExtractorError('Unable to download video info') + + video_element = video_xml.findall(compat_xpath('./track/video'))[-1] + if video_element is None or video_element.text is None: + raise ExtractorError( + 'Video %s video does not exist' % video_id, expected=True) + + video_url = video_element.text.strip() + + title = xpath_text(video_xml, './track/title', 'title', fatal=True) + + uploader = xpath_text(video_xml, './track/nickname', 'uploader') + uploader_id = xpath_text(video_xml, './track/bj_id', 'uploader id') + duration = int_or_none(xpath_text( + video_xml, './track/duration', 'duration')) + thumbnail = xpath_text(video_xml, './track/titleImage', 'thumbnail') + + common_entry = { + 'uploader': uploader, + 'uploader_id': uploader_id, + 'thumbnail': thumbnail, + } + + info = common_entry.copy() + info.update({ + 'id': video_id, + 'title': title, + 'duration': duration, + }) + + if not video_url: + entries = [] + file_elements = video_element.findall(compat_xpath('./file')) + one = len(file_elements) == 1 + for file_num, file_element in enumerate(file_elements, start=1): + file_url = url_or_none(file_element.text) + if not file_url: + continue + key = file_element.get('key', '') + upload_date = self._search_regex( + r'^(\d{8})_', key, 'upload date', default=None) + file_duration = int_or_none(file_element.get('duration')) + format_id = key if key else '%s_%s' % (video_id, file_num) + if determine_ext(file_url) == 'm3u8': + formats = self._extract_m3u8_formats( + file_url, video_id, 'mp4', entry_protocol='m3u8_native', + m3u8_id='hls', + note='Downloading part %d m3u8 information' % file_num) + else: + formats = [{ + 'url': file_url, + 'format_id': 'http', + }] + if not formats: + continue + self._sort_formats(formats) + file_info = common_entry.copy() + file_info.update({ + 'id': format_id, + 'title': title if one else '%s (part %d)' % (title, file_num), + 'upload_date': upload_date, + 'duration': file_duration, + 'formats': formats, + }) + entries.append(file_info) + entries_info = info.copy() + entries_info.update({ + '_type': 'multi_video', + 'entries': entries, + }) + return entries_info + + info = { + 'id': video_id, + 'title': title, + 'uploader': uploader, + 'uploader_id': uploader_id, + 'duration': duration, + 'thumbnail': thumbnail, + } + + if determine_ext(video_url) == 'm3u8': + info['formats'] = self._extract_m3u8_formats( + video_url, video_id, 'mp4', entry_protocol='m3u8_native', + m3u8_id='hls') + else: + app, playpath = video_url.split('mp4:') + info.update({ + 'url': app, + 'ext': 'flv', + 'play_path': 'mp4:' + playpath, + 'rtmp_live': True, # downloading won't end without this + }) + + return info diff --git a/youtube_dl/extractor/airmozilla.py b/youtube_dl/extractor/airmozilla.py new file mode 100644 index 000000000..9e38136b4 --- /dev/null +++ b/youtube_dl/extractor/airmozilla.py @@ -0,0 +1,66 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from ..utils import ( + int_or_none, + parse_duration, + parse_iso8601, +) + + +class AirMozillaIE(InfoExtractor): + _VALID_URL = r'https?://air\.mozilla\.org/(?P[0-9a-z-]+)/?' + _TEST = { + 'url': 'https://air.mozilla.org/privacy-lab-a-meetup-for-privacy-minded-people-in-san-francisco/', + 'md5': '8d02f53ee39cf006009180e21df1f3ba', + 'info_dict': { + 'id': '6x4q2w', + 'ext': 'mp4', + 'title': 'Privacy Lab - a meetup for privacy minded people in San Francisco', + 'thumbnail': r're:https?://.*/poster\.jpg', + 'description': 'Brings together privacy professionals and others interested in privacy at for-profits, non-profits, and NGOs in an effort to contribute to the state of the ecosystem...', + 'timestamp': 1422487800, + 'upload_date': '20150128', + 'location': 'SFO Commons', + 'duration': 3780, + 'view_count': int, + 'categories': ['Main', 'Privacy'], + } + } + + def _real_extract(self, url): + display_id = self._match_id(url) + webpage = self._download_webpage(url, display_id) + video_id = self._html_search_regex(r'//vid\.ly/(.*?)/embed', webpage, 'id') + + embed_script = self._download_webpage('https://vid.ly/{0}/embed'.format(video_id), video_id) + jwconfig = self._parse_json(self._search_regex( + r'initCallback\((.*)\);', embed_script, 'metadata'), video_id)['config'] + + info_dict = self._parse_jwplayer_data(jwconfig, video_id) + view_count = int_or_none(self._html_search_regex( + r'Views since archived: ([0-9]+)', + webpage, 'view count', fatal=False)) + timestamp = parse_iso8601(self._html_search_regex( + r'