X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Ftwitch.py;h=948c8ce39e6eb4de1fd4c3746af71f2d8d67a7a7;hb=826a7da808448932d17c09a13a106d75ba0c10d7;hp=f912d3825e65046e33068f34aafce63eaa07f235;hpb=89a683ae745de77f96ac8e82c8ff16d2675fa398;p=youtube-dl.git diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py index f912d3825..948c8ce39 100644 --- a/youtube_dl/extractor/twitch.py +++ b/youtube_dl/extractor/twitch.py @@ -59,13 +59,11 @@ class TwitchBaseIE(InfoExtractor): login_page = self._download_webpage( self._LOGIN_URL, None, 'Downloading login page') - login_form = dict(re.findall( - r'Reset your password<' in response: + self.report_warning('Twitch asks you to reset your password, go to https://secure.twitch.tv/reset/submit') + def _prefer_source(self, formats): try: source = next(f for f in formats if f['format_id'] == 'Source') @@ -345,6 +346,12 @@ class TwitchStreamIE(TwitchBaseIE): 'http://www.twitch.tv/%s/profile' % channel_id, 'TwitchProfile', channel_id) + # Channel name may be typed if different case than the original channel name + # (e.g. http://www.twitch.tv/TWITCHPLAYSPOKEMON) that will lead to constructing + # an invalid m3u8 URL. Working around by use of original channel name from stream + # JSON and fallback to lowercase if it's not available. + channel_id = stream.get('channel', {}).get('name') or channel_id.lower() + access_token = self._download_json( '%s/api/channels/%s/access_token' % (self._API_BASE, channel_id), channel_id, 'Downloading channel access token')