Skip to content

Commit

Permalink
[twitch:clips] Extend _VALID_URL (closes #24290) (#24642)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zocker1999NET authored and pareronia committed Jun 22, 2020
1 parent 7866904 commit b2f7f6b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion youtube_dl/extractor/twitch.py
Expand Up @@ -643,7 +643,14 @@ def _real_extract(self, url):

class TwitchClipsIE(TwitchBaseIE):
IE_NAME = 'twitch:clips'
_VALID_URL = r'https?://(?:clips\.twitch\.tv/(?:embed\?.*?\bclip=|(?:[^/]+/)*)|(?:www\.)?twitch\.tv/[^/]+/clip/)(?P<id>[^/?#&]+)'
_VALID_URL = r'''(?x)
https?://
(?:
clips\.twitch\.tv/(?:embed\?.*?\bclip=|(?:[^/]+/)*)|
(?:(?:www|go|m)\.)?twitch\.tv/[^/]+/clip/
)
(?P<id>[^/?#&]+)
'''

_TESTS = [{
'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat',
Expand All @@ -669,6 +676,12 @@ class TwitchClipsIE(TwitchBaseIE):
}, {
'url': 'https://clips.twitch.tv/embed?clip=InquisitiveBreakableYogurtJebaited',
'only_matching': True,
}, {
'url': 'https://m.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank',
'only_matching': True,
}, {
'url': 'https://go.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank',
'only_matching': True,
}]

def _real_extract(self, url):
Expand Down

0 comments on commit b2f7f6b

Please sign in to comment.