get_element_by_id,
get_element_by_attribute,
ExtractorError,
+ RegexNotFoundError,
unescapeHTML,
unified_strdate,
orderedSet,
(
(?:https?://|//)? # http(s):// or protocol-independent URL (optional)
(?:(?:(?:(?:\w+\.)?[yY][oO][uU][tT][uU][bB][eE](?:-nocookie)?\.com/|
+ (?:www\.)?deturl\.com/www\.youtube\.com/|
+ (?:www\.)?pwnyoutube\.com|
tube\.majestyc\.net/|
youtube\.googleapis\.com/) # the various hostnames, with wildcard subdomains
(?:.*?\#/)? # handle anchor (#/) redirect urls
# Dash webm audio
'171': {'ext': 'webm', 'vcodec': 'none', 'format_note': 'DASH webm audio', 'abr': 48, 'preference': -50},
'172': {'ext': 'webm', 'vcodec': 'none', 'format_note': 'DASH webm audio', 'abr': 256, 'preference': -50},
+
+ # RTMP (unnamed)
+ '_rtmp': {'protocol': 'rtmp'},
}
IE_NAME = u'youtube'
if 'conn' in video_info and video_info['conn'][0].startswith('rtmp'):
self.report_rtmp_download()
- video_url_list = [(None, video_info['conn'][0])]
+ video_url_list = [('_rtmp', video_info['conn'][0])]
elif len(video_info.get('url_encoded_fmt_stream_map', [])) >= 1 or len(video_info.get('adaptive_fmts', [])) >= 1:
encoded_url_map = video_info.get('url_encoded_fmt_stream_map', [''])[0] + ',' + video_info.get('adaptive_fmts',[''])[0]
if 'rtmpe%3Dyes' in encoded_url_map:
if re.search(self._MORE_PAGES_INDICATOR, page) is None:
break
- playlist_title = self._og_search_title(page)
+ try:
+ playlist_title = self._og_search_title(page)
+ except RegexNotFoundError:
+ self.report_warning(
+ u'Playlist page is missing OpenGraph title, falling back ...',
+ playlist_id)
+ playlist_title = self._html_search_regex(
+ r'<h1 class="pl-header-title">(.*?)</h1>', page, u'title')
url_results = self._ids_to_results(ids)
return self.playlist_result(url_results, playlist_id, playlist_title)