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

SRF (Swiss Televison) broke site #26556

Closed
5 tasks done
habi opened this issue Sep 8, 2020 · 17 comments
Closed
5 tasks done

SRF (Swiss Televison) broke site #26556

habi opened this issue Sep 8, 2020 · 17 comments

Comments

@habi
Copy link
Contributor

habi commented Sep 8, 2020

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.09.06
  • 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
youtube-dl -v https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch\?urn\=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.09.06
[debug] Python version 3.7.7 (CPython) - Darwin-19.6.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.3.1, ffprobe 4.3.1, rtmpdump 2.4
[debug] Proxy map: {}
[generic] alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2: Requesting header
WARNING: Falling back on generic information extractor.
[generic] alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2: Downloading webpage
[generic] alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2: Extracting information
ERROR: Unsupported URL: https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 797, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 3382, in _real_extract
    raise UnsupportedError(url)
youtube_dl.utils.UnsupportedError: Unsupported URL: https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2

Description

I've used youtube-dl before for downloading DOKs from SRF (to watch in the train).
The linked DOK cannot be downloaded with a recent version.

@habi
Copy link
Contributor Author

habi commented Sep 8, 2020

Interestingly, the URL pasted from the address window (https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch\?urn\=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2) does not work when pasted back in the browser.
The URL from the Command-line args (https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2) does work when pasted back in the browser.

@habi
Copy link
Contributor Author

habi commented Sep 8, 2020

youtube-dl https://srf.ch/play/tv/redirect/detail/a763f288-c32a-4352-a33d-ffe5ce114ad2 also does not work.

@habi
Copy link
Contributor Author

habi commented Sep 8, 2020

Related to #26555 :)

@Surkal
Copy link
Contributor

Surkal commented Sep 9, 2020

It's georestricted to Switzerland, but try https://www.srf.ch/play/tv/dok/video/alkohol?id=a763f288-c32a-4352-a33d-ffe5ce114ad2

@github-com-bqm
Copy link

I have the same issue. youtube-dl Worked until yesterday for srf.ch URLs, and it's not working anymore today. I am located in Switzerland. Anything I can do to help debug this issue?

@github-com-bqm
Copy link

I can also confirm, that the file habi is trying to download still worked earlier, sind I successfully downloaded the same video some days back...

@habi
Copy link
Contributor Author

habi commented Sep 9, 2020

It's georestricted to Switzerland, but try https://www.srf.ch/play/tv/dok/video/alkohol?id=a763f288-c32a-4352-a33d-ffe5ce114ad2

I am located in Switzerland with a Swiss ISP.
How can I directly get this URL?
Downloading the video with this URL works as expected.

@github-com-bqm
Copy link

You get this URL by taking the id from your original URL (everything after video: ) and then adding this to this: https://www.srf.ch/play/tv/dok/video/alkohol?id=

I just tried this with another video, and it works!

@github-com-bqm
Copy link

You actually don't have to give the whole keyword "alkohol" in the base part of the URL. One letter is enough. So you can take this as base:

https://www.srf.ch/play/tv/dok/video/a?id=

And then add the id to it, giving you:

https://www.srf.ch/play/tv/dok/video/a?id=a763f288-c32a-4352-a33d-ffe5ce114ad2

@Surkal
Copy link
Contributor

Surkal commented Sep 9, 2020

in extractor/srgssr.py, line 109 :

_VALID_URL = r'''(?x)
                    https?://
                        (?:(?:www|play)\.)?
                        (?P<bu>srf|rts|rsi|rtr|swissinfo)\.ch/play/(?:tv|radio)/
                        (?:
                            [^/]+/(?P<type>video|audio)/[^?]+|
                            popup(?P<type_2>video|audio)player
                        )
                        \?id=(?P<id>[0-9a-f\-]{36}|\d+)
                    '''

This regular expression must be updated to capture new URLs.

@habi
Copy link
Contributor Author

habi commented Sep 9, 2020 via email

@TheRealDude2
Copy link
Contributor

Maybe first workaround. Change the line (line 117 +/- 10) in srgssr.py extractor.
\?id=(?P<id>[0-9a-f\-]{36}|\d+)
to
\?.*(?P<id>[0-9a-f\-]{36})

Tested with the Tagesschau link. I think there will be problems with other links. I will try to add the old style as fallback too.

@github-com-bqm
Copy link

Sorry to have been imprecise:
You get this URL by taking the id from your original URL (everything after video: ) and then adding this to this: https://www.srf.ch/play/tv/dok/video/alkohol?id=
So without manual intervention and manipulation of the URL it‘s not possible?

For the time being you have to manipulate the URL yourself. Or fix the source code as given above, and compile youtube-dl yourself. But since it's now clear what the issue is, and the resolution is straight forward, a fixed version should be released soon...

@github-com-bqm
Copy link

github-com-bqm commented Sep 10, 2020

And it's actually even simpler to change the URL, so that the current regex will pars it: Simply replace the whole
?urn=urn:srf:video:add part with ?id= then it works:

https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch?urn=urn:srf:video:a763f288-c32a-4352-a33d-ffe5ce114ad2

becomes

https://www.srf.ch/play/tv/dok/video/alkohol---der-globale-rausch?id=a763f288-c32a-4352-a33d-ffe5ce114ad2

@TheRealDude2
Copy link
Contributor

I think we have to add an URL to _TESTS for the new URL pattern also. Maybe someone can provide a long living URL accessible from outside CH? I just tested it with the tagesschau URLs and these just living for a few days.

@github-com-bqm
Copy link

Try this one (It's from June. I just tested in on a server in Germany. Doesn't seem to be geo-restricted, and it still works):

https://www.srf.ch/play/tv/meteo/video/abendausgabe?urn=urn:srf:video:c93094be-96a0-43f8-a438-26d128a68805

@TheRealDude2
Copy link
Contributor

TheRealDude2 commented Sep 13, 2020

Thx. Local test works. I add a lazzy testline to the PR. Hope this will be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants