ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.99k stars 10.01k forks source link

SVT news not working #22897

Closed robalni closed 4 years ago

robalni commented 4 years ago

Checklist

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 commented 4 years ago

I do not know whether this is the same problem as described in #22919 . As it too is about SVT.se I put it in here to avoid redundancy.

Description of the problem:

Download in general from SVT.se is no longer working whilst youtube.dl works on other sites without any problems. It is not a very long time ago that youtube.dl did work on SVT.se. The actual errormessages:

[SVTPlay] K5wvW13: Downloading m3u8 information ERROR: requested format not available Traceback (most recent call last): File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp7hc5a09v\build\youtube_dl\YoutubeDL.py", line 807, in extract_info File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp7hc5a09v\build\youtube_dl\YoutubeDL.py", line 862, in process_ie_result File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp7hc5a09v\build\youtube_dl\YoutubeDL.py", line 1635, in process_video_result youtube_dl.utils.ExtractorError: requested format not available

Thanks for your dedication! YT is great.

remitamine commented 4 years ago

@Rodondo2000 read https://github.com/ytdl-org/youtube-dl#format-selection.

b9AcE commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Finally some progress on this. Thank you robalni!

grunge10111 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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