Add Youtube game extraction

This commit is contained in:
CommanderRoot 2017-07-26 23:05:49 +02:00 committed by GitHub
parent 9682666bda
commit db6f1fd92e

View File

@ -1567,6 +1567,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
else: else:
video_description = '' video_description = ''
# game
video_game = self._html_search_regex(
r'<h4[^>]+class="title"[^>]*>\s*Game\s*</h4>\s*(<span[^>]*>.*\s*.*\s*.*\s.*\s*</span>\s*)?<ul[^>]*>\s*<li><a[^>]*>(?P<game>.+?)</a></li',
video_webpage, 'game', default=None, group="game")
if video_game is None:
video_game = self._html_search_regex(
r'<h4[^>]+class="title"[^>]*>\s*Game\s*</h4>\s*(<span[^>]*>.*\s*.*\s*.*\s.*\s*</span>\s*)?<ul[^>]*>\s*<li>(?P<game>.+?)( \(<a .*>.*</a>\))?</li',
video_webpage, 'game', default=None, group="game")
if 'multifeed_metadata_list' in video_info and not smuggled_data.get('force_singlefeed', False): if 'multifeed_metadata_list' in video_info and not smuggled_data.get('force_singlefeed', False):
if not self._downloader.params.get('noplaylist'): if not self._downloader.params.get('noplaylist'):
entries = [] entries = []
@ -1950,6 +1959,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
'thumbnail': video_thumbnail, 'thumbnail': video_thumbnail,
'description': video_description, 'description': video_description,
'categories': video_categories, 'categories': video_categories,
'game': video_game,
'tags': video_tags, 'tags': video_tags,
'subtitles': video_subtitles, 'subtitles': video_subtitles,
'automatic_captions': automatic_captions, 'automatic_captions': automatic_captions,