cloudstream icon indicating copy to clipboard operation
cloudstream copied to clipboard

Streamplay is broken

Open SomeoneLikeYou462 opened this issue 1 year ago • 4 comments

Steps to reproduce

  1. I tried to play this streamplay video, https://stre4mplay.one/1twe4yogrbpl

Expected behavior

Should play the video

Actual behavior

An error appears instead of playing the video: ErrorLoadingException: can't bypass captcha

Cloudstream version and commit hash

0c418fdf

Android version

Pixel 6 Pro API 31 Android 12

Logcat

2024-07-24 18:34:51.143  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  com.lagradost.cloudstream3.ErrorLoadingException: can't bypass captcha
2024-07-24 18:34:51.145  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at com.lagradost.cloudstream3.extractors.Streamplay.getUrl$suspendImpl(Streamplay.kt:37)
2024-07-24 18:34:51.145  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at com.lagradost.cloudstream3.extractors.Streamplay$getUrl$1.invokeSuspend(Unknown Source:18)
2024-07-24 18:34:51.145  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-07-24 18:34:51.145  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
2024-07-24 18:34:51.145  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
2024-07-24 18:34:51.145  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
2024-07-24 18:34:51.146  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
2024-07-24 18:34:51.146  7919-7957  System.err              com...cloudstream3.prerelease.debug  W  	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)

Other details

No response

Acknowledgements

  • [X] I am sure my issue is related to the app and NOT some extension.
  • [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • [X] I have written a short but informative title.
  • [X] I have updated the app to pre-release version Latest.
  • [X] I will fill out all of the requested information in this form.

SomeoneLikeYou462 avatar Jul 24 '24 16:07 SomeoneLikeYou462

This is not a bug If a site needs captcha then you can not play

int3debug avatar Jul 26 '24 08:07 int3debug

I thought it would be possible cause there are implemented functions to try to resolve it https://github.com/recloudstream/cloudstream/blob/2fc279f4aea56ff2422b2b114165465bb08d9035/library/src/commonMain/kotlin/com/lagradost/cloudstream3/MainAPI.kt#L124

SomeoneLikeYou462 avatar Jul 26 '24 15:07 SomeoneLikeYou462

  1. the captcha token request will give a malformed response because the sitekey ends in an underscore and a URL doesn't like that (and the URL it builds uses that last). Changing the URL in getCaptchaToken to a trailing slash (IE https://www.google.com/recaptcha/api.js?render=$key/) would fix this issue.
  2. streamplay does not use invisible captcha so getCaptchaToken wont work since it uses size=invisible rather than size=normal (which streamplay expects) resulting in "This site key is not enabled for the invisible captcha."
  3. streamplay is broken, embed links no longer work on the stre4mplay.one link and streamplay.to just redirects to it. So the extractor isn't going to work, as it uses:
val key = redirectUrl.substringAfter("embed-").substringBefore(".html")
app.post(
            "$mainServer/player-$key-488x286.html", data = mapOf(
                "op" to "embed",
                "token" to token
            )

Both embed- and player- no longer works in streamplay (even though it is still referenced in the html of the site). Also if you do not use the embed- version of the URL the $key becomes the full URL leading to the wrong URL anyway and it is not meant to work for the URL you used.

This is at least as far as I can tell. I could also be wrong in parts of this.

My point in all this is though is this seems to be a streamplay issue mess caused by them changing their URL but not for everything making things very broken at the moment.

Luna712 avatar Jul 29 '24 22:07 Luna712

I tried to fix it on my own but I found another bug, as @Luna712 said with the last slash works the url perfectly and you get the vToken and also the recapToken, but when you have to make the last post using all the obtained data the last url returns null (expected the google recaptcha token)

https://github.com/recloudstream/cloudstream/blob/2fc279f4aea56ff2422b2b114165465bb08d9035/library/src/commonMain/kotlin/com/lagradost/cloudstream3/MainAPI.kt#L145

SomeoneLikeYou462 avatar Aug 02 '24 10:08 SomeoneLikeYou462