expected=True)
def _call_api(self, path, item_id, *args, **kwargs):
- kwargs.setdefault('headers', {})['Client-ID'] = self._CLIENT_ID
+ headers = kwargs.get('headers', {}).copy()
+ headers['Client-ID'] = self._CLIENT_ID
+ kwargs['headers'] = headers
response = self._download_json(
'%s/%s' % (self._API_BASE, path), item_id,
*args, **compat_kwargs(kwargs))
TwitchAllVideosIE,
TwitchUploadsIE,
TwitchPastBroadcastsIE,
- TwitchHighlightsIE))
+ TwitchHighlightsIE,
+ TwitchClipsIE))
else super(TwitchStreamIE, cls).suitable(url))
def _real_extract(self, url):
class TwitchClipsIE(TwitchBaseIE):
IE_NAME = 'twitch:clips'
- _VALID_URL = r'https?://clips\.twitch\.tv/(?:[^/]+/)*(?P<id>[^/?#&]+)'
+ _VALID_URL = r'https?://(?:clips\.twitch\.tv/(?:[^/]+/)*|(?:www\.)?twitch\.tv/[^/]+/clip/)(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://clips.twitch.tv/FaintLightGullWholeWheat',
# multiple formats
'url': 'https://clips.twitch.tv/rflegendary/UninterestedBeeDAESuppy',
'only_matching': True,
+ }, {
+ 'url': 'https://www.twitch.tv/sergeynixon/clip/StormyThankfulSproutFutureMan',
+ 'only_matching': True,
}]
def _real_extract(self, url):