spaam/svtplay-dl

tv4play: you must enter username/password

Closed this issue · 23 comments

svtplay-dl versions:

4.27

Operating system and Python version:

Arch linux Python 3.11.5

What is the issue:

I get an error that I must Username / Password. I've verified the user/password but it still doesn't work. I saw you created a bugfix yesterday but even with the latest version I get the same error.

svtplay-dl --verbose -u uuu -p ppp https://www.tv4play.se/video/1ff5914d6feb69691bca/avsnitt-1
DEBUG [1696945423.9757435] /usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py/get_media: version: 4.27
DEBUG [1696945423.9764135] /usr/local/bin/svtplay-dl/svtplay_dl/service/__init__.py/__init__: service: tv4play
DEBUG [1696945423.9767108] /usr/local/bin/svtplay-dl/svtplay_dl/utils/http.py/request: HTTP getting 'https://www.tv4play.se/video/1ff5914d6feb69691bca/avsnitt-1'
DEBUG [1696945423.9771543] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): www.tv4play.se:443
DEBUG [1696945425.5652184] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://www.tv4play.se:443 "GET /video/1ff5914d6feb69691bca/avsnitt-1 HTTP/1.1" 200 None
DEBUG [1696945425.576328] /usr/local/bin/svtplay-dl/svtplay_dl/utils/http.py/request: HTTP getting 'https://auth.a2d.tv/_bm/get_params?type=web-jsto'
DEBUG [1696945425.5769513] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): auth.a2d.tv:443
DEBUG [1696945425.6634734] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://auth.a2d.tv:443 "GET /_bm/get_params?type=web-jsto HTTP/1.1" 200 227
DEBUG [1696945425.6639805] /usr/local/bin/svtplay-dl/svtplay_dl/utils/http.py/request: HTTP getting 'https://avod-auth-alb.a2d.tv/oauth/authorize'
DEBUG [1696945425.66461] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_new_conn: Starting new HTTPS connection (1): avod-auth-alb.a2d.tv:443
DEBUG [1696945426.10466] /usr/lib/python3.11/site-packages/urllib3/connectionpool.py/_make_request: https://avod-auth-alb.a2d.tv:443 "POST /oauth/authorize HTTP/1.1" 403 296
ERROR [1696945426.105116] /usr/local/bin/svtplay-dl/svtplay_dl/utils/getmedia.py/get_one_media: No videos found. You need username / password.

bah. time to stop updating their website for a while until they have decided how they will do their login stuff.

Yeah, worked for a few hours on 4.27, thank you, but stopped working somewhere between 13:35 and 14:05

they using some bot detection system. maybe need a different way to work around it. worse case we i remove the site from supported sites :)

This is a cat and mouse game ...

It did work for a couple of hours then stopped again.

Yes, the return code for the login is 403 and the message returned:
Access denied
You don't have permission to access http://avod-auth-alb.a2d.tv/oauth/authorize on this server.

If you fix the problem with tv4 again I will happily donate to you again!!

an update. it seems to be working with a more "complicated" workaround. 😄

imagine svtplay-dl-dev/lib ‹ja-vive_la_frenchcore*› » python3 -m svtplay_dl https://www.tv4play.se/video/1ff5914d6feb69691bca/avsnitt-1
INFO: Outfile: robinson.s13e01.robinson.del.1-1ff5914d6feb69691bca-tv4play.ts
INFO: Selected to download hls, bitrate: 7027 format: h264
[0090/1038][======.....................................................................] ETA: 0:00:08^C
imagine svtplay-dl-dev/lib ‹ja-vive_la_frenchcore*› »

Near the bottom of https://www.tv4play.se

"ALLOW_ROBOTS":"true"

@jula420 , i can write that im the king of sweden on my page and it doesn't have to be true in the reality :)

anyway 4.28 is out with a fix and a page https://svtplay-dl.se/tv4play/ about it.

4.28 not available via brew (MAC) and when running a manually compiled version using git:

svtplay-dl --token "ey........" -S --quality 460 --flexible-quality 590 -o 3a9223ebb16a916bc8dd2c38a6ad0a47 https://www.tv4play.se/video/c461838c4a33d6b1432a

/opt/homebrew/bin/svtplay-dl:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').run_script('svtplay-dl==4.28.1', 'svtplay-dl')

ERROR: No videos found. You need a token to access the website. see https://svtplay-dl.se/tv4play/

@rfq-mtorg did you copy the long text string you got from that console output? feels like you didn't do it. it should be a text string that is over 400 characters long

I can verify that it works for me now anyway, with the latest version. I'm running Linux though.

I'm feeling terribly stupid but I can't understand the instructions given in https://svtplay-dl.se/tv4play/
After opening the devtools and choosing the console tab (see screenshot) the instruction says "type in code". Where? How? What code?
"copy the text:
document.cookie
.split("; ")
.find((row) => row.startsWith("tv4-refresh-token="))
?.split("=")[1]; "
Is this the code that should be typed (pasted) in? But where? And how do I get the "ey..." string?

This on Slackware Linux, Vivaldi browser, svtplay-dl-4-28.1

Most grateful for help understanding this.
Screenshot at 2023-10-12 10-02-36

you see the blue-ish arrow > on the white background? put the text there :)

Thanks a lot, sorted!

A perfect workaround, even if it is a bit complicated if you are not that familiar with the different parts. But it will do until they have finished playing around on the other side. (I still can't get the -A flag to work but this is a minor problem.)
The most important thing is that spaam keep up the good work and don't give up. As rfq-mtorg wrote, there are probably more of us who would like to help, but then education and a deeper understanding is required.
Many thanks!

I have browsed around on https://svtplay-dl.se and i can't find any links to https://svtplay-dl.se/tv4play on any page.

I'm i blind or what?

your eyes are perfectly fine becuase there is no link to it on the page because i forgot to add it. maybe i should add it. but im not sure where to link to it. i dont think it should be on the "main" menu on top 🤔

And another thing...

If you never have used the console in Firefox it will warn you with a message that you need to type in tillåt inklistring.

The text is quite tiny and many people doesn't read and understand what they should do (i have helped a couple of friends).

Maybe you could add something about that too?