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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-24-2023, 09:57 PM   #1
Kelzan
Member
Kelzan began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2023
Location: Austin, TX USA
Device: Kindle, Ipad Pro
[GUI Plugin] Audio M3U

This plugin is intended to add audiobook support to Calibre through the use of M3U playlists. I love the Calibre interface, and I have multiple libraries set up for many different purposes. One thing that has been a bit challenging for me, however, is using it for my audiobook collection. Calibre likes to treat each book format to be of a single file, however many audiobooks contain dozens or even hundreds of individual files. Archiving all of the audio files into a single zip archive has been one workaround that I've tried. The problem with this approach, however, is that you then need to unzip the archive in order to do anything with the audio, or to be able to share it with another application like iTunes.

This plugin gets around this limitation by having you store the audio files themselves elsewhere, outside of the Calibre library. Audiobooks are then added to the library through the use of an M3U file, which is a simple text playlist containing a path to all of the audio files. This then makes it easy to have as many files as you want associated with a single audiobook, and they are stored outside of any zip files and easily accessible.

The plugin helps make creating new M3U files, or adding M3U files to existing book entries easy. It can also import and export metadata information from the audio files themselves, including cover artwork. To make sure your M3U paths stay valid, it also has the capability to scan your existing M3U files to insure that there are no broken paths or duplicate files.

Main Features:
  • Dialog to create a new M3U format book from an audiobook directory
  • Dialog to update or add an M3U to an existing book entry
  • Import Metadata from audio files to Calibre
    • Cover artwork
    • Title
    • Author
    • Narrator
    • Duration
    • Total Size
    • Sample Rate
    • Bitrate
    • Mode
    • File Type
    • # Files
    • Genre
  • Export Metadata to audio files from Calibre
    • Cover artwork
    • Title
    • Author
    • Genre
    • Narrator
  • Dialog to inspect the contents of any M3U file
  • Duration configurable to be h:mm:ss format, or total seconds
  • Total size configurable to be in megs, or bytes
  • Support multiple narrators with ampersand delimited names
  • Dialog to scan library for broken or duplicate audio file paths
Special Notes:
  • Audio file tag handling is all done using the excellent mutagen library.
  • Help Documentation
  • This is my very first attempt at a Calibre plugin, I really hope it works for you :-)
Attached Files
File Type: zip Audio M3U.zip (1.50 MB, 23332 views)
Kelzan is offline   Reply With Quote
Old 06-24-2023, 10:00 PM   #2
Kelzan
Member
Kelzan began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2023
Location: Austin, TX USA
Device: Kindle, Ipad Pro
Some screenshots of Audio M3U

Attached images to show Audio M3U in action
Attached Thumbnails
Click image for larger version

Name:	Menu.png
Views:	512
Size:	26.7 KB
ID:	202274   Click image for larger version

Name:	Book Details.png
Views:	464
Size:	1,017.9 KB
ID:	202275   Click image for larger version

Name:	Export Metadata.png
Views:	430
Size:	21.1 KB
ID:	202276   Click image for larger version

Name:	Customize Dialog.png
Views:	405
Size:	60.3 KB
ID:	202277   Click image for larger version

Name:	import metadata.png
Views:	383
Size:	33.7 KB
ID:	202278  
Kelzan is offline   Reply With Quote
Advert
Old 06-24-2023, 10:59 PM   #3
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,956
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Cool - I already use playlists for 'audio-books'.

Following recent provision of the 'data' folder for calibre library books I moved my audio-book MP3 files from where they were into an 'audiobook' sub-folder in the book's 'data' folder and recreated the M3U files.

I'll give this a spin sometime next week.

BR
BetterRed is offline   Reply With Quote
Old 06-25-2023, 12:54 AM   #4
Kelzan
Member
Kelzan began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2023
Location: Austin, TX USA
Device: Kindle, Ipad Pro
Quote:
Originally Posted by BetterRed View Post
Cool - I already use playlists for 'audio-books'.

Following recent provision of the 'data' folder for calibre library books I moved my audio-book MP3 files from where they were into an 'audiobook' sub-folder in the book's 'data' folder and recreated the M3U files.

I'll give this a spin sometime next week.

BR
Awesome, let me know how it works out for you. I've seen the 'data' folder mentioned in the recent release notes and thought that it could be used for that. Seems like there might be an opportunity to have this plugin help make that approach easier, like maybe it could move the audio files and rebuild the M3U for you. Let me know if you come up with any ideas about that.
Kelzan is offline   Reply With Quote
Old 07-05-2023, 08:30 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,956
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Finally got around to taking more than a cursory glance at the plugin.

I don't use M3U playlists for commercial audiobooks. So, much of the plugin's functionality is 'lost' on me. The 'talking' MP3s I download are mainly radio programme episodes, most of which get added to an existing 'data' folder and M3U playlist.

BR
BetterRed is offline   Reply With Quote
Advert
Old 07-05-2023, 08:54 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,956
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Nearly forgot, when I used the Inspect M3U on one of my VLC created playlists I got this error:

calibre, version 6.22.0
ERROR: Unhandled exception: <b>UnicodeDecodeError</b>:'utf-8' codec can't decode byte 0xe9 in position 41: invalid continuation byte

calibre 6.22 Portable embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: en_AU
Successfully initialized third party plugins: Audio M3U (1, 0, 0)
Traceback (most recent call last):
File "calibre_plugins.AudioM3U.ui", line 274, in do_inspect
File "calibre_plugins.AudioM3U.inspect", line 121, in init_data
File "calibre_plugins.AudioM3U.inspect", line 139, in load_text
File "codecs.py", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 41: invalid continuation byte

The MP3s had French titles so lots of diacritics in the M3U. Other M3U's with diacritic free titles were OK.

BR
BetterRed is offline   Reply With Quote
Old 07-06-2023, 04:03 AM   #7
Kelzan
Member
Kelzan began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Jun 2023
Location: Austin, TX USA
Device: Kindle, Ipad Pro
Interesting BetterRed, any ideas what filename it was having issues with? I managed to plow through a bunch of Spanish and Chinese character filenames using utf-8 encoding without a problem. I don't have anything French though, other than some basic language lessons with filenames all in English :-)
Kelzan is offline   Reply With Quote
Old 07-06-2023, 04:53 AM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,956
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Kelzan View Post
Interesting BetterRed, any ideas what filename it was having issues with? I managed to plow through a bunch of Spanish and Chinese character filenames using utf-8 encoding without a problem. I don't have anything French though, other than some basic language lessons with filenames all in English :-)
I verified my diacritic theory with a playlist of an Edith Piaf album, which is in the attached zip. Add the M3U to an empty book and run the Inspect M3U.

The playlists in question were created by VLC, not your plugin.

BR
Attached Files
File Type: zip EP - MP3s.zip (943 Bytes, 168 views)
BetterRed is offline   Reply With Quote
Old 10-29-2023, 10:07 AM   #9
Lichtsucher
Junior Member
Lichtsucher began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2023
Location: Germany - Saarland
Device: android-handy
Help requested

Great plugin makes the following problem with me:
narrator -> MP3-composer
author -> MP3-artist


original german text see below (english translation by Deepl)

By this assignment, the speakers / narrators (narrator) appear in the column author(s) and the author(s) in the column for the speakers / narrators (narrator) for me.
I use the program Mp3tag (version 3.22b) to tag the audio files.
In the input mask there the fields can be defined and assigned to the desired MP3 tags.
The tag COMPSER is in my opinion intended for the author / composer.
The tag ARTSIT or ALBUMARTIST is in my opinion intended for the artists = speakers / narrators.

Is it possible to provide a version where narrator -> MP3-artist and author -> MP3-composer are assigned?

Best regards

------------------------------------------------
Tolles Plugin macht bei mir folgendes Problem:
narrator -> MP3-composer
author -> MP3-artist

Durch diese Zuordnung erscheinen bei mir die Sprecher / Erzähler (narrator) in der Spalte Autor(en) und die Autor(en) in der Spalte für die Sprecher / Erzähler (narrator).
Ich verwende das Programm Mp3tag (Version 3.22b) zum Taggen der Audio-Dateien.
In der Eingabemaske können dort die Felder definiert werden und den gewünschten MP3-Tags zugeordnet werden.
Der Tag COMPSER ist meiner Meinung nach für den Autor / Componisten vorgesehen.
Der Tag ARTSIT oder ALBUMARTIST ist meiner Meinung nach für die Künstler = Sprecher / Erzähler vorgesehen.

Ist es möglich, eine Version zur Verfügung zu stellen, in der narrator -> MP3-artist und author -> MP3-composer zugeordnet werden?

Mit freundlichen Grüßen
Lichtsucher is offline   Reply With Quote
Old 10-30-2023, 04:17 PM   #10
Lichtsucher
Junior Member
Lichtsucher began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Oct 2023
Location: Germany - Saarland
Device: android-handy
Solution attempt

original german text see below (english translation by Deepl)

I have tried to find the solution to the problem myself.
I point out that I have no knowledge in Pyton, I just looked for places in the code that contain the relevant identifiers:
composer, author, artist, narrator, TPE1 (=artist), TCOM (=composer).
Since in my opinion the contents of "narrator" and "author" were interchanged I searched for the relevant places.
I made changes in the following files:
config.py
m3u_utils.py

I give here only the changed line texts (see below).

Ich habe versucht selbst die Lösung des Problemes zu finden.
Ich weise darauf hin, dass ich keine Kenntnis in Pyton habe, ich habe lediglich nach Stellen im Code gesucht, die die relevanten Bezeichner enthalten:
composer, author, artist, narrator, TPE1 (=artist), TCOM (=composer)
Da nach meiner Meinung die Inhalte von "narrator" und "author" vertauscht wurden habe ich die entsprechenden Stellen gesucht.
Bei folgenden Dateien habe ich Änderungen vorgenommen:
config.py
m3u_utils.py

Ich gebe hier nur die geänderten Zeilentexte an.
________________________________________________
config.py:
Zeile 251 - 254 ->
self.narratorGroupBox.setToolTip(_translate("Dialo g", "The narrator of the audiobook.\n"
"Audio M3U assumes this is stored in the \'artist\' field in the audio file tag.\n"
"It is recommend that the column type is \'ampersand separated text\' so that multiple\n"
"narrators can be easily specified."))

m3u_utils.py:

Zeile 25 - 31 ->
# audio.info.pprint()
if "TPE1" in audio:
tagvals["narrator"] = audio["TPE1"][0]
if "TALB" in audio:
tagvals["title"] = audio["TALB"][0]
if "TCOM" in audio:
tagvals["author"] = audio["TCOM"][0]

Zeile 51 - 57 ->
# audio.info.pprint()
if "\xa9ART" in audio:
tagvals["narrator"] = audio["\xa9ART"][0]
if "\xa9alb" in audio:
tagvals["title"] = audio["\xa9alb"][0]
if "\xa9wrt" in audio:
tagvals["author"] = audio["\xa9wrt"][0]

Zeile 226 - 232 ->
# audio.info.pprint()
if "author" in keys:
audio["composer"] = update_fields["author"]
if "title" in keys:
audio["album"] = update_fields["title"]
if "narrator" in keys:
audio["artist"] = update_fields["narrator"]

The attached file contains the modified plugin.
Die angehänge Datei enthält das modifizierte Plugin.
Attached Files
File Type: zip Audio M3U.zip (1.47 MB, 145 views)
Lichtsucher is offline   Reply With Quote
Old 12-25-2023, 11:45 AM   #11
zbyna
Member
zbyna began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2014
Device: Kindle
Quote:
Originally Posted by Lichtsucher View Post
Great plugin makes the following problem with me:
narrator -> MP3-composer
author -> MP3-artist

In my opinion, there is no strict rules for tagging audiobooks. Please see, for example:
here or here.
zbyna 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
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB lrpirlet Plugins 2 08-18-2022 03:15 PM
[GUI Plugin] Manga plugin mastertea Plugins 6 01-06-2022 02:43 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 05:03 PM.


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