Skip to content
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

503 Server Error: Service Unavailable for url: https://labs.j-novel.club/app/v1/auth/login?format=json after JNCEP updated their website and App today. #54

Closed
arnoldstrife opened this issue Oct 11, 2024 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@arnoldstrife
Copy link

Describe the bug
Downloading parts no longer works with the epub command after J-novel updated their website today. The error generated is,

*** ❌ An unrecoverable error occured ***
503 Server Error: Service Unavailable for url: https://labs.j-novel.club/app/v1/auth/login?format=json

Expected behavior
An epub should be created

To Reproduce
Command: jncep epub --email @.com --password *** -o C:\epubdir\ -s 6 https://j-novel.club/series/knight-s-magic

Debug trace
2024-10-11 00:08:40,120 jncep.utils WARNING Login with email '[highlight]***********@****.com[/]'...
2024-10-11 00:08:40,223 jncep.utils ERROR *** An unrecoverable error occured ***
2024-10-11 00:08:40,224 jncep.utils ERROR 503 Server Error: Service Unavailable for url: https://labs.j-novel.club/app/v1/auth/login?format=json
2024-10-11 00:08:40,226 jncep.cli DEBUG Traceback (most recent call last):
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jncep\cli\base.py", line 17, in invoke
return super().invoke(ctx)
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jncep\trio_utils.py", line 31, in wrapper
return trio.run(partial(f, *args, **kwargs))
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\trio_core_run.py", line 1932, in run
raise runner.main_task_outcome.error
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jncep\cli\epub.py", line 79, in generate_epub
async with core.JNCEPSession(email, password) as session:
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jncep\core.py", line 70, in aenter
await self.login(self.email, self.password)
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jncep\core.py", line 102, in login
token = await self.api.login(email, password)
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\jncep\jnclabs.py", line 151, in login
r.raise_for_status()
File "C:\Users\sitse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\asks\response_objects.py", line 55, in raise_for_status
raise BadStatus(
asks.errors.BadStatus: 503 Server Error: Service Unavailable for url: https://labs.j-novel.club/app/v1/auth/login?format=json

Environment (please complete the following information):

  • OS: Windows 11
  • Python version: 3.10
  • JNCEP version: v46
@arnoldstrife arnoldstrife added the bug Something isn't working label Oct 11, 2024
@justdave
Copy link

justdave commented Oct 11, 2024

Per Quarkboy on Discord, /app/v1 went away, and third party developers need to move to /app/v2 . It's supposedly mostly compatible, and the few minor differences "should be easy to figure out by playing with it"

I imagine that means the differences are mostly in the responses and not the requests.

@gvellut
Copy link
Owner

gvellut commented Oct 11, 2024

Thank you for the bug report.

I will try to update today or this week-end. In the meantime, it seems the fix indicated by @justdave should work: At the top of the jncep/jnclabs.py file, replace the value of LABS_API_PATH_BASE from /app/v1 to /app/v2.

@pajoh
Copy link

pajoh commented Oct 11, 2024

There are a few minor changes that needs to be fixed in the code

Think that was all I needed to change to get it to work. Only tried downloading epub, tracked new series and update from tracked file. Havn't tried the eu-version either.

@gvellut gvellut self-assigned this Oct 11, 2024
gvellut added a commit that referenced this issue Oct 11, 2024
@gvellut
Copy link
Owner

gvellut commented Oct 11, 2024

@pajoh Thank you. I have updated the last released version (which was v46) with what you listed (so I haven't included other changes yet, since I haven't tested them enough). It seems to work OK on my end. The v47 is from the branch tmpfix.

@gvellut gvellut closed this as completed Oct 11, 2024
@justdave
Copy link

FWIW there's also some discussion here about what the new changes are.

@justdave
Copy link

The future parts being listed seems to be biting it. update is throwing a lot of "expired parts" warnings

@justdave
Copy link

"official" nugget from a JNC developer: https://forums.j-novel.club/post/374895

@gvellut
Copy link
Owner

gvellut commented Oct 12, 2024

Thank you for the links @justdave. I will try to deal with the listing of future parts today (I noticed it and made a change yesterday but it wasn't enough).

@gvellut gvellut reopened this Oct 12, 2024
@justdave
Copy link

I have a few series I follow that released parts today, and they didn't update. I discovered that the part date got set to the last visible part (some going into 2025) so they were marked as already seen. I had to go through my tracking file and manually back-date anything with a future date on it to last Thursday. (And I now need to do it again and set them to today after running update again)

@Nitrousoxide
Copy link

I built from the tmpfix branch and that seems to be working now.

If you use docker/podman you can use this containerfile to build from that branch.

FROM python:3.11-alpine
ARG group=jncep
ARG user=jncep
ARG home=/home/$user
RUN apk --no-cache add bash git jq curl
RUN pip install --upgrade pip
#RUN pip install git+https://github.com/gvellut/jncep.git@$(curl -s https://api.github.com/repos/gvellut/jncep/releases/latest | jq -r '.tag_name')
RUN pip install git+https://github.com/gvellut/jncep.git@tmpfix
ENTRYPOINT ["jncep"]

Once gvellut pushes a new build with that fix in place you can either just use that or uncomment my commented out run command there and remove the tmpfix RUN line and rebuild it.

In the meantime, I'd recommend deleting your follow file and having JNCEP re-create it so you get correct dates. You'll still need to manually pull anything released from after the v2 api update to now though.

@justdave
Copy link

Next life as a villainess 13.5 won't download.

2024-10-16 18:30:22,904 jncep        DEBUG    Error _handle_series: BadStatus('404 Client Error: Not Found for url: https://labs.j-novel.club/embed/v2/PRT-QCDDG4Q/data.xhtml'), BadStatus('404 Client Error: Not Found for url: https://labs.j-novel.club/embed/v2/PRT-QH3U2CY/data.xhtml'), BadStatus('404 Client Error: Not Found for url: https://labs.j-novel.club/embed/v2/PRT-PWWAKHY/data.xhtml'), BadStatus('404 Client Error: Not Found for url: https://labs.j-novel.club/embed/v2/PRT-T3N7K5A/data.xhtml'), BadStatus('404 Client Error: Not Found for url: https://labs.j-novel.club/embed/v2/PRT-62GWIHA/data.xhtml')

chocolatekey thinks the script is forgetting to send auth with the request based on the error. But that's the only series I'm having that issue with.

@chocolatkey
Copy link

chocolatkey commented Oct 17, 2024

Had a chat with @justdave about this (FYI I'm one of the developers at JNC) and I'm inclined to say it's a bug with this repo, but if it's not, do let me know and I'll get it fixed.

Kind of surprised about this repo's amount of activity and usage, hadn't seen it before

@gvellut
Copy link
Owner

gvellut commented Oct 17, 2024

@justdave I think it was due to an issue with parts with a launch date in the future (before the JNC API update last week, they were not present in the API response, so it was not checked). Do you use jncep epub ... or jncep update ... when you get the error?

BadStatus('404 Client Error: Not Found for url: https://labs.j-novel.club/embed/v2/PRT-QCDDG4Q/data.xhtml')

This is the URL for 13.6 (which is not available yet) so there is an error: jncep tries to download it because it hasn't checked that the launch date is in the future.

Normally, version 48 (just released) should work fine now in this case (Note that the minimum Python version is now 3.8).

@justdave
Copy link

I was using jncep update ... .

I can confirm that version 48 fixes it, so we're all good now :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants