From b39a6632805441ca046e5d90b6240b8bf1443fe7 Mon Sep 17 00:00:00 2001 From: ubuntu Date: Mon, 9 Dec 2019 00:28:11 -0500 Subject: [PATCH] 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. --- youtube_dl/extractor/twitch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py index 1f3df3112..060dc47a2 100644 --- a/youtube_dl/extractor/twitch.py +++ b/youtube_dl/extractor/twitch.py @@ -617,6 +617,8 @@ class TwitchStreamIE(TwitchBaseIE): title = self._live_title(channel.get('display_name') or channel.get('name')) description = channel.get('status') + game = stream.get('game') or channel.get('game') + thumbnails = [] for thumbnail_key, thumbnail_url in stream['preview'].items(): m = re.search(r'(?P\d+)x(?P\d+)\.jpg$', thumbnail_key) @@ -640,6 +642,7 @@ class TwitchStreamIE(TwitchBaseIE): 'view_count': view_count, 'formats': formats, 'is_live': True, + 'game': game, }