gvellut / jncep

Command-line tool to generate EPUB files for J-Novel Club pre-pub novels
GNU General Public License v3.0
43 stars 11 forks source link

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

Open arnoldstrife opened 9 hours ago

arnoldstrife commented 9 hours ago

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):

justdave commented 7 hours ago

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 commented 4 hours ago

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 commented 4 hours ago

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.