Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 11-28-2018, 12:44 AM   #1
xiatian
Member
xiatian began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Oct 2018
Device: kindle
parse_index parse audio files?

Can parse_index fetch audio files? It would be amazing if the list of articles can contain the dictionary like {'audio': audio url}. Just convert it to epub and you can get an ebook with audio. Isn't that awesome?
xiatian is offline   Reply With Quote
Old 11-28-2018, 05:35 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 33,913
Karma: 10253972
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
no i'm afraid not.
kovidgoyal is offline   Reply With Quote
Old 11-28-2018, 09:25 AM   #3
xiatian
Member
xiatian began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Oct 2018
Device: kindle
Thank you anyway! I've read an epub ebook with embeded audio. That's truly awesome!
xiatian is offline   Reply With Quote
Old 01-09-2019, 01:22 PM   #4
xiatian
Member
xiatian began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Oct 2018
Device: kindle
Hi,kovidgoyal
Today I wrote a simple html:
Quote:
<html xmlns="http://www.w3.org/1999/xhtml">
<audio src="1.mp3" controls="controls"> </audio>
</html>
and then I used ebook-convert to convert it into epub, then the audio worked!
Next, I wrote dozens of html files like this one and then I used a parse_index recipe with url "'file://" to refer to there html files. But none of the audio files were added.
So I'm quite confused. Why can it work when I converted a single html file but not with parse_index which deals with a bunch of html files?
Could you help me?
xiatian is offline   Reply With Quote
Old 01-09-2019, 07:12 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 33,913
Karma: 10253972
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
first of all if you convert to MOBI you will get no audio, since MOBI does not support that. Secondly, the recipe system only downloads images and stylesheets, not other resource files such as audio/video/javascript.
kovidgoyal is offline   Reply With Quote
Old 01-09-2019, 09:34 PM   #6
xiatian
Member
xiatian began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Oct 2018
Device: kindle
Thanks, kovidgoyal

Fisrt, I convert it into epub. It works if I convert one single html file into epub. The audio file can be successfully added into epub.

Second, all the audio files already exist in my local system. So the recipe needn't to download them. I just want to use parse_index recipe to convert a bunch of html files and add the audio files(these audio files already exist and correctly refered to in the html file code) into an epub book.

When I convert a single html file, which contain <audio> element and it works(in ibooks). But sadly when I convert a recipe, which points to dozens of these kind of html files, it fails to add audio files.

The reason why I want to use parse_index is that it can automatically generate TOC since I have many html files on my local system. Sure I can convert these html files one by one, but that's not what I want.

Can I make some tweaks to parse_index so that it can add my local audio files, just like converting a single html file? If not, is there any other possible solutions? I really want to achieve this, so I sincerely hope you can give me more guidance.
xiatian is offline   Reply With Quote
Old 01-09-2019, 10:18 PM   #7
xiatian
Member
xiatian began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Oct 2018
Device: kindle
To put it simply, I have the following feed:

Quote:
[(u'Chapter One', [{'url': u'file:///root/test/test/1-1.html', 'title': u'Day One'}, {'url': u'file:///root/test/test/1-2.html', 'title': u'Day Two'}]), (u'Chapter Two', [{'url': u'file:///root/test/test/2-1.html', 'title': u'Day Three'}, {'url': u'file:///root/test/test/2-2.html', 'title': u'Day Four'}])]
How can I use ebook-convert to convert these html files into a single epub book rahter than using a recipe system(because recipe cannot add audio files)?
xiatian is offline   Reply With Quote
Old 01-10-2019, 02:19 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 33,913
Karma: 10253972
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://manual.calibre-ebook.com/faq...specific-order
kovidgoyal is offline   Reply With Quote
Old 01-10-2019, 03:11 AM   #9
xiatian
Member
xiatian began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Oct 2018
Device: kindle
Awesome!It's so nice of you! Thank you!
xiatian is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Books with audio files associated with them userwack Library Management 5 07-09-2018 10:20 PM
Use parse_index to parse XML? surf Recipes 0 02-10-2013 05:36 AM
Audio files jgray Workshop 5 09-19-2009 02:16 PM
Query about audio files SolidSquid Calibre 1 06-12-2009 11:53 AM


All times are GMT -4. The time now is 12:47 PM.


MobileRead.com is a privately owned, operated and funded community.