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

SVT news not working #22897

Closed
robalni opened this issue Oct 29, 2019 · 9 comments
Closed

SVT news not working #22897

robalni opened this issue Oct 29, 2019 · 9 comments

Comments

@robalni
Copy link

@robalni robalni commented Oct 29, 2019

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2019.10.29
  • 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://www.svt.se/nyheter/lokalt/norrbotten/komplicerat-att-stanga-mr-kameran'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.svt.se/nyheter/lokalt/norrbotten/komplicerat-att-stanga-mr-kameran']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.10.29
[debug] Python version 3.7.3 (CPython) - Linux-4.19.0-6-amd64-x86_64-with-debian-10.1
[debug] exe versions: ffmpeg 4.1.4-1, ffprobe 4.1.4-1, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[SVTPage] komplicerat-att-stanga-mr-kameran: Downloading webpage
[download] Downloading playlist: MR-kameran fortfarande igång – komplicerad avstängning påbörjad
[SVTPage] playlist MR-kameran fortfarande igång – komplicerad avstängning påbörjad: Collected 0 video ids (downloading 0 of them)
[download] Finished downloading playlist: MR-kameran fortfarande igång – komplicerad avstängning påbörjad

Description

SVT news videos have recently stopped working.

Example that doesn't work: https://www.svt.se/nyheter/lokalt/norrbotten/komplicerat-att-stanga-mr-kameran

The video that should be played can be found in this JSON file: https://api.svt.se/videoplayer-api/video/24256474

The id 4256474 can be found in the source of the page.

Here is an example with multiple videos on one page: https://www.svt.se/nyheter/utrikes/svenska-andrea-ar-en-mil-fran-branderna-i-kalifornien

The video ids are 24244546 and 24246318.

@Rodondo2000

This comment was marked as off-topic.

@b9AcE
Copy link

@b9AcE b9AcE commented Nov 29, 2019

After the described change, there are 0 formats to select from, although obviously there is video on their pages.

~/tmp$ youtube-dl -v -F https://www.svt.se/nyheter/lokalt/norrbotten/komplicerat-att-stanga-mr-kameran
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://www.svt.se/nyheter/lokalt/norrbotten/komplicerat-att-stanga-mr-kameran']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2019.11.28
[debug] Python version 2.7.13 (CPython) - Linux-4.19.0-0.bpo.5-amd64-x86_64-with-debian-9.11
[debug] exe versions: ffmpeg 3.2.14-1, ffprobe 3.2.14-1
[debug] Proxy map: {}
[SVTPage] komplicerat-att-stanga-mr-kameran: Downloading webpage
[download] Downloading playlist: MR-kameran fortfarande igång – komplicerad avstängning påbörjad
[SVTPage] playlist MR-kameran fortfarande igång – komplicerad avstängning påbörjad: Collected 0 video ids (downloading 0 of them)
[download] Finished downloading playlist: MR-kameran fortfarande igång – komplicerad avstängning påbörjad

Same page as described above, with youtube-dl updated just before the "-v -F" run.
The change now seems to affect all videos on SVT's news section. Zero formats to select from.

@robalni
Copy link
Author

@robalni robalni commented Dec 17, 2019

Here is a workaround as a bash function until this has been fixed:

function svt {
    content=$(curl "$1")
    id=$(echo "$content" | sed -nr 's/^.*"media":\[\{"id":([0-9][0-9]*).*$/\1/gp')
    url=$(curl "https://api.svt.se/videoplayer-api/video/$id" | jq -r '.videoReferences[0].url')
    mpv "$url"
}

Just give the function the URL of the page as argument. I am currently using this function and it works for me.

@b9AcE
Copy link

@b9AcE b9AcE commented Dec 17, 2019

Finally some progress on this.
Thank you robalni!

@grunge10111
Copy link

@grunge10111 grunge10111 commented Jan 25, 2020

I know I'm late to the party, but does that function work for Windows too? I'm a complete noob when it comes to these kind of things and I could really use some help.

@robalni
Copy link
Author

@robalni robalni commented Jan 25, 2020

The bash functions works if you have bash and the right programs installed (sed, curl, mpv, jq). If you don't know, you can just try it and see if it works. I would not expect it to work on a clean install of any operating system, especially not Windows.

@b9AcE
Copy link

@b9AcE b9AcE commented Jan 25, 2020

Well, it doesn't have to be passed to mpv.
I converted the BASH-function by @robalni to a tiny script:

#!/bin/bash

# svdl, version 1

# Workaround wrapper for youtube-dl to download SVT News videos.
# Requires "jq", "ffdshow"/"avconv" and "curl".
# Must be through BASH, not SH.

content=`curl -s "$1"`
id=`echo "$content" | sed -nr 's/^.*"media":\[\{"id":([0-9][0-9]*).*$/\1/gp'`
url=`curl -s "https://api.svt.se/videoplayer-api/video/$id" | jq -r '.videoReferences[0].url'`
youtuve-dl "$url"

The "youtube-dl" on the last line can instead be "echo" to get a URL that works as input for youtube-dl, in case you want to do more things first, like choose format to download.

Verified working both in cygwin and in "Windows Subsystem for Linux" Kali as long as the listed software requirements are installed.

@grunge10111
Copy link

@grunge10111 grunge10111 commented Jan 25, 2020

I'll give that a try. Thanks so much for the help guys!

bbepis referenced this issue in animelover1984/youtube-dl Feb 6, 2020
bbepis referenced this issue in animelover1984/youtube-dl Feb 27, 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.

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