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

[Feature] Please add support for jnc-nina #47

Closed Senshi00 closed 7 months ago

Senshi00 commented 9 months ago

Hi,

it would be amazing if support for https://jnc-nina.eu/ could be added.

Thank you.

gvellut commented 9 months ago

Thank you for your feedback.

I hadn't heard of that international version of JNC so thank you for the link. I will have to check how similar it is to J-Novel Club (in terms of API and login). But if it is close enough, it could be added.

k-aito commented 9 months ago

I have a modification that works "ok", but I will try to make it work without breaking the code for JNC. I think I will make a PR at the end of the week.

k-aito commented 9 months ago

Hello @gvellut

My first try to make cohabit the 2 versions is awkward. I was trying to have a jncapi and jncnina on the same format of jnclabs and jncweb. The issue is that the JNCSession uses them and doesn't always have a jnc_url to decide which one to choose.

I think that as first version, just having another branch that works for jnc-nina would be the best approach. What do you think?

gvellut commented 9 months ago

@k-aito Thank your for the PR. I have merged it into the side branch named nina in this repo.

I will eventually integrate it with master in a way similar to what you propose. Since there is not a lot of API changes compared to the main JNC API, it should be workable I think.

k-aito commented 9 months ago

Hello @gvellut

You are welcome.

I also thought about a flag, maybe. It would be easier to manage.

For example, --nina if it is set, then we can import jncapi and jncnina as jnclabs and jncweb. I think that in that case there is no need to rewrite the JNC Session part, but I don't see how it could be added to the flag without adding it manually in the command. It could maybe be "added" based on the URL?

gvellut commented 9 months ago

I don't mind changing things a bit to have the tool work for both JNC and Nina at the same time, depending on the full URL passed (to the epub or update command). So which URL parser or API helper is used for a specific series will depend on that URL (currently, when a series is resolved it is assumed to be JNC so the origin of the series will have to be stored, so the correct API helper can be used later).

There is also the issue of credentials (they are different for JNC and Nina so there would be a need to add options for the Nina credentials).

Anyway, I will try to have the feature ready in the next few weeks.

k-aito commented 9 months ago

Good catch about the credentials because I guess there will be maybe people having credentials for JNC and JNC-Nina.

I guess there will be a need for another mechanism for the sync command, but that would be surely related to the credentials?

Thank and good luck for the code adaptation ^^

Senshi00 commented 9 months ago

@gvellut & @k-aito Thank you so much that this feature can be implemented!

gvellut commented 9 months ago

@k-aito Yes indeed: For the sync, the presence of credentials for JNC or Nina will be used to determine if one or the other API should be requested.

By the way, if you want to have a go at the implementation, let me know. I don't intend to start right away anyway.

k-aito commented 9 months ago

Hello @gvellut

I will see if I can take some time to do something that is working. But no promise at all, so when you have time, don't hesitate to just go forward if I didn't make a PR yet ^^

gvellut commented 7 months ago

@k-aito I have included what you did for Nina with the main J-Novel Club support in the master branch. There is still a need for more testing on my part. Also the generated titles and EPUB file names will need to be updated to follow the language (French or German) so I will not release a new version right away (but soon).

k-aito commented 7 months ago

Hello @gvellut

Take your time, if there is any need I can see with a friend who has an account for testing, but if you can do it on your side I think it will be easier to debug if needed.

Anyway, thank you for the support in the master branch.