-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Nijiero-ch extension 1.0 #3245
base: main
Are you sure you want to change the base?
Conversation
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/NijieroTags.kt
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
f3f0194
to
309ce31
Compare
I am done with my fixup, requesting review |
oh nvm im dumb |
url = baseUrl.toHttpUrl().newBuilder() | ||
.addEncodedPathSegment("tag") | ||
.addEncodedPathSegment(keyword) | ||
.addEncodedPathSegment("page") | ||
.addEncodedPathSegment(page.toString()) | ||
.addQueryParameter("refresh", uniqueParam.toString()) | ||
.build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find this path in the source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...? You mean, like, file path? If you mean the website, try $baseurl/tag/gif, that should exist.
All the content (titles and tags) is in Japanese, I think it would be better to localize it to “jp” instead of “all”. |
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
.build() | ||
|
||
// if 404, recheck | ||
if (client.newCall(GET(url, headers)).execute().code == 404) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to do this in an interceptor, so you can simply return the response as is if available or make new request and return it's response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code should actually check if the current page was not found as a tag, so it tries again with category... not sure what you mean by that, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean instead of make a call just to check if it exists, add an interceptor to detect it and make new call there.
basically return the tag request from here, in the interceptor prceed the call and check if it is 404 and url contains tag (this request) and if so, modify the request and call again, otherwise just return the original response.
something like this:
private fun tagCategoryInterceptor(chain: Interceptor.Chain): Response {
val request = chain.request()
val url = request.url.toString()
val response = chain.proceed(request)
if (!response.isSuccessful && response.code == 404 && url.contains("/category/")) {
val newUrl = url.replace("/category/","/tag/")
val newRequest = request.newBuilder()
.url(newUrl)
.build()
return chain.proceed(newRequest)
}
return response
}
src/all/nijiero/src/eu/kanade/tachiyomi/extension/all/nijiero/Nijiero.kt
Outdated
Show resolved
Hide resolved
@ttony2chopper I originally made the extension so that i can read it, so i made some stuff english. Is it required to move it all onto japanese in this case? I am not fluent in that language... |
The tag and category links are, in reverse, almost all english/romanji, except some tags, thats why i just put english/romanji tags here. This is related to the former comment |
To the branch: I commited to a branch called "pr", how do i set this PR to the branch? Do i need to create a new PR? |
you should push those commits in this branch, otherwise you would have to make a new pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove extra changes in common.gradle
and settings.gradle.kts
I actually found several bugs, such as popular not showing images, some non manga entries included in recent sometimes, and tags with / dont work (%2F). I dont think i have time to update this, though... |
This extension is NSFW related, and is less a manga reader, and more an image browser for NSFW content.
The original is "https://nijiero-ch.com/".
Latest is not supported, as i could not get a dedicated link that points to latest content. The website is a little dated anyways.
I tested it multiple times, and it should work. The search is only meant to search for tags or categories. If a genre/tag is specified, search is overriden. If it could not find either category/ or tag/, it searches for the other. I have not tested invalid search results yet, but everything else should work quite decently.
Please ask if needed, my discord is "Moddimation", aka "Moddigi Luigi".