Suwayomi / Suwayomi-Server

A rewrite of Tachiyomi for the Desktop
Mozilla Public License 2.0
3.93k stars 201 forks source link

[Bug] Certain plugin's random User-Agent feature doesn't work. #668

Open xkww3n opened 1 year ago

xkww3n commented 1 year ago

Device information

Steps to reproduce

  1. Install this plugin
  2. Inside the plugin settings page, change "Random User-Agent (Requires Restart)" option from "OFF" to "Mobile" or "Desktop"
  3. Browse this source.

Expected behavior

Can browse the source without error after enabled random User-Agent option.

Actual behavior

Recieved error log (see below) and returned HTTP 500 code.

Other details

[DefaultDispatcher-worker-14] ERROR suwayomi.tachidesk.server.JavalinSetup - IOException while handling the>java.io.IOException: playwrite is diabled for v0.6.7
        at eu.kanade.tachiyomi.lib.randomua.RandomUserAgentInterceptor.intercept(Unknown Source)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
        at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
        at okhttp3.internal.connection.RealCall.execute(RealCall.kt:158)
        at eu.kanade.tachiyomi.network.OkHttpExtensionsKt$asObservable$1$requestArbiter$1.request(OkHttpExtensions.kt:32)
        at rx.Subscriber.setProducer(Subscriber.java:211)
        at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
        at rx.Subscriber.setProducer(Subscriber.java:205)
        at eu.kanade.tachiyomi.network.OkHttpExtensionsKt.asObservable$lambda$0(OkHttpExtensions.kt:54)
        at rx.Observable.unsafeSubscribe(Observable.java:10327)
        at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
        at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
        at rx.Observable.unsafeSubscribe(Observable.java:10327)
        at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
        at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
        at rx.Observable.subscribe(Observable.java:10423)
        at rx.Observable.subscribe(Observable.java:10390)
        at suwayomi.tachidesk.manga.impl.util.lang.RxCoroutineBridgeKt.awaitOne(RxCoroutineBridge.kt:29)
        at suwayomi.tachidesk.manga.impl.util.lang.RxCoroutineBridgeKt.awaitSingle(RxCoroutineBridge.kt:24)
        at suwayomi.tachidesk.manga.impl.MangaList.getMangaList(MangaList.kt:36)
        at suwayomi.tachidesk.manga.controller.SourceController$popular$2$1.invokeSuspend(SourceController.kt:78)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Underestimated commented 11 months ago

Just checking, you are restarting Tachidesk Server after checking that option off like it says on it? You didn’t make it clear if you are or not so I thought I’d ask.

xkww3n commented 11 months ago

Just checking, you are restarting Tachidesk Server after checking that option off like it says on it? You didn’t make it clear if you are or not so I thought I’d ask.

No. Actually this feature doesn't need to restart entire Tachidesk Server, just exit the browser page is OK. If I set this feature to Disabled, the log I've provided won't be shown.

Underestimated commented 11 months ago

ok, so did you try restarting the server after enabling the option and get the same result? That should've been the absolute first thing you tried. You sort of didn't clarify if you did or not.

I wanted to be sure because I've had other extensions that required a whole server restart before the useragent fix works. the requests are performed at the server level, not in your browser, (your browser just directs the server what to do) so restarting your browser window (at least to me) isn't going to do anything.

Underestimated commented 11 months ago

Ahh I see what the issue is, reaperscans did this a while back. The source has implemented a really strict cloudflare setup that requires all visitors to the page be verified with a captcha, regardless of useragent. Now on Tachiyomi you'd access webview and bypass the captcha that pops up, but Tachidesk hasn't implemented that functionality yet. So unless the source relaxes their security you're kind of out of luck. this isn't a bug per se, just a feature that isn't implemented. Issue https://github.com/Suwayomi/Tachidesk-Server/issues/161 references this for another source. Also check https://github.com/Suwayomi/Tachidesk-Server/issues/658 and https://github.com/Suwayomi/Tachidesk-Server/issues/474 and https://github.com/Suwayomi/Tachidesk-Server/issues/362 which is the exact same issue as you are having. Did you search before posting the bug?

xkww3n commented 11 months ago

Ahh I see what the issue is, reaperscans did this a while back. The source has implemented a really strict cloudflare setup that requires all visitors to the page be verified with a captcha, regardless of useragent. Now on Tachiyomi you'd access webview and bypass the captcha that pops up, but Tachidesk hasn't implemented that functionality yet. So unless the source relaxes their security you're kind of out of luck. this isn't a bug per se, just a feature that isn't implemented.

Issue https://github.com/Suwayomi/Tachidesk-Server/issues/161 references this for another source.

But on Tachiyomi if I turn on Fake user agent feature, it sometimes passes the Cloudflare check. On Tachidesk, I'll got 500 error immediately even befor hitting Cloudflare check.

Underestimated commented 11 months ago

But on Tachiyomi if I turn on Fake user agent feature, it sometimes passes the Cloudflare check. On Tachidesk, I'll got 500 error immediately even befor hitting Cloudflare check.

That only works on ddos protected pages that are specifically blocking your browser, this is a different type that affects every single user, the protection is always in place and a fake user agent isn't going to bypass it. check the edited post from before, several people have had this exact issue with this plugin before and have been told that it's broken.

The plugins are provided from Tachiyomi, so they don't have a way of blocking the ones that don't work on Tachidesk specifically.

Also they make it really clear: Tachidesk is NOT tachiyomi, it has compatibility, but some features just cannot work the same way because it's built differently in order to be compatible with self hosting.