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

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

Open
Displayeddd opened this issue Sep 28, 2024 · 11 comments
Open

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

Displayeddd opened this issue Sep 28, 2024 · 11 comments

Comments

@Displayeddd
Copy link

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?

  • URL of first chapter
  • CSS selector for element holding content to put into EPUB
  • CSS selector for element holding Title of Chapter
  • CSS selector for element(s) to remove

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
Copy link
Collaborator

reference: #1495

@gamebeaker
Copy link
Collaborator

gamebeaker commented Sep 28, 2024

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

@gamebeaker
Copy link
Collaborator

@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
Copy link
Author

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

@gamebeaker
Copy link
Collaborator

gamebeaker commented Sep 29, 2024

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

@gamebeaker
Copy link
Collaborator

@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
Copy link
Collaborator

gamebeaker commented Sep 30, 2024

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

@dnshipit
Copy link

dnshipit commented Oct 6, 2024

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
Copy link

Tenome commented Oct 9, 2024

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
Copy link

dnshipit commented Oct 9, 2024

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants