This fix adds data, catalogued with 'game', from twitch stream metadata to the formatted output.

This fix resolves github issue #23019, where the user cannot extract the formatted output with %(game)s.
This commit is contained in:
ubuntu 2019-12-09 00:28:11 -05:00
parent d686cab084
commit b39a663280

View File

@ -617,6 +617,8 @@ class TwitchStreamIE(TwitchBaseIE):
title = self._live_title(channel.get('display_name') or channel.get('name')) title = self._live_title(channel.get('display_name') or channel.get('name'))
description = channel.get('status') description = channel.get('status')
game = stream.get('game') or channel.get('game')
thumbnails = [] thumbnails = []
for thumbnail_key, thumbnail_url in stream['preview'].items(): for thumbnail_key, thumbnail_url in stream['preview'].items():
m = re.search(r'(?P<width>\d+)x(?P<height>\d+)\.jpg$', thumbnail_key) m = re.search(r'(?P<width>\d+)x(?P<height>\d+)\.jpg$', thumbnail_key)
@ -640,6 +642,7 @@ class TwitchStreamIE(TwitchBaseIE):
'view_count': view_count, 'view_count': view_count,
'formats': formats, 'formats': formats,
'is_live': True, 'is_live': True,
'game': game,
} }