dteviot / WebToEpub

A simple Chrome (and Firefox) Extension that converts Web Novels (and other web pages) into an EPUB.
Other
737 stars 139 forks source link

Please add site https://genesistudio.com #1525

Open Displayeddd opened 1 month ago

Displayeddd commented 1 month ago

Please note, I'm basically the only developer working on WebToEpub, and I'm not paid for doing this. (WebToEpub is completely free, and generates no money.) By asking to add a site, you're asking me to give you some of my limited free time. So, I think it's not unreasonable for me to ask you to do as much as you can to help me.

Provide URL for web page that contains Table of Contents (list of chapters) of a typical story on the site

https://genesistudio.com/novels/dlh

Did you try using the Default Parser for the site? If not, why not?

Instructions for using the default parser can be found at https://dteviot.github.io/Projects/webToEpub_DefaultParser.html

What settings did you use? What didn't work?

If the Default Parser did not work, if you have developer skills, did you try writing a new parser?

Instructions https://dteviot.github.io/Projects/webToEpub_FAQ.html#write-parser

If you don't have developer skills, can you ask a friend who does have them if they can do it for you?

If you tried writing a parser, and it doesn't work. Attach the parser here.

gamebeaker commented 1 month ago

reference: #1495

gamebeaker commented 1 month ago

@Displayeddd will not be supported. Why? The api returns js which needs to be executed.

gamebeaker commented 1 month ago

@Displayeddd Test versions for Firefox and Chrome have been uploaded to https://github.com/dteviot/WebToEpub/releases/tag/developer-build. Pick the one suitable for you, follow the "How to install from Source (for people who are not developers)" instructions at https://github.com/dteviot/WebToEpub/tree/ExperimentalTabMode#user-content-how-to-install-from-source-for-people-who-are-not-developers and let me know how it goes.

Displayeddd commented 1 month ago

Works, though on the extension page it says [placeholder] for all the chapters, you can still read them. image

gamebeaker commented 1 month ago

@Displayeddd in the finished epub are the right title. Or more like should be if you find an error please write here.

gamebeaker commented 1 month ago

@Displayeddd New test versions for Firefox and Chrome have been uploaded to https://github.com/dteviot/WebToEpub/releases/tag/developer-build. Pick the one suitable for you, follow the "How to install from Source (for people who are not developers)" instructions at https://github.com/dteviot/WebToEpub/tree/ExperimentalTabMode#user-content-how-to-install-from-source-for-people-who-are-not-developers and let me know how it goes.

gamebeaker commented 1 month ago

Is again broken i have the feeling they make changes each time i update. I will wait 1 week before i attempt again.

dnshipit commented 1 month ago

I took a crack at this today. Not sure if they will update this further but this is the diff of my change that work

diff --git a/plugin/js/parsers/GenesiStudioParser.js b/plugin/js/parsers/GenesiStudioParser.js
index 6238cbf..85c65a6 100644
--- a/plugin/js/parsers/GenesiStudioParser.js
+++ b/plugin/js/parsers/GenesiStudioParser.js
@@ -17,7 +17,7 @@ class GenesiStudioParser extends Parser{

     async getChapterUrls(dom) {
         let data = (await HttpClient.fetchJson(dom.baseURI + "/__data.json")).json;
-        let tmpids = data.nodes[2].data[0].chapters;
+        let tmpids = data.nodes[2].data[0].chapters_list;
         let jsdata = data.nodes[2].data[tmpids];
         let extractfreechapter = [...jsdata.match(/return{.*}}],/)[0].matchAll(/'id':0.*?,/g)];
         let freechapterids = extractfreechapter.map(e => Number(e[0].replace("'id':","").replace(",","")));
@@ -35,7 +35,7 @@ class GenesiStudioParser extends Parser{
         let newDoc = Parser.makeEmptyDocForContent(url);

         this.appendElement(newDoc, "h1", this.titleFromJson(json));
-        let index = json.nodes[2].data[0].content;
+        let index = json.nodes[2].data[0].gs;
         let content = json.nodes[2].data[index];
         this.appendContent(newDoc, content);
         let notes = json.nodes[2].data[json.nodes[2].data[0].footnotes];
Tenome commented 1 month ago

I took a crack at this today. Not sure if they will update this further but this is the diff of my change that work

Does this still work for you? I tried your revisions and it didn't work for me. Genesis' constant battle against scrapers is funny, especially how they're trying to pass themselves off as a business. I get the feeling they're hoping to turn into a publisher like Webnovel.

dnshipit commented 1 month ago

They did do minor changes again. Depends on how thing go, we might just want to filter their object instead of trusting fixed string.

Here is the new diff that work for me. Grab it quick while it's still working I guess @Tenome

diff --git a/plugin/js/parsers/GenesiStudioParser.js b/plugin/js/parsers/GenesiStudioParser.js
index 6238cbf..a9314a9 100644
--- a/plugin/js/parsers/GenesiStudioParser.js
+++ b/plugin/js/parsers/GenesiStudioParser.js
@@ -17,7 +17,7 @@ class GenesiStudioParser extends Parser{

     async getChapterUrls(dom) {
         let data = (await HttpClient.fetchJson(dom.baseURI + "/__data.json")).json;
-        let tmpids = data.nodes[2].data[0].chapters;
+        let tmpids = data.nodes[2].data[0].clist;
         let jsdata = data.nodes[2].data[tmpids];
         let extractfreechapter = [...jsdata.match(/return{.*}}],/)[0].matchAll(/'id':0.*?,/g)];
         let freechapterids = extractfreechapter.map(e => Number(e[0].replace("'id':","").replace(",","")));
@@ -35,7 +35,7 @@ class GenesiStudioParser extends Parser{
         let newDoc = Parser.makeEmptyDocForContent(url);

         this.appendElement(newDoc, "h1", this.titleFromJson(json));
-        let index = json.nodes[2].data[0].content;
+        let index = json.nodes[2].data[0].chapter_content;
         let content = json.nodes[2].data[index];
         this.appendContent(newDoc, content);
         let notes = json.nodes[2].data[json.nodes[2].data[0].footnotes];
(END)
pyrusmole commented 1 month ago

Can confirm that this is still down. Attempting to export a novel results in the following error:

freeChapterids is undefined getChapterUrls@moz-extension://100d44ce-fa35-4740-a2bc-d6a652012b85/js/parsers/GenesiStudioParser.js:24:30