seanap / Plex-Audiobook-Guide

A walkthrough for optimal Audiobook experience using Plex
1.44k stars 46 forks source link

Artist info not populating in Plex #1

Closed isaacolsen94 closed 2 years ago

isaacolsen94 commented 4 years ago

I'm not sure if I've done something wrong but the audio books them selves populate perfectly for me. However, I don't get any information on the author (artist) in Plex. Do I need to add this manually or should it populate as well?

seanap commented 4 years ago

My example picture may be a little misleading, I'm sorry about that. The Author's picture can be (manually) dropped in the Author's folder and Plex will pick that up (most of the time), the Author description was just copy and pasted from Goodreads. Still trying to come up with a good way to pull the author data automatically but so far unsuccessful.

isaacolsen94 commented 4 years ago

Makes more sense. It was driving me crazy. I'm no python programmer, but using your idea of "desc,reader" txt files I thought about doing a bio file for the author. I don't know a good source to get info but say I copied good reads into said bio file in the author folder. Could there be a step added to the Audiobook agent to import it? Similar to this example: https://forums.plex.tv/t/music-metadata-from-tag-or-file/402629 ?

Here is the file they reference: MusicSummaryTest.bundle (1).zip

I've tried to combine the two but I don't know enough to get it to work properly. I don't know if you think this would be a good route to take?

seanap commented 4 years ago

This comes back to one of the many issues with Plex. I know macr0 has been trying to include Author data in his agent since 2017, and has not found a solution yet.
The two issues are scarping the author data when there is no public database into either tags or helper files, and Plex putting that data into it's tags. I can scrape audible or goodreads in mp3tag to pull the data, but where do we put it? It would have to be set to a tag, then as part of the action command we can export these tags to files. However it would probably be easier for someone smarter than I to get a python script to look at the /audiobook directory and scrape author picture and description and save to folder directly rather than using mp3tag. Neither of those methods will automatically put that data into plex though. The agent would need to be modified to import those files and set the tags, if that's even possible. Solve this issue and we can make the others work.

Diegus83 commented 3 years ago

I have had some luck pulling Author's bios from Last.fm and sometimes that includes the artists picture but I have to open the Artist in Plex and manually match it using the Last.fm agent.

seanap commented 3 years ago

I've seen this work with some popular authors as well. In the notes of the Audiobook Agent, the creator wrote "-Currently, I don't have a great source for author data. What populates now (if any) is being done automatically from last.fm. You're welcome to go add some data there. This was kind of a happy accident."

I noticed that forcing a Match with last.fm on the author's page, changes the match for the albums (books), and I lost the Narrator (in the style tag) and if they are mp3's you would also lose the Summary (plex review tag).

Diegus83 commented 3 years ago

That’s an interesting find. I was using macr0 version of the plug-in until today and now decided to start over and give this one a try. The metadata option make more sense to me. Also I’m just starting with python and I was wondering if you have any idea how would you go about debugging this plugin? I mean other than changing the code, going into Plex, refresh the metadata, etc. Is there a way to visualize the html that is being parsed and the tags that are being matched for example? Thanks for your time.

seanap commented 3 years ago

changing the code, going into Plex, refresh the metadata This is how I did it. I don't know of a way to visualize the html of what's being matched, but I'd be very interested if you found a way. The thing that bugs me is if you have a series of books that have very similar names (ex. Saucer, Saucer: The Conquest, Saucer: Savage Planet) the audiobook agent tends to match them all as the first book. The only way I can tell is if the covers are the same (unmatch all then rematch manually to fix).

There isn't anything wrong with the way macr0dev puts the information into plex, but I found with large libraries the Plex Genre tag got very cluttered, and I was unable to just browse the genres when there were thousands of other entries that weren't genres. That's why I made the few changes to his agent to put the metadata in separate tags.

Diegus83 commented 3 years ago

To answer my own question: You can output the html that is about to be parsed like this:

# we can log the html that is about to be matched
self.Log(HTML.StringFromElement(html, encoding='utf8'))

There is also a way to save the content of the object html to a file to inspect it later:

# output the html to a file
html_string = HTML.StringFromElement(html, encoding='utf8')
Data.Save('contenido',html_string)

In this case the content was saved to Plex Media Server/Plug-in Support/Data/com.plexapp.agents.audiobooks/DataItems/contenido

Locke3500 commented 3 years ago

I've seen this work with some popular authors as well. In the notes of the Audiobook Agent, the creator wrote "-Currently, I don't have a great source for author data. What populates now (if any) is being done automatically from last.fm. You're welcome to go add some data there. This was kind of a happy accident."

I noticed that forcing a Match with last.fm on the author's page, changes the match for the albums (books), and I lost the Narrator (in the style tag) and if they are mp3's you would also lose the Summary (plex review tag).

I managed to fix this by clicking on the author, matching to last.fm, and then going to the books and fixing each match back to the audiobook plugin.

seanap commented 2 years ago

The new Audnexus agent now pulls author pic, bio, and genres from Audible if available.