chrippa / livestreamer

Command-line utility that extracts streams from various services and pipes them into a video player of choice. No longer maintained, use streamlink or youtube-dl instead.
http://livestreamer.io/
BSD 2-Clause "Simplified" License
3.88k stars 585 forks source link

error: Unable to validate JSON: Key 'token' not found #1583

Open Duallity opened 7 years ago

Duallity commented 7 years ago

I'm trying to download a VOD with the following command:

livestreamer -o file.mp4 twitch.tv/videos/XXXX best --twitch-oauth-token XXXX --http-header Client-ID=XXXX

I have tried all combinations with and without the token and client id, but the furthest I've gotten is:

[cli][info] Found matching plugin twitch for URL www.twitch.tv/videos/XXXX [plugin.twitch][info] Attempting to authenticate using OAuth token [plugin.twitch][info] Successfully logged in as XXXX error: Unable to validate JSON: Key 'token' not found in {u'status': 301, u'message': u'profile', u'error': u'Moved Permanently'}

Is this a livestreamer issue or user error?

crounial commented 7 years ago

I believe this has to do with how twitch has changed their URLs. I managed to get it to work by manually modifying the URL back to the old style.

NEW URL format (doesn't work): https://www.twitch.tv/videos/110359988 OLD URL format (works): https://www.twitch.tv/zeldaspeedruns/v/110359988

beardypig commented 7 years ago

The new Twitch video URLs are supported by Streamlink, an active Livestreamer fork.

Duallity commented 7 years ago

Thanks, beardypig! Streamlink worked great!

Unfortunately, I wasn't able to use the old URL format that batarlton suggested with livestreamer, as it returned:

error: Unable to open URL: https://api.twitch.tv/api/vods/XXXX/access_token.json (400 Client Error: Bad Request)