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

Site support request: clips.twitch.tv #9767

Closed
werid opened this issue Jun 13, 2016 · 5 comments
Closed

Site support request: clips.twitch.tv #9767

werid opened this issue Jun 13, 2016 · 5 comments

Comments

@werid
Copy link

@werid werid commented Jun 13, 2016

Twitch have added a clip-function to their videoplayer, which creates an mp4 file out of the live broadcast and embeds it on its own page, ready to be shared with others.

The generic extractor works, but there's metadata available in the webpage that would be helpful in naming the files when downloading.

Example URLs:

https://clips.twitch.tv/ea/AggressiveCobraPoooound
https://clips.twitch.tv/ea/BusyWhaleSeemsGood

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 13, 2016

Twtich Clips support has been added in youtube-dl 2016.06.14.

@dstftw dstftw reopened this Jun 13, 2016
@dstftw dstftw closed this Jun 13, 2016
@h633537
Copy link

@h633537 h633537 commented Jul 26, 2016

Twitch clips no longer works for me.

[debug] youtube-dl version 2016.07.26.2
[debug] Python version 2.7.12 - Linux-4.6.4-301.fc24.x86_64-x86_64-with-fedora-24-Twenty_Four
[debug] exe versions: ffmpeg 3.1.1, ffprobe 3.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[twitch:clips] AggressiveCobraPoooound: Downloading webpage
ERROR: An extractor error has occurred. (caused by KeyError(u'clip_video_url',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 347, in extract
return self._real_extract(url)
File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/twitch.py", line 488, in _real_extract
video_url = clip['clip_video_url']
KeyError: u'clip_video_url'
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/youtube_dl/YoutubeDL.py", line 682, in extract_info
ie_result = ie.extract(url)
File "/usr/lib/python2.7/site-packages/youtube_dl/extractor/common.py", line 353, in extract
raise ExtractorError('An extractor error has occurred.', cause=e)
ExtractorError: An extractor error has occurred. (caused by KeyError(u'clip_video_url',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@yan12125 yan12125 reopened this Jul 27, 2016
@yan12125 yan12125 added the broken-IE label Jul 27, 2016
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jul 27, 2016

$ youtube-dl -vF "test:twitch:clips"                                 
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-vF', 'test:twitch:clips']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.07.26.2
[debug] Git HEAD: 7935926
[debug] Python version 3.5.2 - Linux-4.6.4-1-ARCH-x86_64-with-arch
[debug] exe versions: ffmpeg 3.1.1, ffprobe 3.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[TestURL] Test URL: https://clips.twitch.tv/ea/AggressiveCobraPoooound
[twitch:clips] AggressiveCobraPoooound: Downloading webpage
ERROR: An extractor error has occurred. (caused by KeyError('clip_video_url',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/home/yen/Projects/youtube-dl/youtube_dl/extractor/common.py", line 347, in extract
    return self._real_extract(url)
  File "/home/yen/Projects/youtube-dl/youtube_dl/extractor/twitch.py", line 488, in _real_extract
    video_url = clip['clip_video_url']
KeyError: 'clip_video_url'
Traceback (most recent call last):
  File "/home/yen/Projects/youtube-dl/youtube_dl/extractor/common.py", line 347, in extract
    return self._real_extract(url)
  File "/home/yen/Projects/youtube-dl/youtube_dl/extractor/twitch.py", line 488, in _real_extract
    video_url = clip['clip_video_url']
KeyError: 'clip_video_url'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/yen/Projects/youtube-dl/youtube_dl/YoutubeDL.py", line 682, in extract_info
    ie_result = ie.extract(url)
  File "/home/yen/Projects/youtube-dl/youtube_dl/extractor/common.py", line 353, in extract
    raise ExtractorError('An extractor error has occurred.', cause=e)
youtube_dl.utils.ExtractorError: An extractor error has occurred. (caused by KeyError('clip_video_url',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
@FichteFoll
Copy link

@FichteFoll FichteFoll commented Jul 28, 2016

The value of clip for the test:

{'broadcaster_display_name': 'EA',
 'broadcaster_id': '25163635',
 'broadcaster_is_partner': True,
 'broadcaster_login': 'ea',
 'broadcaster_twitter_login': '',
 'channel_title': 'EA Play 2016 Live from the Novo Theatre',
 'clip_embed_url': 'https://clips.twitch.tv/embed?clip=ea/AggressiveCobraPoooound',
 'clip_exists': True,
 'clip_origin': 'live',
 'clip_url': 'https://clips.twitch.tv/ea/AggressiveCobraPoooound',
 'curator_display_name': 'stereotype_',
 'curator_login': 'stereotype_',
 'game': 'E3 2016',
 'quality_options': [{'quality': 'source',
                      'source': 'https://clips-media-assets.twitch.tv/21819470352-index-0000001968.mp4'}],
 'slug': 'AggressiveCobraPoooound',
 'vod_id': '72078016',
 'vod_offset': '2h8m30s',
 'vod_preview_image_url': ''}

For a different clip (https://clips.twitch.tv/rflegendary/UninterestedBeeDAESuppy):

{'broadcaster_display_name': 'RFLegendary',
 'broadcaster_id': '37292693',
 'broadcaster_is_partner': True,
 'broadcaster_login': 'rflegendary',
 'broadcaster_twitter_login': '',
 'channel_title': 'RF Legendary - YOLOQUEUE',
 'clip_embed_url': 'https://clips.twitch.tv/embed?clip=rflegendary/UninterestedBeeDAESuppy',
 'clip_exists': True,
 'clip_origin': 'live',
 'clip_url': 'https://clips.twitch.tv/rflegendary/UninterestedBeeDAESuppy',
 'curator_display_name': 'whoisevan95',
 'curator_login': 'whoisevan95',
 'game': 'League of Legends',
 'quality_options': [{'quality': '720',
                      'source': 'https://clips-media-assets.twitch.tv/22544284672-index-0000004656-1280x720.mp4'},
                     {'quality': '480',
                      'source': 'https://clips-media-assets.twitch.tv/22544284672-index-0000004656-852x480.mp4'},
                     {'quality': '360',
                      'source': 'https://clips-media-assets.twitch.tv/22544284672-index-0000004656-640x360.mp4'},
                     {'quality': '1080',
                      'source': 'https://clips-media-assets.twitch.tv/22544284672-index-0000004656.mp4'}],
 'slug': 'UninterestedBeeDAESuppy',
 'vod_id': '80398911',
 'vod_offset': '5h9m58s',
 'vod_preview_image_url': 'https://static-cdn.jtvnw.net/v1/AUTH_system/vods_a3c8/rflegendary_22544284672_491563072/thumb/thumb0-320x240.jpg'}
@dstftw dstftw closed this in 74ba450 Jul 28, 2016
@FichteFoll
Copy link

@FichteFoll FichteFoll commented Jul 29, 2016

Thanks for the fix. Unfortunately, ytdl now auto-selects the lowest-res video:

C:\Users\Fichte>youtube-dl https://clips.twitch.tv/rflegendary/UninterestedBeeDAESuppy -F
[twitch:clips] UninterestedBeeDAESuppy: Downloading webpage
[info] Available formats for UninterestedBeeDAESuppy:
format code  extension  resolution note
1080         mp4        1080p
720          mp4        720p
480          mp4        480p
360          mp4        360p       (best)

Edit: fixed in 0cacae2

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.

None yet
6 participants
You can’t perform that action at this time.