Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-27-2018, 11:44 PM   #1
xiatian
Connoisseur
xiatian began at the beginning.
 
Posts: 50
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, 04: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: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
no i'm afraid not.
kovidgoyal is offline   Reply With Quote
Old 11-28-2018, 08:25 AM   #3
xiatian
Connoisseur
xiatian began at the beginning.
 
Posts: 50
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, 12:22 PM   #4
xiatian
Connoisseur
xiatian began at the beginning.
 
Posts: 50
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, 06: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: 43,856
Karma: 22666666
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, 08:34 PM   #6
xiatian
Connoisseur
xiatian began at the beginning.
 
Posts: 50
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, 09:18 PM   #7
xiatian
Connoisseur
xiatian began at the beginning.
 
Posts: 50
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, 01: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: 43,856
Karma: 22666666
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, 02:11 AM   #9
xiatian
Connoisseur
xiatian began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Oct 2018
Device: kindle
Awesome!It's so nice of you! Thank you!
xiatian is offline   Reply With Quote
Reply


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 09:20 PM
Use parse_index to parse XML? surf Recipes 0 02-10-2013 04:36 AM
Audio files jgray Workshop 5 09-19-2009 01:16 PM
Query about audio files SolidSquid Calibre 1 06-12-2009 10:53 AM


All times are GMT -4. The time now is 08:19 PM.


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