1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-18 12:37:54 +01:00

[twitch] add support for Clip embed URLs

This commit is contained in:
Remita Amine 2019-11-09 09:22:24 +01:00
parent d4f53af482
commit 0b16b3c2d3

View File

@ -644,7 +644,7 @@ class TwitchStreamIE(TwitchBaseIE):
class TwitchClipsIE(TwitchBaseIE): class TwitchClipsIE(TwitchBaseIE):
IE_NAME = 'twitch:clips' IE_NAME = 'twitch:clips'
_VALID_URL = r'https?://(?:clips\.twitch\.tv/(?:[^/]+/)*|(?:www\.)?twitch\.tv/[^/]+/clip/)(?P<id>[^/?#&]+)' _VALID_URL = r'https?://(?:clips\.twitch\.tv/(?:embed\?.*?\bclip=|(?:[^/]+/)*)|(?:www\.)?twitch\.tv/[^/]+/clip/)(?P<id>[^/?#&]+)'
_TESTS = [{ _TESTS = [{
'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat', 'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat',
@ -667,6 +667,9 @@ class TwitchClipsIE(TwitchBaseIE):
}, { }, {
'url': 'https://www.twitch.tv/sergeynixon/clip/StormyThankfulSproutFutureMan', 'url': 'https://www.twitch.tv/sergeynixon/clip/StormyThankfulSproutFutureMan',
'only_matching': True, 'only_matching': True,
}, {
'url': 'https://clips.twitch.tv/embed?clip=InquisitiveBreakableYogurtJebaited',
'only_matching': True,
}] }]
def _real_extract(self, url): def _real_extract(self, url):