ePUB Generator

Forum for volunteer developers working on Baka-Tsuki related applications (Baka-Reader, BTprince, etc).

Moderators: thelastguardian, Fringe Security Bureau, Senior Editors, Senior Translators, Alt. Language Translator/Editor, Executive Council, Project Translators, Project Editors

Locked
User avatar
Blueshirt
Astral Realm

Re: ePUB Generator

Post by Blueshirt »

Could you add Kino no Tabi volume 5, please? Also so far none of the series I've been reading (Kino no Tabi, Baccano, any of the one-volume novels) have had any problems so far, fyi.
shin609
Reader
Posts: 9
Joined: Thu Jun 07, 2012 8:36 pm
Favourite Light Novel: Ahouka!

Re: ePUB Generator

Post by shin609 »

So I finally managed to download epubs from bte-gen on my nook, but the epub itself is only about the baka reader app and not the book itself. Why is that?
User avatar
Simon
Editor-in-Chief
Posts: 508
Joined: Wed Dec 28, 2011 9:06 am
Favourite Light Novel:
Location: !=

Re: ePUB Generator

Post by Simon »

  • First of all, from which site do you download ? It should be ln.m-chan.org
  • What series do you download ? What Volume do you download ?
ePUB Generator <<Productive>> : BTE-GEN | Yay, I'm free. Let's see how long it takes for this place to go down.
shin609
Reader
Posts: 9
Joined: Thu Jun 07, 2012 8:36 pm
Favourite Light Novel: Ahouka!

Re: ePUB Generator

Post by shin609 »

Simon wrote:
  • First of all, from which site do you download ? It should be ln.m-chan.org
  • What series do you download ? What Volume do you download ?

I downloaded vol 5 of Heavy Object directly from In.m-chan.org.

I managed to find a way to avoid this problem. I just have to download the epub through my computer first then transfer it to my nook instead of downloading directly from it.

Sorry for the inconvenience, and thanks for sharing.
User avatar
Simon
Editor-in-Chief
Posts: 508
Joined: Wed Dec 28, 2011 9:06 am
Favourite Light Novel:
Location: !=

Re: ePUB Generator

Post by Simon »

Can someone say what I do wrong with this one ?
Spoiler! :
When I use this RegEx

Code: Select all

/<p>.+?href="http:\/\/www.baka-tsuki.org\/project\/index.php\?title=File:Utsuro_no_Hako_vol1_pic1.jpg".+?<\/a><\/p>/
On this text ?

Code: Select all

<p><br>
<a href="http://www.baka-tsuki.org/project/index.php?title=File:Utsuro_no_Hako_vol1_pic1.jpg" class="image"><img alt="Utsuro no Hako vol1 pic1.jpg" src="/project/images/4/4f/Utsuro_no_Hako_vol1_pic1.jpg" width="800" height="581"></a>
</p>
ePUB Generator <<Productive>> : BTE-GEN | Yay, I'm free. Let's see how long it takes for this place to go down.
User avatar
EusthEnoptEron
Project Translator
Posts: 836
Joined: Mon Jul 13, 2009 10:39 am
Favourite Light Novel: Ahouka!
Location: Switzerland

Re: ePUB Generator

Post by EusthEnoptEron »

I don't know what you're trying to achieve, but:

1. Make sure you're in the single-line mode when you use a dot for line breaks also. (Normally, . doesn't match \n) Otherwise something like [\s\S] might work.
2. You forgot a .*? between <\/a><\/p>
3. Doesn't really matter, but keep in mind that the dots in the URL will match any character.
User avatar
Simon
Editor-in-Chief
Posts: 508
Joined: Wed Dec 28, 2011 9:06 am
Favourite Light Novel:
Location: !=

Re: ePUB Generator

Post by Simon »

Yeah, that was it... I shall etch it into my memory.

But it causes some other errors so at the moment I catch only from <a> till end of <img>.

Then I have a question: how would you write the RegEx to catch the lines 78-80 1287-1289 (I mean the images) here and use preg_replace to replace them with something other ?

Thanks.


Edit: Hakomari should now have images and the prologue is there.
Last edited by Simon on Tue Jan 01, 2013 5:18 pm, edited 1 time in total.
ePUB Generator <<Productive>> : BTE-GEN | Yay, I'm free. Let's see how long it takes for this place to go down.
User avatar
EusthEnoptEron
Project Translator
Posts: 836
Joined: Mon Jul 13, 2009 10:39 am
Favourite Light Novel: Ahouka!
Location: Switzerland

Re: ePUB Generator

Post by EusthEnoptEron »

Simon wrote: Then I have a question: how would you write the RegEx to catch the lines 78-80 1287-1289 (I mean the images) [img=www.baka-tsuki.org/project/index.php?ac ... ko:Volume1]here[/img] and use preg_replace to replace them with something other ?

Thanks.
You could do something like:
/<p><br \/>.*\n.*<img[^>]+?src="([^"]+?pic.+?)".*?>.*\n<\/p>/m
Which simply matches all lines that contain an <img> tag with a source that contains the term "pic" and stores the src in the first matching group ($1). Also removes the <p><br />...</p> markup.

Alternatively, you could look for the offset when the gallery is closed, and replace all images after that with a more generic RegEx.


And for a good laugh because it's related: http://stackoverflow.com/questions/1732 ... gs#1732454
(not meaning to imply anything)
User avatar
Simon
Editor-in-Chief
Posts: 508
Joined: Wed Dec 28, 2011 9:06 am
Favourite Light Novel:
Location: !=

Re: ePUB Generator

Post by Simon »

...why the hell did I use img tag ?
EusthEnoptEron wrote:And for a good laugh because it's related: http://stackoverflow.com/questions/1732 ... gs#1732454
That one is good. XD
EusthEnoptEron wrote:/<p><br \/>.*\n.*<img[^>]+?src="([^"]+?pic.+?)".*?>.*\n<\/p>/m
I'll look into this later, it's already pretty late here.

Thanks for a good laugh.
ePUB Generator <<Productive>> : BTE-GEN | Yay, I'm free. Let's see how long it takes for this place to go down.
Fray
Reader
Posts: 7
Joined: Thu Feb 02, 2012 1:34 am
Favourite Light Novel:

Re: ePUB Generator

Post by Fray »

For some reason, the volume 6.5 of Baka to Test to Shoukanjuu cound not be seen by the epub generator :(
User avatar
Simon
Editor-in-Chief
Posts: 508
Joined: Wed Dec 28, 2011 9:06 am
Favourite Light Novel:
Location: !=

Re: ePUB Generator

Post by Simon »

Because I haven't added it. And Ping is still not done with it.
ePUB Generator <<Productive>> : BTE-GEN | Yay, I'm free. Let's see how long it takes for this place to go down.
Fray
Reader
Posts: 7
Joined: Thu Feb 02, 2012 1:34 am
Favourite Light Novel:

Re: ePUB Generator

Post by Fray »

Oh I see!
I thought that the site generates the books on remote server when the user clicks on it.
So it is you who created and hosted them, right?
Really appreciate, it is a pleasure to read it on my kindle :D
Fray
Reader
Posts: 7
Joined: Thu Feb 02, 2012 1:34 am
Favourite Light Novel:

Re: ePUB Generator

Post by Fray »

Oh I see!
I thought that the site generates the books on remote server when the user clicks on it.
So it is you who created and hosted them, right?
Really appreciate, it is a pleasure to read it on my kindle :D
User avatar
Simon
Editor-in-Chief
Posts: 508
Joined: Wed Dec 28, 2011 9:06 am
Favourite Light Novel:
Location: !=

Re: ePUB Generator

Post by Simon »

LIke hell, my script generates the ePUBs, that's why the topicis "ePUB Generator".

As if I would make manually all the ePUBs and update them every single time.

And I need to add the novels manuel because it's easyer to work with all the information.
ePUB Generator <<Productive>> : BTE-GEN | Yay, I'm free. Let's see how long it takes for this place to go down.
User avatar
Shiranui
Astral Realm

Re: ePUB Generator

Post by Shiranui »

The cover images for Zero no Tsukaima Volumes 8 and 12 doesn't come out right. On my Kobo Mini, the cover image is really dark and volume 8's is blurry as well.

Volume 12.5 of High School DxD has a blank cover image. I'm not sure if that's intentional but since there is a cover image on the website, I'm assuming it's an error.

I've checked all three by re-downloading and transferring the files but the problems persisted.
Locked

Return to “Developers and Code”