fix(lib/lycoris&lulu) Repair decode json and work LuluStream #810
No reviewers
Labels
No labels
Bug
Domain change
Duplicate
Features request
Remove request
Source is down
Source request
Wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Kohi-den/extensions-source#810
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-lycoris"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist:
extVersionCode
value inbuild.gradle
for individual extensionsoverrideVersionCode
orbaseVersionCode
as needed for all multisrc extensionsisNsfw = true
flag inbuild.gradle
when appropriateid
if a source's name or language were changedweb_hi_res_512.png
when adding a new extensionJson injekt should already have
ignoreUnknownKeys = true
, while need to change?this line seems to have a redundant slash:
=>
I genuinely didn't know about it but good to know, thank you.
@ -23,2 +28,4 @@
)
}
// Credit: https://github.com/skoruppa/docchi-stremio-addon/blob/main/app/players/lycoris.py
this will send a string
"null"
to json.decode and cause a crashuse
script.parseAs<ScriptBody>()
same here
also fix
fetchAndDecodeVideo()
&decodeVideoLinks()
so they both returnString?
@ -59,3 +53,1 @@
patterns.forEach { (key, pattern) ->
result[key] = episodeData?.let { pattern.find(it)?.groups?.get(1)?.value }
val fhdLink = data.episodeInfo.FHD?.let {
@ -23,2 +28,4 @@
)
}
// Credit: https://github.com/skoruppa/docchi-stremio-addon/blob/main/app/players/lycoris.py
with this I was aware of it but had no idea how to fix it so that such a problem would not occur
@ -23,2 +28,4 @@
)
}
// Credit: https://github.com/skoruppa/docchi-stremio-addon/blob/main/app/players/lycoris.py
Add
?.
beforetoString
and conditional action if it's null@ -23,3 +29,4 @@
}
// Credit: https://github.com/skoruppa/docchi-stremio-addon/blob/main/app/players/lycoris.py
fun getVideosFromUrl(url: String, headers: Headers, prefix: String): List<Video> {
also fix indent for the rest of this function (and the whole file?)
A little delay in approval 😥
@Hayanek I cannot access the site from my place, got "IP blocked". Have you tested the pl/docchi ext making sure it's working?
also remove the injectLazy import
and the
@ -23,3 +29,4 @@
}
// Credit: https://github.com/skoruppa/docchi-stremio-addon/blob/main/app/players/lycoris.py
fun getVideosFromUrl(url: String, headers: Headers, prefix: String): List<Video> {
could we use
checkLinks()
instead ofit.contains()
?could we use
checkLinks()
instead ofit.contains()
?@ -146,3 +144,4 @@
}
private fun checkLinks(client: OkHttpClient, link: String): Boolean {
if (!link.contains("https://")) return false
Move regex outside and make it lazy load
Probably need to manually bump pl/docchi version too, since
tj-actions/changed-files
is disabled.ok 😢
@ -146,3 +144,4 @@
}
private fun checkLinks(client: OkHttpClient, link: String): Boolean {
if (!link.contains("https://")) return false
I'll be honest I have no idea why, and how I could do it.
@ -146,3 +144,4 @@
}
private fun checkLinks(client: OkHttpClient, link: String): Boolean {
if (!link.contains("https://")) return false
move out so it's only needed to be initialized once, not every time the function is called.
Example:
@ -146,3 +144,4 @@
}
private fun checkLinks(client: OkHttpClient, link: String): Boolean {
if (!link.contains("https://")) return false
Will it be good this way?
or do I have to knock them all down one by one :(
@ -146,3 +144,4 @@
}
private fun checkLinks(client: OkHttpClient, link: String): Boolean {
if (!link.contains("https://")) return false
Just move the whole thing out like that is OK
Probably due to the fact that I also had to fix the Lulu I will wait longer, but less I will wait.
ps. I was sitting for 10 hours and at the very end it turned out that this Lulu User-Agent was missing
@ -3,16 +3,18 @@ package eu.kanade.tachiyomi.lib.luluextractor
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.network.GET
import okhttp3.Headers
import okhttp3.HttpUrl.Companion.toHttpUrl
It's exact the same as the old headers, why need a new one?
Also, where it was, outside, is better. Same as the Regex one.
@ -3,16 +3,18 @@ package eu.kanade.tachiyomi.lib.luluextractor
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.network.GET
import okhttp3.Headers
import okhttp3.HttpUrl.Companion.toHttpUrl
Well, not entirely the same if the current one has a user-agent from the application and the previous form relied solely on these 2 headers.
I don't understand which Regex you mean :(
@ -3,16 +3,18 @@ package eu.kanade.tachiyomi.lib.luluextractor
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.network.GET
import okhttp3.Headers
import okhttp3.HttpUrl.Companion.toHttpUrl
Just change the
Headers.Builder()
toheaders.Builder()
then. Keep it outside like you did with the wordRegex previously.if you meant creating a header based on parameter
headers
passed in to the function, find where the actual function called and restructure it so the original caller should pass the existed lulu one.@ -3,16 +3,18 @@ package eu.kanade.tachiyomi.lib.luluextractor
import eu.kanade.tachiyomi.animesource.model.Video
import eu.kanade.tachiyomi.network.GET
import okhttp3.Headers
user
urlBuilder
instead so it can handles encodingtrailing slash only for Referer, Origin no trailing
eh
All good, I guess.