Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Twitch] mobile version (m.twitch.tv) support #24290

Closed
Tallefer opened this issue Mar 8, 2020 · 1 comment
Closed

[Twitch] mobile version (m.twitch.tv) support #24290

Tallefer opened this issue Mar 8, 2020 · 1 comment

Comments

@Tallefer
Copy link

@Tallefer Tallefer commented Mar 8, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.03.08
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

 youtube-dl -v https://m.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://m.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.03.08
[debug] Python version 2.7.12 (CPython) - Linux-4.4.95-i686-athlon-with-glibc2.7
[debug] exe versions: ffmpeg 2.8.11, ffprobe 2.8.11, rtmpdump 2.4
[debug] Proxy map: {}
[twitch:stream] rossbroadcast: Downloading stream JSON
ERROR: rossbroadcast is offline
Traceback (most recent call last):
  File "/usr/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/bin/youtube-dl/youtube_dl/extractor/twitch.py", line 582, in _real_extract
    raise ExtractorError('%s is offline' % channel_id, expected=True)
ExtractorError: rossbroadcast is offline

Description

WRITE DESCRIPTION HERE
If you try to use yt-dl on mobile version twitch URLs, e.g. this clip:
https://m.twitch.tv/rossbroadcast/clip/ConfidentBraveHumanChefFrank
they are not working as expected, instead they are all treated as a main channel URL (presumably) and report the link being offline (or starting to play a live stream, if it's online).
Workaround: they are working as intended just after deleting the "m." prefix from the link.

This issue was found after trying to play just a couple of clips by feeding mobile links to mpv, so it can be wider than reported here (not every possible combination of links is tested). Hopefully it can be fixed just by cutting the "m.".

@Zocker1999NET
Copy link
Contributor

@Zocker1999NET Zocker1999NET commented Apr 5, 2020

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

Given this line, the extractor for twitch clips is simply not recognizing links from the mobile version, and it seems looking up the main stream is the fallback action for twitch links. I will change the regular expression to include the mobile versions and test it.

@dstftw dstftw closed this in #24642 Apr 7, 2020
dstftw pushed a commit that referenced this issue Apr 7, 2020
bbepis referenced this issue in animelover1984/youtube-dl May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.