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 Play is broken #26428

Closed
ijbh opened this issue Aug 24, 2020 · 36 comments
Closed

SVT Play is broken #26428

ijbh opened this issue Aug 24, 2020 · 36 comments

Comments

@ijbh
Copy link

@ijbh ijbh commented Aug 24, 2020

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2020.07.28
  • 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

debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.svtplay.se/video/27782111/en-andra-chans', u'--verbose']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.07.28
[debug] Python version 2.7.16 (CPython) - Darwin-19.4.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.2.2, ffprobe 4.2.2, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Using fake IP 78.74.182.000 (SE) as X-Forwarded-For.
[SVTPlay] 27782111: Downloading webpage
ERROR: Unable to extract video id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
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/svt.py", line 229, in _real_extract
webpage, 'video id')
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 1005, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
RegexNotFoundError: Unable to extract video id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Description

Just moments ago youtube-dl stopped working for svtplay.se. It has been working all morning but suddenly stopped this afternoon.

@Sopor
Copy link

@Sopor Sopor commented Aug 24, 2020

  • Finally, put x into all relevant boxes (like this [x]) and not like this [ x]. Checkboxes can easily be ticked once the issue is created :)
@hakanw
Copy link

@hakanw hakanw commented Aug 25, 2020

I can confirm this, the latest version of youtube-dl, and started happening just the last 24 hours.

@Surkal
Copy link
Contributor

@Surkal Surkal commented Aug 25, 2020

In extractor/svt.py, line 227, replace :

svt_id = self._search_regex(
            r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
            webpage, 'video id')

by

svt_id = self._search_regex(
            (r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
             r'"content":\{"id":"([\da-zA-Z-]+)'),
            webpage, 'video id')
@ijbh
Copy link
Author

@ijbh ijbh commented Aug 25, 2020

In extractor/svt.py, line 227, replace :

svt_id = self._search_regex(
            r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
            webpage, 'video id')

by

svt_id = self._search_regex(
            (r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
             r'"content":\{"id":"([\da-zA-Z-]+)'),
            webpage, 'video id')

How would I go about doing this if I'm using brew in Terminal on Mac OS?

@beteetzen
Copy link

@beteetzen beteetzen commented Aug 25, 2020

Thank you for the patch, Surkal

@ijbh: it's not that difficult. Just download the source code, edit the file as Surkal said and call "make" from the main directory of the youtube-dl source. Copy the new youtube-dl to /usr/local/bin and you're done.

I only had to install pandoc using 'brew install pandoc' before make run through.

@ijbh
Copy link
Author

@ijbh ijbh commented Aug 25, 2020

Hm, I will try but I don't really understand any of what you just said.

Will it be in vain waiting for youtube-dl to be updated in brew to reflect these new changes?

@ijbh
Copy link
Author

@ijbh ijbh commented Aug 25, 2020

@beteetzen Can I ask you two questions?

  1. I think I managed to download the source code and edit it. But please explain what you mean by "call "make" from the main directory of the youtube-dl source"? I don't understand that part at all.

  2. The source code I downloaded is in a folder with lots of files within it. The youtube-dl file in /usr/local/bin is different. It has a shortcut icon and won't let me explore it as a folder. Do I just exchange one for the other?

@hakanw
Copy link

@hakanw hakanw commented Aug 25, 2020

I added a pull request for the above fix. Please someone with knowhow about this, take a look at it.

@beteetzen
Copy link

@beteetzen beteetzen commented Aug 25, 2020

@ijbh:
If you have unzipped the archive with the sourcecode to t.ex. ~/Downloads, you have a directory ~/Downloads/youtube-dl

In the Terminal you just go into that directory
cd ~/Downloads/youtube-dl
and then type
make youtube-dl

This will create a new executable file youtube-dl in that directory which you'll have to copy to /usr/local/bin

But I think it will not take too long until the fix will be released if I understand Håkan right.

@TheNorwegian
Copy link

@TheNorwegian TheNorwegian commented Aug 25, 2020

Sorry for not actually contributing; I just want to say thanks to anyone who works on adding a fix to the DL core. Eagerly waiting for the SVT fix (as well as a NRK regionblock fix).

@ijbh
Copy link
Author

@ijbh ijbh commented Aug 25, 2020

@beteetzen That's great. But I like learning how to do this :) I think I understand your explanation!

@TheNorwegian NRK has been a problem for long no? It stopped working for me months ago :(

@TheNorwegian
Copy link

@TheNorwegian TheNorwegian commented Aug 25, 2020

@ijbh The last successfull playlist download from NRK that I did was on August 4th (regionblocked content). I think sometime between mid May and July, single episodes started to fail. Now in mid and late August, even playlists fail.

However, nonregionblocked content still works for me (when downloading from Sweden, I have not tried downloading from a Norwegian computer.)

@ijbh
Copy link
Author

@ijbh ijbh commented Aug 25, 2020

@beteetzen Thanks for your explanation. It worked :)

So what you said about Pandoc is just optional? I didn't seem to need it.

@HenrikElofsson
Copy link

@HenrikElofsson HenrikElofsson commented Aug 26, 2020

I can confirm that the fix from Surkal is working, thanks a lot!

@Tileann
Copy link

@Tileann Tileann commented Aug 28, 2020

Is there a fix for windows?
I tried updating but it still won't work.

@Sopor
Copy link

@Sopor Sopor commented Aug 28, 2020

@Tileann If you can't wait for an update you can always clone youtube-dl (or download it),
edit youtube-dl\youtube_dl\extractor\svt.py and do the above changes.
In the folder youtube-dl\youtube_dl (if you downloaded it the first folder is called youtube-dl-master) you can run it by entering python __main__.py, but you need to install python first if you don't have it installed already.

c:\Projects\youtube-dl\youtube_dl>python __main__.py https://www.svtplay.se/video/27847131/bilakuten/bilakuten-sasong-3-startbilen
[SVTPlay] 27847131: Downloading webpage
[SVTPlay] KRoEnN9: Downloading JSON metadata
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading MPD manifest
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[SVTPlay] KRoEnN9: Downloading m3u8 information
[dashsegments] Total fragments: 79
[download] Destination: Startbilen-KRoEnN9.fdashhbbtv-0.mp4
[download] 100% of 109.14MiB in 00:09
[dashsegments] Total fragments: 79
[download] Destination: Startbilen-KRoEnN9.fdashhbbtv-5.m4a
[download] 100% of 6.84MiB in 00:05
[ffmpeg] Merging formats into "Startbilen-KRoEnN9.mp4"
Deleting original file Startbilen-KRoEnN9.fdashhbbtv-0.mp4 (pass -k to keep)
Deleting original file Startbilen-KRoEnN9.fdashhbbtv-5.m4a (pass -k to keep)
@Tileann
Copy link

@Tileann Tileann commented Aug 28, 2020

@Sopor All I have is a stand alone youtube-dl.exe file.
No other files or folders.

@Sopor
Copy link

@Sopor Sopor commented Aug 28, 2020

@Tileann I understand, but i explained in my previous comment how you should do it. I assume you have some experience in how to use a command prompt when you are using youtube-dl? The only difference is how you run it.

The above download link will download the master branch and not youtube-dl.exe

@r0lle r0lle mentioned this issue Aug 30, 2020
1 of 2 tasks complete
@r0lle
Copy link

@r0lle r0lle commented Aug 30, 2020

In extractor/svt.py, line 227, replace :

svt_id = self._search_regex(
            r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
            webpage, 'video id')

by

svt_id = self._search_regex(
            (r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
             r'"content":\{"id":"([\da-zA-Z-]+)'),
            webpage, 'video id')

Works splendid,
Thanks!
R.

@Minherre
Copy link

@Minherre Minherre commented Aug 31, 2020

Hi!

I'm on a PC with Win10, I have Latest Python 3.8.5 installed, and it's in the System PATH.

I have picked up the youtube-dl-master.zip and unzipped it.
I have changed the file
youtube-dl-master\youtube_dl\extractor\SVT.PY
according to the instructions above.

To what directory do I open a CMD Window (as Admin?!), and How do I then compile (what are the Command Line) a new
youtube-dl.exe file?

/Cheers!

@Sopor
Copy link

@Sopor Sopor commented Sep 1, 2020

@Minherre Open the cmd window in the youtube_dl folder where you find __main__.py. You should not need to run it as an Administrator if you have unpacked the master.zip on your Desktop or in Documents. Do remember that some python scripts don't like spaces in the path, so avoid that if you can.

Type in python __main__.py and press enter and you should see:

>python __main__.py
Usage: __main__.py [OPTIONS] URL [URL...]

__main__.py: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

It you do, it works. You need to copy ffmpeg.exe to this folder too if it is not in your path already.

@Minherre
Copy link

@Minherre Minherre commented Sep 2, 2020

@Sopor: Thank you, but that far I came myself, and it works perfectly well with SVTPLAY.SE now again.

But what I asked for was HOW to create the actual youtube-dl.EXE file ?!

@Sopor
Copy link

@Sopor Sopor commented Sep 3, 2020

@Minherre Why can't you run it with python __main__.py if that works for you? It is quite harder to compile it on Windows, so i leave that to the experts. I see no reason to compile it (py2exe) when it works with python __main__.py.

@Minherre
Copy link

@Minherre Minherre commented Sep 5, 2020

Sopor> @Minherre Why can't you run it with python __main__.py if that works for you? It is quite harder to compile it on Windows, so i leave that to the experts. I see no reason to compile it (py2exe) when it works with python __main__.py.

@Sopor: I can't use your Commandline since that is so Primitive!

Instead I'm using Youtube-DLG on top of Youtube-dl.exe.

"A cross platform front-end GUI of the popular youtube-dl written in wxPython."

Pick it up and read more at:

https://github.com/MrS0m30n3/youtube-dl-gui

Just paste URL after URL into the top windows, then click ADD, and then GO, and it'll pick up URL after URL, three at the time.

If one wants Subs, just use >>Options>Download set on All Available Subs.

And then also >>Options>Extra and there you add:

--convert-subs srt

But this easy way doesn't work if one has to use commandline Python commands.

So unfortunately Youtube-DLG can't be used for certain sites (like Svtplay) until a new Youtube-dl.exe is compiled.

@dstftw dstftw closed this in 5ed05f2 Sep 6, 2020
@Minherre
Copy link

@Minherre Minherre commented Sep 6, 2020

@Minherre @Tileann
I can't guarantee it is working, but try this [youtube-dl.exe]

It did worked for me:

@Sopor: How nice of you to offer a download of a Trojan-INFECTED version of Youtube-dl.exe ... !

https://www.microsoft.com/en-us/wdsi/threats/malware-encyclopedia-description?name=Trojan%3aWin32%2fWacatac.DA!ml&threatid=2147757789

https://howtofix.guide/trojanwin32-wacatac-dml/

The regular Youtube-dl.exe (2020.7.28.0) does not trigger any Anti-Virus programs, but your download triggers them all...
Suck... ( er! )

Always check all downloaded files at

https://virusdesk.kaspersky.com/

and also at

https://www.virustotal.com/#/home/upload

But now Sunday Sept 6 there's a NEW Youtube-dl.exe out, that does NOT Trigger a Trojan Warning, have a look at

https://github.com/ytdl-org/youtube-dl/releases/tag/2020.09.06

Thank you, dstftw !!!

@ytdl-org ytdl-org deleted a comment from Sopor Sep 6, 2020
@Sopor
Copy link

@Sopor Sopor commented Sep 6, 2020

Trojan infected?! I have created the file by myself and i have no trojan in my system. It is of course a false positive.

As you can see here some of them will trigger on the file https://www.virustotal.com/gui/file/a8d717e336c7197f1e998f4fddaa21f02caa04f0c8334156bc5b8ae7d4c22bfa/detection

I have used pyinstaller to create it and it seems to be an issue when using pyinstaller
pyinstaller/pyinstaller#4633
pyinstaller/pyinstaller#2988
pyinstaller/pyinstaller#4852

@dstftw What do you use to create youtube-dl.exe, py2exe?

@ijbh
Copy link
Author

@ijbh ijbh commented Sep 9, 2020

Did anyone else just experience Svtplay stop working again? As if they changed their video path again? (or maybe went back?)

@TheNorwegian
Copy link

@TheNorwegian TheNorwegian commented Sep 9, 2020

ijbh, I experienced that SVTplay worked with YT-DLG yesterday - but not the day before and not today. (Almost as if the functioning .exe was a glitch yesterday, and now back to "normal non functioning" status.)

@ijbh
Copy link
Author

@ijbh ijbh commented Sep 9, 2020

@TheNorwegian For me it has worked without interruption since the above fix two weeks ago. So I think something changed now.

@TheNorwegian
Copy link

@TheNorwegian TheNorwegian commented Sep 9, 2020

Since I use Youtube-DLG only, the above fix was not relevant for me. I am not sure I would be able to apply the fix.

@Surkal
Copy link
Contributor

@Surkal Surkal commented Sep 9, 2020

Here's a quick fix.
I don't guarantee that the downloaded video is the right one every time.

In extractor/svt.py, line 236, replace :

svt_id = self._search_regex(
                (r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
                 r'"content"\s*:\s*{.*?"id"\s*:\s*"([\da-zA-Z-]+)"'),
                webpage, 'video id')

by

svt_id = self._search_regex(
                (r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
                 r'"content"\s*:\s*{.*?"id"\s*:\s*"([\da-zA-Z-]+)"',
                 r'"videoSvtId"\s*:\s*"([\da-zA-Z-]+)"'),
                webpage, 'video id')
@ijbh
Copy link
Author

@ijbh ijbh commented Sep 9, 2020

@Surkal Awesome. Thank you!

@TheNorwegian
Copy link

@TheNorwegian TheNorwegian commented Sep 9, 2020

Where would I find extractor/svt.py ?
I don't have a file or folder called that in my YT-DLG installation folder. (Told you I am not so technical :-) )

@ijbh
Copy link
Author

@ijbh ijbh commented Sep 10, 2020

Here's a quick fix.
I don't guarantee that the downloaded video is the right one every time.

In extractor/svt.py, line 236, replace :

svt_id = self._search_regex(
                (r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
                 r'"content"\s*:\s*{.*?"id"\s*:\s*"([\da-zA-Z-]+)"'),
                webpage, 'video id')

by

svt_id = self._search_regex(
                (r'<video[^>]+data-video-id=["\']([\da-zA-Z-]+)',
                 r'"content"\s*:\s*{.*?"id"\s*:\s*"([\da-zA-Z-]+)"',
                 r'"videoSvtId"\s*:\s*"([\da-zA-Z-]+)"'),
                webpage, 'video id')

I think it should be line 227!

Seems to be working now. Thank you!

@hakanw
Copy link

@hakanw hakanw commented Sep 10, 2020

This fix works! Can someone do a PR to be merged into master?

@0x9fff00 0x9fff00 mentioned this issue Sep 12, 2020
@ytdl-org ytdl-org deleted a comment from blackjack4494 Sep 13, 2020
@Minherre
Copy link

@Minherre Minherre commented Sep 24, 2020

With youtube-dl 2020.09.20 this happens now.

Sept 23:

https://urplay.se/program/214580-nixon-och-skandalerna-nixon-den-enda

[09/23/20 07:23:04] ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)'),))

Sept 24:

https://urplay.se/program/210205-fjaderlatt-och-superstark

[09/24/20 05:51:35] ERROR: Unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)> (caused by URLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)'),))

Perhaps this is the same problem as it was previous with Svtplay, that was fixed then ?!
The Urplay.se site belongs to the same company as Svtplay's site does.

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
10 participants
You can’t perform that action at this time.