Skip to content

Commit

Permalink
[twitch] add support for Clip embed URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine committed Nov 9, 2019
1 parent d4f53af commit 0b16b3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion youtube_dl/extractor/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def _real_extract(self, url):

class TwitchClipsIE(TwitchBaseIE):
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 = [{
'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat',
Expand All @@ -667,6 +667,9 @@ class TwitchClipsIE(TwitchBaseIE):
}, {
'url': 'https://www.twitch.tv/sergeynixon/clip/StormyThankfulSproutFutureMan',
'only_matching': True,
}, {
'url': 'https://clips.twitch.tv/embed?clip=InquisitiveBreakableYogurtJebaited',
'only_matching': True,
}]

def _real_extract(self, url):
Expand Down

0 comments on commit 0b16b3c

Please sign in to comment.