streamlink / streamlink

Streamlink is a CLI utility which pipes video streams from various services into a video player
https://streamlink.github.io/
BSD 2-Clause "Simplified" License
10.06k stars 1.11k forks source link

YuppTV - Invalid captcha token #3094

Closed mytee12 closed 4 years ago

mytee12 commented 4 years ago

Plugin Issue

YuppTV seems to have added some sort of login captcha (looks to be Google's recaptcha) which is preventing logging into the website and getting access to paid/premium streams. Free streams which do not require login still work. I am willing to provide an account temporarily for anyone that might be interested in fixing this. They will need a UK IP during testing.

Reproduction steps / Explicit stream URLs to test

  1. Use relevant Streamlink parameters for premium stream requiring login. streamlink --yupptv-email=myemail@gmail.com --yupptv-password=password123 --http-no-ssl-verify https://www.yupptv.com/channels/star-plus-uk/live

  2. Failed Login and no stream output.

Log output

**Premium stream requiring login** (Does not work)

C:\Users\*****>streamlink --yupptv-email=myemail@gmail.com --yupptv-password=password123  --http-no-ssl-verify https://www.yupptv.com/channels/star-plus-uk/live --loglevel debug
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.6.6
[cli][debug] Streamlink: 1.5.0
[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
[cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/star-plus-uk/live
[cli][debug] Plugin specific arguments:
[cli][debug]  --yupptv-email=myemail@gmail.com (email)
[cli][debug]  --yupptv-password=*****  (password)
[plugin.yupptv][error] Failed to login: Invalid  captcha token (code: 403)
[plugin.yupptv][error] This stream requires you to login
error: No playable streams found on this URL: https://www.yupptv.com/channels/star-plus-uk/live

**Free stream not requiring login**  (Does work)

C:\Users\*****>streamlink --http-no-ssl-verify https://www.yupptv.com/channels/aajtak/live best --loglevel debug
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.6.6
[cli][debug] Streamlink: 1.5.0
[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
[cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/aajtak/live
[utils.l10n][debug] Language code: en_GB
[cli][info] Available streams: 216p (worst), 270p, 288p, 396p, 406p (best)
[cli][info] Opening stream: 406p (hls)
[stream.hls][debug] Reloading playlist
[stream.hls][debug] First Sequence: 9065; Last Sequence: 9094
[stream.hls][debug] Start offset: 0; Duration: None; Start Sequence: 9092; End Sequence: None
[stream.hls][debug] Adding segment 9092 to queue
[cli][debug] Pre-buffering 8192 bytes
[stream.hls][debug] Adding segment 9093 to queue
[stream.hls][debug] Adding segment 9094 to queue
[cli][info] Starting player: "C:\Program Files\VideoLAN\VLC\vlc.exe"
[stream.hls][debug] Download of segment 9092 complete
[cli.output][debug] Opening subprocess: "C:\Program Files\VideoLAN\VLC\vlc.exe" --input-title-format https://www.yupptv.com/channels/aajtak/live -
[stream.hls][debug] Download of segment 9093 complete
[cli][debug] Writing stream to output
...

Additional comments, screenshots, etc.

Love Streamlink? Please consider supporting our collective. Thanks!

mkbloke commented 4 years ago

It might be possible to sidestep this by providing the right login cookie to streamlink and passing it via the --http-cookie parameter on the command line.

The first thing you would need to do is identify the cookie. In Firefox (after logging in to YuppTV in the browser), you can open the debugger with F12, then click the Storage tab. You should look for cookie names that have words like sess, session, user, token, auth in them under yupptv.com in the left window pane.

You can click on each cookie to get details in a right window pane. Let's say you find a likely candidate called authtoken with a value of randomstring. You could then try this:

streamlink --http-cookie authtoken=randomstring --http-no-ssl-verify https://www.yupptv.com/channels/star-plus-uk/live --loglevel debug

It's likely that if this works, the token will eventually expire, in which case you will have to renew it by logging in again via the browser and replacing the old randomstring value with the new one.

mkbloke commented 4 years ago

Additional tip: if you open the debugger before logging in, then log in and then log out again, while keeping the debugger open, the cookies which are modified will be highlighted briefly in the cookie list window pane, new cookies will appear and deleted cookies will disappear.

mytee12 commented 4 years ago

Unfortunately, whatever tokens I used I got the same result. I don't know if this is caused by the stream plugin refusing to continue without login parameters on a premium stream or because this method simply wont work.

C:\Users*****>streamlink --http-cookie 'abc=123' --http-no-ssl-verify https://www.yupptv.com/channels/star-plus-uk/live best --loglevel debug [cli][debug] OS: Windows 10 [cli][debug] Python: 3.6.6 [cli][debug] Streamlink: 1.5.0 [cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0) [cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/star-plus-uk/live [plugin.yupptv][error] This stream requires you to login error: No playable streams found on this URL: https://www.yupptv.com/channels/star-plus-uk/live

bastimeyer commented 4 years ago

I don't know if this is caused by the stream plugin refusing to continue without login parameters on a premium stream

The login will only be done if plugin parameters for the email and password are set: https://github.com/streamlink/streamlink/blob/1.5.0/src/streamlink/plugins/yupptv.py#L62-L67

And the login itself only fetches cookies from the login request, which are then stored on the HTTP session for the next requests: https://github.com/streamlink/streamlink/blob/1.5.0/src/streamlink/plugins/yupptv.py#L40-L57

This means that you'll have to figure out the cookies yourself or set everything your web browser has set via the --http-cookie or --http-header parameters. Note that the plugin performs its login up to three times, until all other devices are logged out, as reported by the site.

Regarding the plugin's login parameters themselves, they are now useless due to the new captcha codes added by the streaming site and thus need to be removed, as there is no way around that for Streamlink.

If someone figures out which exact cookies are needed, a new plugin parameter could be added, similar to #2840.

mytee12 commented 4 years ago

I've not had any luck tinkering so If anyone is willing to take a look, I can provide a account.

mkbloke commented 4 years ago

@mytee12, I have some work in progress on this. I'll ping you on here when I have something ready for testing.

mkbloke commented 4 years ago

Many thanks to @bastimeyer for pointing me to the pixiv plugin. The code was very useful. I mostly just copied and pasted the cookie code with a few modifications, as necessary.

@mytee12, I now have an updated yupptv plugin ready for testing. You can get it from:

https://github.com/mkbloke/streamlink/blob/yupptv-site-change-2020-08/src/streamlink/plugins/yupptv.py

On that page, just select 'Raw', then 'File/Save Page As' in your browser. You can backup the old plugin if you like, although as it doesn't work, there's probably not much point, then copy or move the newly downloaded plugin into your local streamlink plugins directory.

If you could help with testing by following the test regime I'm outlining below, it would very much be appreciated, thanks.

There's no need to report any output if the plugin works as expected, but debug output for tests that don't perform as expected would be very useful.

[Updated to add: include the --http-no-ssl-verify option to the testing regime command lines below if it's necessary for your system]

Firstly, let's try without authentication:

streamlink -l debug https://www.yupptv.com/channels/aajtak/live best Should play without any errors.

streamlink -l debug https://www.yupptv.com/channels/star-plus-uk/live best Should show:

[plugin.yupptv][error] This stream requires you to login
error: No playable streams found on this URL: https://www.yupptv.com/channels/star-plus-uk/live

There are two cookies required for login to YuppTV, these are BoxId and YuppflixToken. As detailed in my post above, you can extract the required values for each of these via the browser. Here are examples of what they should look like:

BoxId 519a4cdaedee4d53 YuppflixToken YT-8b5fae6b-d794-4beb-431c-36012f3b198f

When you have the cookie values for a given session, you must leave it logged in within the browser, i.e. do not click 'Logout` on the YuppTV website, otherwise you'll invalidate the credendtials. I'm going to use my example cookie values below, but you should of course replace them with the ones you have obtained from your session.

This updated plugin now caches your cookie values which are used to access YuppTV. That means you only need to specify them once on the command line, unless you need to update them (more on that below).

streamlink -l debug --yupptv-boxid 519a4cdaedee4d53 --yupptv-yuppflixtoken YT-8b5fae6b-d794-4beb-431c-36012f3b198f https://www.yupptv.com/channels/aajtak/live best Should play without any errors.

Now that the credentials are cached and if your YuppTV subscription package allows you to play it (I'm assuming from your original post that it should):

streamlink -l debug https://www.yupptv.com/channels/star-plus-uk/live best Should play using the cached credentials without any errors.

I don't know what subscription you have, but if you can find any content that requires further subscription, then:

streamlink -l debug https://www.yupptv.com/a-link-to-content-requiring-further-subscription best Should in theory show:

[plugin.yupptv][debug] Attempting to authenticate using cached cookies
[plugin.yupptv][error] This stream requires a subscription
error: No playable streams found on this URL: https://www.yupptv.com/a-link-to-content-requiring-further-subscription

If, when using this updated plugin, you encounter output like:

[plugin.yupptv][debug] Attempting to authenticate using cached cookies
[plugin.yupptv][error] This device requires renewed credentials to log in
error: No playable streams found on this URL: https://www.yupptv.com/channels/aajtak/live

it means that the cached credentials are no longer considered valid by the YuppTV website. This could be because:

In that case, you will need to renew the credentials by logging in again with a browser, extracting the new BoxId and YuppflixToken values, then start streamlink with the parameters shown below to update the cached credentials:

streamlink --yupptv-purge-credentials --yupptv-boxidmy_new_boxid_value--yupptv-yuppflixtokenmy_new_yuppflixtoken_valuehttps://www.yupptv.com/channels/aajtak/live best

If you just want to remove the cached credentials for the plugin, you can just use:

streamlink --yupptv-purge-credentials https://www.yupptv.com/channels/aajtak/live

You can use any YuppTV URL that is recognised by the plugin in the above examples when using the credentials options. If you do not wish to play any content after using the credentials options, just use the URL and do not specify the second command line argument, i.e. the stream quality, as shown in the --yupptv-purge-credentials example immediately above.

Finally, here's a last note on this updated plugin:

The previous plugin featured the ability to logout other devices, but this plugin can no longer do that. It's a catch-22 situation. If you have logged in via another device and forced logout of other devices, you are invalidating the credentials cached by streamlink for YuppTV access. When you log in via a browser, you first authenticate via the login form, but that involves Google reCAPTCHA, which cannot be done by a streamlink plugin, therefore the plugin cannot authenticate to get to the option of logging out other devices. This means that if you log into YuppTV on another device and force the logout of other devices, you will see:

[plugin.yupptv][debug] Attempting to authenticate using cached cookies
[plugin.yupptv][error] This device requires renewed credentials to log in
error: No playable streams found on this URL: https://www.yupptv.com/channels/aajtak/live

when you next attempt to use the streamlink plugin and you will have to go through the process of specifying renewed cookie values as detailed above.

mytee12 commented 4 years ago

Highly appreciate your efforts.

  1. Free stream without any cached credentials. Works.
C:\Users\*>streamlink -l debug --http-no-ssl-verify https://www.yupptv.com/channels/aajtak/live best
[session][debug] Plugin yupptv is being overridden by C:\Users\*\AppData\Roaming\streamlink\plugins\yupptv.py
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.6.6
[cli][debug] Streamlink: 1.5.0
[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
[cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/aajtak/live
[utils.l10n][debug] Language code: en_GB
[cli][info] Available streams: 216p (worst), 270p, 288p, 396p, 406p (best)
[cli][info] Opening stream: 406p (hls)
[stream.hls][debug] Reloading playlist
[stream.hls][debug] First Sequence: 9282; Last Sequence: 9311
...

Unfortunately, I am not able to get past the step of using a free stream with the boxid and yuppflixtoken parameters. Here are my steps:

  1. Clear credentials.
C:\Users\*>streamlink -l debug --http-no-ssl-verify --yupptv-purge-credentials https://www.yupptv.com/channels/aajtak/live
[session][debug] Plugin yupptv is being overridden by C:\Users\*\AppData\Roaming\streamlink\plugins\yupptv.py
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.6.6
[cli][debug] Streamlink: 1.5.0
[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
[cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/aajtak/live
[cli][debug] Plugin specific arguments:
[cli][debug]  --yupptv-purge-credentials=True (purge_credentials)
[plugin.yupptv][info] All credentials were successfully removed
[utils.l10n][debug] Language code: en_GB
Available streams: 216p (worst), 270p, 288p, 396p, 406p (best)
  1. Retrieve new boxid and yuppflixtoken from website. Not logging out.

  2. Use new tokens with plugin.

C:\Users\*>streamlink -l debug --http-no-ssl-verify --yupptv-boxid '****' --yupptv-yuppflixtoken 'YT-****' https://www.yupptv.com/channels/aajtak/live best
[session][debug] Plugin yupptv is being overridden by C:\Users\*\AppData\Roaming\streamlink\plugins\yupptv.py
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.6.6
[cli][debug] Streamlink: 1.5.0
[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
[cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/aajtak/live
[cli][debug] Plugin specific arguments:
[cli][debug]  --yupptv-boxid=******** (boxid)
[cli][debug]  --yupptv-yuppflixtoken=******** (yuppflixtoken)
[plugin.yupptv][debug] Saved cookies: BoxId, YuppflixToken
[plugin.yupptv][info] Successfully set BoxId and YuppflixToken
[plugin.yupptv][error] This device requires renewed credentials to log in
error: No playable streams found on this URL: https://www.yupptv.com/channels/aajtak/live

And of course, I get the same result with a premium stream.

I tried many times with new fresh credentials. If I tested the boxid/yuppflixtoken and manually set them in a clean Firefox session, they were active and allowed me to login bypassing the captcha.

mkbloke commented 4 years ago

Hi @mytee12, many thanks for the feedback.

I have pushed a small change to the plugin, which can again be downloaded from:

https://github.com/mkbloke/streamlink/blob/yupptv-site-change-2020-08/src/streamlink/plugins/yupptv.py

This is a bit of a shot in the dark and based purely on a hunch, but this small modification calls the signin URL, which I notice sets various cookies in its response. It's possible some of these could be relevant for somebody with an account that has subscribed packages on YuppTV.

It might be best to start with --yupptv-purge-credentials, then follow the test regime as before. Thanks.

mytee12 commented 4 years ago

Same result with the new changes sadly.

C:\Users\*>streamlink --http-no-ssl-verify -l debug --yupptv-boxid '*' --yupptv-yuppflixtoken '*' https://www.yupptv.com/channels/aajtak/live best
[session][debug] Plugin yupptv is being overridden by C:\Users\*\AppData\Roaming\streamlink\plugins\yupptv.py
[cli][debug] OS:         Windows 10
[cli][debug] Python:     3.6.6
[cli][debug] Streamlink: 1.5.0
[cli][debug] Requests(2.24.0), Socks(1.7.1), Websocket(0.57.0)
[cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/aajtak/live
[cli][debug] Plugin specific arguments:
[cli][debug]  --yupptv-boxid=******** (boxid)
[cli][debug]  --yupptv-yuppflixtoken=******** (yuppflixtoken)
[plugin.yupptv][debug] Saved cookies: BoxId, YuppflixToken
[plugin.yupptv][info] Successfully set BoxId and YuppflixToken
[plugin.yupptv][error] This device requires renewed credentials to log in
error: No playable streams found on this URL: https://www.yupptv.com/channels/aajtak/live
mkbloke commented 4 years ago

@mytee12, I think I've got it - I'm an idiot! I managed to reproduce what you're seeing by booting into Windows 10 and testing it there...

I've reverted the last commit to the plugin, so if you can download it again from:

https://github.com/mkbloke/streamlink/blob/yupptv-site-change-2020-08/src/streamlink/plugins/yupptv.py

and go through the testing regime again, it would be much appreciated. This time, you'll note that none of the command lines shown place single quotes around the values specified for the cookie parameters. It turns out, that under Windows, the single quotes are saved as part of the cookie value - doh! I will remember that for the future!

Cheers.

Updated to add: maybe start the testing again with --yupptv-purge-credentials, then add the credentials back during the test regime, but without the single quotes (obviously) this time!

mytee12 commented 4 years ago

I can confirm that we have lift off! Both free and premium stream are working. Thank you very much @mkbloke I will update on how long the tokens take to expire for anyone who is interested in knowing.

To clarify for any others, your commands should be like the following, replacing the random strings 342a4cqwedey4d73 and YT-7h2fae6b-u643-5ctc-483f-11856f3b155p with the appropriate tokens and the stream link of your choosing e.g.

streamlink --http-no-ssl-verify -l debug --yupptv-boxid 342a4cqwedey4d73 --yupptv-yuppflixtoken YT-7h2fae6b-u643-5ctc-483f-11856f3b155p https://www.yupptv.com/channels/star-plus-uk/live best

To get the tokens... use Firefox and log into your YuppTV account, press F12 on your keyboard and go to the Storage tab at the top. You should see the cookies section and go to yupptv.com. Copy the Value of BoxId and YuppflixToken and use them in your streamlink parameters above. Make sure you do not click the logout button on YuppTV website, instead just close it.

mkbloke commented 4 years ago

That's excellent news. Thanks for the testing, @mytee12.

Just to reiterate, it should only be necessary to use the --yupptv-boxid and --yupptv-yuppflixtoken options once while the cookie values remain valid. It should be possible to simply use (with --http-no-ssl-verify if necessary on your system):

streamlink https://www.yupptv.com/channels/star-plus-uk/live best

for as long as you have valid credentials cached. I've updated https://github.com/streamlink/streamlink/issues/3094#issuecomment-672554453 appropriately within this thread, so the info on renewing with: --yupptv-purge-credentials, --yupptv-boxid my_new_boxid_value and --yupptv-yuppflixtoken my_new_yuppflixtoken_value also applies, as does using --yupptv-purge-credentials on its own to clear the cached credentials.

limiteddi commented 4 years ago

How long do login and stream cookies last? Last time I tried got the account banned but it may be because runit was executing too many times? What's the best way to set up a stream?

mkbloke commented 4 years ago

How long do login and stream cookies last?

Try it and see, or wait and see if mytee12 gets back with that information.

What's the best way to set up a stream?

I'm not quite sure what you mean. With reference to the instructions above, having stored the credentials, you just run streamlink with the URL and stream as command line arguments. You can find the available streams by running streamlink with just the URL argument.

mkbloke commented 4 years ago

I've looked at the expires values for the cookies I have and it seems to indicate that the cookies are valid for 7 days.

mytee12 commented 4 years ago

How long do login and stream cookies last?

I've looked at the expires values for the cookies I have and it seems to indicate that the cookies are valid for 7 days.

I had to renew my tokens today to check for sure but I used them for 8 days. Checking BoxId and YuppflixToken in Chrome shows an expiration of 180 days : 2021-02-17T14:20:16.313Z

Last time I tried got the account banned but it may be because runit was executing too many times?

I've been using this addon for over 6 months via LiveProxy

mkbloke commented 4 years ago

Thanks for coming back on the cookie expiry.

I've looked at the expires values for the cookies I have and it seems to indicate that the cookies are valid for 7 days.

I've retracted that in the post above. I was looking at the wrong thing, so it's incorrect.

limiteddi commented 4 years ago

How long do login and stream cookies last?

I've looked at the expires values for the cookies I have and it seems to indicate that the cookies are valid for 7 days.

I had to renew my tokens today to check for sure but I used them for 8 days. Checking BoxId and YuppflixToken in Chrome shows an expiration of 180 days : 2021-02-17T14:20:16.313Z

Last time I tried got the account banned but it may be because runit was executing too many times?

I've been using this addon for over 6 months via LiveProxy

Thank you. I'll try that. What exactly is the purpose of LiveProxy in this case?

mytee12 commented 4 years ago

What exactly is the purpose of LiveProxy in this case?

LiveProxy allows me to essentially have a Streamlink server running in my home network and use Streamlink on devices where installing Streamlink might not be possible or elegant. I currently use an android box I had laying around as a Streamlink server.

It also lets me create a easy to use M3U playlist with Streamlink/Liveproxy urls consisting of YuppTV channels. In my case I use the M3U playlist with an IPTV player app on a Firestick, a much more user friendly experience.

limiteddi commented 4 years ago

Thanks guys. Really appreciate your hard work!

limiteddi commented 4 years ago

Folks, do you by any chance experience a similar issue? 1 channel in particular Sony UK HD is throwing 404(i removed token details) error but after I restart the session it starts working

2020-09-14_21:27:23.34232 [stream.hls][debug] Download of segment 50405 complete 2020-09-14_21:27:29.14064 [stream.hls][debug] Reloading playlist 2020-09-14_21:27:32.23414 [stream.hls][debug] Reloading playlist 2020-09-14_21:27:34.74914 [stream.hls][warning] Failed to reload playlist: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:27:37.75189 [stream.hls][debug] Reloading playlist 2020-09-14_21:27:40.12936 [stream.hls][warning] Failed to reload playlist: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:27:43.13188 [stream.hls][debug] Reloading playlist 2020-09-14_21:27:45.70842 [stream.hls][warning] Failed to reload playlist: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:27:48.71147 [stream.hls][debug] Reloading playlist 2020-09-14_21:27:51.09119 [stream.hls][warning] Failed to reload playlist: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:27:54.09427 [stream.hls][debug] Reloading playlist 2020-09-14_21:27:56.69180 [stream.hls][warning] Failed to reload playlist: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:27:59.69504 [stream.hls][debug] Reloading playlist 2020-09-14_21:28:02.07630 [stream.hls][warning] Failed to reload playlist: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:28:04.02787 [stream.segmented][debug] Closing worker thread 2020-09-14_21:28:04.02789 [stream.segmented][debug] Closing writer thread 2020-09-14_21:28:04.02790 [cli][info] Stream ended 2020-09-14_21:28:04.02790 Interrupted! Exiting... 2020-09-14_21:28:04.02790 [cli][info] Closing currently open stream... 2020-09-14_21:28:04.02791 Failed to load plugin ustvnow: 2020-09-14_21:28:04.02791 File "/usr/lib/python3.7/imp.py", line 234, in load_module 2020-09-14_21:28:04.02792 return load_source(name, filename, file) 2020-09-14_21:28:04.02792 File "/usr/lib/python3.7/imp.py", line 171, in load_source 2020-09-14_21:28:04.02792 module = _load(spec) 2020-09-14_21:28:04.02793 File "<frozen importlib._bootstrap>", line 696, in _load 2020-09-14_21:28:04.02793 File "<frozen importlib._bootstrap>", line 677, in _load_unlocked 2020-09-14_21:28:04.02793 File "<frozen importlib._bootstrap_external>", line 728, in exec_module 2020-09-14_21:28:04.02794 File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed 2020-09-14_21:28:04.02794 File "/usr/local/lib/python3.7/dist-packages/streamlink-1.3.1+182.gb3132d7-py3.7.egg/streamlink/plugins/ustvnow.py", line 12, in <module> 2020-09-14_21:28:04.02794 from Crypto.Util.Padding import pad, unpad 2020-09-14_21:28:04.02795 ModuleNotFoundError: No module named 'Crypto.Util.Padding' 2020-09-14_21:28:04.02795 2020-09-14_21:30:02.95929 [plugin.yupptv][debug] Restored cookies: BoxId, YuppflixToken 2020-09-14_21:30:02.96410 [cli][info] streamlink is running as root! Be careful! 2020-09-14_21:30:02.96517 [cli][debug] OS: Linux-4.19.0-10-amd64-x86_64-with-debian-10.5 2020-09-14_21:30:02.96530 [cli][debug] Python: 3.7.3 2020-09-14_21:30:02.96540 [cli][debug] Streamlink: 1.3.1+182.gb3132d7 2020-09-14_21:30:02.96550 [cli][debug] Requests(2.21.0), Socks(1.6.7), Websocket(0.53.0) 2020-09-14_21:30:02.96574 [cli][info] Found matching plugin yupptv for URL https://www.yupptv.com/channels/sony-tv-hd/live 2020-09-14_21:30:02.96585 [cli][debug] Plugin specific arguments: 2020-09-14_21:30:02.96595 [cli][debug] --yupptv-boxid=******** (boxid) 2020-09-14_21:30:02.96605 [cli][debug] --yupptv-yuppflixtoken=******** (yuppflixtoken) 2020-09-14_21:30:02.96621 [plugin.yupptv][debug] Attempting to authenticate using cached cookies 2020-09-14_21:30:04.27101 [utils.l10n][debug] Language code: en_US 2020-09-14_21:30:04.74955 [cli][info] Available streams: 270p (worst), 360p, 540p, 720p (best) 2020-09-14_21:30:04.74990 [cli][info] Starting server, access with one of: 2020-09-14_21:30:04.82587 [cli][info] http://127.0.0.1:11002/ 2020-09-14_21:30:10.81929 [cli][info] Got HTTP request from Streamer 20.09 2020-09-14_21:30:10.81948 [cli][info] Opening stream: 720p (hls) 2020-09-14_21:30:10.82009 [stream.hls][debug] Reloading playlist 2020-09-14_21:30:13.33534 [cli][error] Could not open stream: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:30:13.33575 [plugin.yupptv][debug] Attempting to authenticate using cached cookies 2020-09-14_21:30:13.87706 [utils.l10n][debug] Language code: en_US 2020-09-14_21:30:13.95485 [cli][info] Opening stream: 720p (hls) 2020-09-14_21:30:13.95526 [stream.hls][debug] Reloading playlist 2020-09-14_21:30:16.33582 [cli][error] Could not open stream: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:30:16.33613 [plugin.yupptv][debug] Attempting to authenticate using cached cookies 2020-09-14_21:30:17.03601 [utils.l10n][debug] Language code: en_US 2020-09-14_21:30:17.11543 [cli][info] Opening stream: 720p (hls) 2020-09-14_21:30:17.11579 [stream.hls][debug] Reloading playlist 2020-09-14_21:30:19.49311 [cli][error] Could not open stream: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:30:19.49333 [plugin.yupptv][debug] Attempting to authenticate using cached cookies 2020-09-14_21:30:20.03681 [utils.l10n][debug] Language code: en_US 2020-09-14_21:30:20.11409 [cli][info] Opening stream: 720p (hls) 2020-09-14_21:30:20.11448 [stream.hls][debug] Reloading playlist 2020-09-14_21:30:22.59907 [cli][error] Could not open stream: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:30:22.59929 [plugin.yupptv][debug] Attempting to authenticate using cached cookies 2020-09-14_21:30:23.15075 [utils.l10n][debug] Language code: en_US 2020-09-14_21:30:23.22917 [cli][info] Opening stream: 720p (hls) 2020-09-14_21:30:23.22976 [stream.hls][debug] Reloading playlist 2020-09-14_21:30:25.61056 [cli][error] Could not open stream: Unable to open URL: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8? (404 Client Error: Not Found for url: https://yuppmsleuvia1.akamaized.net/hls/live/2017574/sonyukhdhttps/sonyukhdhttps/sonyukhd_2500/chunklist.m3u8?) 2020-09-14_21:30:25.61074 [plugin.yupptv][debug] Attempting to authenticate using cached cookies 2020-09-14_21:30:26.16795 [utils.l10n][debug] Language code: en_US 2020-09-14_21:30:26.24559 [cli][info] Opening stream: 720p (hls) 2020-09-14_21:30:26.24606 [stream.hls][debug] Reloading playlist

mkbloke commented 4 years ago

@limiteddi, can you reformat the above to make it a little more readable, please? I think what you have done (where b=backtick) is specified bbb[content]bbb. If you format it as:

bbb [content] bbb

it should be easier to read.

Can you also specify the full command you are using to launch streamlink.

When does this happen - after a short time or a long time? How long?

Does the live stream play in the browser on yupptv.com OK for the same period of time?

I don't have a subscription, so it won't be easy to try and work out why this is happening or if it can be mitigated in streamlink, as a 404 error suggests a remote issue.

mytee12 commented 4 years ago

@mkbloke

Took me a while to figure out what was happening, but it seems that after 7 days the cache in the file plugin-cache.json is automatically purged. However, If I re-set the SAME credentials again they will continue working... I have done this 3 times with the same tokens and the only change is the expires in the plugin-cache.json file . So it is possibly the expiry date being set in the cache file incorrectly causing the credentials to be purged prematurely?

Prior to trying a stream - plugin-cache.json file:

"expires": 1600559413.4241705
"expires": 1600559413.455421

Trying to play a stream and YuppTV credentials are purged automatically from plugin-cache.json: {}

[plugin.yupptv][error] This stream requires you to login
error: No playable streams found on this URL: https://www.yupptv.com/channels/star-plus-uk/live

After setting new credentials, new expiry date with same credentials:

"expires": 1601164607.7820444
"expires": 1601164607.8171265
mkbloke commented 4 years ago

@mytee12, many thanks indeed for finding that. I have pushed an update to the (still open) PR. The updated code is at:

https://github.com/streamlink/streamlink/blob/1b7d898d94aa6d19812215b179e7b27e4056bcce/src/streamlink/plugins/yupptv.py

I've opted just to apply a time at setting + 1 year to the cookie expiry, on the basis that the existing code should detect the inability to login when the cookie actually expires. Cheers.