Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search by audible code? #4

Open
TGCuser opened this issue Jun 24, 2017 · 36 comments
Open

search by audible code? #4

TGCuser opened this issue Jun 24, 2017 · 36 comments

Comments

@TGCuser
Copy link

TGCuser commented Jun 24, 2017

Hi, would it be possible to tag the MP3 files with Audible's own "codes", and then have the scraper do a search using that code if nothing else matches?
i.e.: the "B00DDVSD34" part from https://www.audible.com/pd/Nonfiction/The-Great-Ideas-of-Philosophy-2nd-Edition-Audiobook/B00DDVSD34

@dethrophes
Copy link

I added support for this on my fork.
dethrophes@6d55e12

@macr0dev
Copy link
Owner

I've added this to the master branch as well. Although if you have issues locating any books through the search I've like to take a look at that.

Adding the audible ID to the tags and/or folder names sounds tedious. If I can write in some exceptions for something that would probably preferable.

@dethrophes
Copy link

It depends on the problem.
Mostly the problem is that my title doesn't cleanly match the on audible. So I would have to rename the titles anyway.
What I found to be more of a problem is the files where there are multiple versions of a book on audible and I want to match to a specific one.
Anyway it's something I use quiet a bit, in all my libs. you can search for movied with the imdb number, or at least you used to be able to. Other agents also support this.

I think it also has to do with how many files you have, i figured out a long time ago that with a lib the size of mine, I'll never be able to tweak the agents to parse it all. It's easier and makes more sense to curate the lib.

@macr0dev
Copy link
Owner

Fair enough. I'm going to rework the section that "removes any text that's in brackets and parens" so that the manual search will work if you put in audible-xxxxxx. Right now it only seems to work if it's in the title of the first track. I'm sure it may work in a few other ways too, but for sure it's not working if you just paste it into the manual search.

You might want to refork after that. Or pick of a few of the tweaks that I've added in the last few days. Most notably a tweak that splits multiple narrators into multiple tags. Previously, they all loaded into the same tag.

@dethrophes
Copy link

dethrophes commented Jul 23, 2017 via email

@AeliusSaionji
Copy link

AeliusSaionji commented Nov 7, 2017

Is this implemented in the current release? I can't figure it out.

Adding the audible ID to the tags and/or folder names sounds tedious.

As someone with an Audible library, Audible audiobooks have the code as their filename when downloaded. It's already there, waiting to be scraped. Here's an example filename: B00IZOP8CI_LC_64_22050_Stereo.aax. Scraping the code out of the filename would be the easiest method by far.

I just discovered this plugin, so forgive me if I misunderstood something. From my perspective, requiring the Album tag to contain the Title is considerably tedious. Audible files are already tagged, and the Album tag is set to the author. I'd have to update the Album tag of every book for this plugin to work.

I'm aware audiobooks can come in parts, and I suppose that is why you've opted to detect the Album as the title. But, why are audiobooks sometimes in parts? Imo if you have a book in parts, you should just combine them into one file.

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@macr0dev
Copy link
Owner

macr0dev commented Nov 7, 2017

I just discovered this plugin, so forgive me if I misunderstood something. From my perspective, requiring the Album tag to contain the Title is considerably tedious.

This metadata agent is designed to piggy back off the built in functions on Plex's music and album features. Because their music libraries group tracks by album, it's necessary to have these tags present. This is not something solely related to identifying the book but is a necessity for Plex's internal organizational structure.

@AeliusSaionji
Copy link

Plex doesn't support aax files

I'm aware. They're encrypted and require a conversion. I convert to mka, a format which happens to support chapters, thereby solving navigation issues.

Having a 30+ hour m4b file isn't supported by many clients.

Thank you for explaining, but the answer just makes me wonder: why not use a better client? If your client can't handle large files, it must be pretty dated, or poorly written...

Because their music libraries group tracks by album, it's necessary to have these tags present.

The tags are present. It turns out I misread what the tags where, though. Here's a sample audiobook, with metadata as reported by ffmpeg.

    genre           : Audiobook
    title           : The Subtle Knife: His Dark Materials, Book 2 (Unabridged)
    artist          : Philip Pullman
    album_artist    : Philip Pullman
    album           : The Subtle Knife: His Dark Materials, Book 2 (Unabridged)
    comment         : In this stunning sequel to The Golden Compass, the intrepid Lyra finds herself in a shimmering, haunted otherworld, Cittagazze, where soul-eating Specters stalk the streets....
    copyright       : ©1997 Philip Pullman; (P)Random House, Inc., Listening Library, A Division Of Random House, Inc.
    date            : 2003

Maybe the issue is your plugin or plex just aren't getting the tags out of the mka format? Where do we stand on detecting the audible code in the filename?

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@macr0dev
Copy link
Owner

macr0dev commented Nov 7, 2017

The tags are present. It turns out I misread what the tags where, though. Here's a sample audiobook, with metadata as reported by ffmpeg.

That's all fine and good that ffmpeg reports them. If Plex doesn't see them, they might as well not be there.

Maybe the issue is your plugin or plex just aren't getting the tags out of the mka format?

The metadata agent doesn't interact with the files. That's the scanners job. The agent takes whatever Plex will give it.

Where do we stand on detecting the audible code in the filename?

It's not a priority. If your tags are well maintained and match closely enough to what's on audible's website it should match.

@AeliusSaionji
Copy link

Confirmed, plex just isn't getting tags out of mka. I'll have to report this to plex.

Unfortunately, ffmpeg doesn't appear to support m4b, so I can't realistically use that as a target format for my library. m4a doesn't support chapters, and mp4 isn't detected as "music" by plex.

MKA remains the best solution.

In the meantime, if the topical feature is not implemented, and the idea is still on the table, shouldn't this issue be open? For what it's worth, getting information from the filename would make sense as a feature in your plugin- this "tedious" method is consistent with how plex normally operates. It's an abberation to not have this in some form.

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@macr0dev
Copy link
Owner

macr0dev commented Nov 7, 2017

In the meantime, if the topical feature is not implemented, and the idea is still on the table, shouldn't this issue be open? For what it's worth, getting information from the filename would make sense as a feature in your plugin- this "tedious" method is consistent with how plex normally operates. It's an abberation to not have this in some form.

All I can say is that it's not as simple as you're laying it out. This is a metadata plugin. Plex hands off certain data to agent and it can use that data to attempt to provide a match and provide details back. If an album has multiple tracks, it doesn't pass each track. I'm sorry that you find Plex's method of grouping tracks into albums "tedious." But this is not the place to address that problem.

And considering that this isn't done with ANY OTHER music feature inside Plex, it's not an "aberration." This agent works exactly like Plex expects it do.

I'm sorry that you're having trouble getting things to work like you want. But hundreds of others are not having any problem. Which means that making code changes to do something the way that you want is not the answer.

And frankly, you're just being kind of rude about something that people are spending their free time doing for the good of the community.

@AeliusSaionji
Copy link

I'm sorry that you find Plex's method of grouping tracks into albums "tedious."

I was quoting your earlier use of "tedious"- in which you referred to renaming files. Which is the method one must use in plex's main function: video. I don't find it tedious, but I continue to quote you since I found it strikingly odd that your initial dismissal of the idea is based on something one routinely does for plex.

And frankly, you're just being kind of rude

Sorry you feel that way. I think you've been misunderstanding a few points throughout this discussion.
Likewise, the feeling I get from you is you're "brushing me off" this entire time, which might have contributed to my tone. Your responses seem minimal to the point that you're annoyed I'm even bringing up this request. This issue being closed contributes to that feeling.

@macr0dev
Copy link
Owner

macr0dev commented Nov 7, 2017

The issue was closed back in July because 1) it was unnecessary and 2) it goes against the convention that is considered pretty standard for the vast majority of audio tracks. It has no bearing on this conversation.

I'm not sure how you're feeling brushed off though. Both myself and another developer have been explaining to you how this all works and making suggestions on what your problem may be. If I wanted to bush you off, I'd just not respond.

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@AeliusSaionji
Copy link

AeliusSaionji commented Nov 7, 2017

The issue was closed back in July because 1) it was unnecessary and 2) it goes against the convention that is considered pretty standard for the vast majority of audio tracks.

Conventionally music programs rely on tags, yes. But I'm considering the functionality of plex on the whole: a database for general media.

In this subcontext of plex, we have a reliable, consistent, and exact database of IDs (audible). This may not be strictly necessary, but it certainly makes sense within this ecosystem and adds absolute precision to matching. I think that's valuable and topical.
In the process of manually matching my audiobooks, I've already found a couple of books that have multiple audible releases, and I've only imported 7 books so far!

And yes, thank both of you for your explanations and help thus far. Thank you for your work on this agent. Even with the manual matching I have to do (*) , the functionality provided is great.

(*) Thanks for the suggestion about m4b @dethrophes but I will not be taking that approach; much prefer to see proper mka support implemented in plex.

Actually it was closed because it was working... I haven't used it in a
while though.

Basically the syntax was/is to add [audible-] to the Album name.

Ah, album name. That would explain why I couldn't get it to work, as I was hoping to handle this on the file level. While I'm happy to change tags for music files (music is generally its own disorganized beast), in the case of audible we have exactly one upstream source and exactly one correct match (and files ideally have one correct checksum). Beyond the initial decryption, I personally prefer to keep the source files untouched. It's the same for my DVD and BD rips: I do my best to maintain the integrity of my archive.

Does your fork also operate from filename, or is that something you would consider implementing?

Thanks again.

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@macr0dev
Copy link
Owner

macr0dev commented Nov 7, 2017

To be honest the plex support for audiobooks is pretty bad. I'm going back
and forth currently between emby, plex and booksonic and I'm not happy with
any of the solutions...

Even I'm not using Plex to listen to them. I'm just obsessed with keeping things organized. I've got book sonic set up, but I'm just using it for distribution. I'm using a completely different app on Android called Listen Audiobook player. It's the only thing next to the Audibe app that I actually like.

The problem I would have, adding a generic implementation is that I would
have to give a way to specify the filename format for different users, as
the file naming convention you use is not ubiquitous,.

This is why I was never a big fan of the idea in the first place. Audio is more like TV Shows than it is movies. There are accepted standards on naming conventions that exist for Audio and tagging. Tagging the file names for movies to be used with specific scanners is great - but not a standard. I've done my best to keep this process as generic as possible so that the content would be portable between applications specifically because none of the current solutions are anymore than that just OK.

Making or letting people alter their files to match the scanner defeats the purpose that I originally had. Plus, it puts people down the road of being married to a specific app because it's too much work to change things for another one.

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@macr0dev
Copy link
Owner

macr0dev commented Nov 7, 2017

You're picture didn't come through. Just says 'inline image 1'

But I guess just call me a purist then. /s

If you want to throw something together for it and it doesn't make something else weird I don't mind including it at all. I just hate the idea of anyone tying things directly to an agent or in this case audible. I'll even throw it in the README, but I would definitely list it as a "for books that don't seem to want to match" or "books that are listed weird on audible."

I just had a conversation through the forum last week with a fellow who never looked at audible to see how the German language version of Game of Thrones were listed and couldn't get it to match. The titles are listed weird in audible and that might be a good use of adding in the ID and not having to change you tags. But then again, that's when I use the manual match....

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@macr0dev
Copy link
Owner

macr0dev commented Nov 7, 2017

I'll throw it on my test server tonight and do some tests. I keep a plex server install on a second box just for testing the agent. Keeps me from having to kick people off when I break something doing a test!

I'll run it through all of my normal agent tests and make up a few new ones for testing this new feature. Be good to have handy for the next time audible gets cheeky with their site code!

@dethrophes
Copy link

dethrophes commented Nov 7, 2017 via email

@AeliusSaionji
Copy link

Oh, nice! I'll take a look tomorrow.

But a quick clarification: where the file name is B00IZOP8CI_LC_64_22050_Stereo.aax, the audible id is only the first part: B00IZOP8CI.

@AeliusSaionji
Copy link

You probably knew that already. I'm not sure why the ID didn't work for you: this url brings me right to the page: https://www.audible.com/pd/B00IZOP8CI

@dethrophes
Copy link

True but that isn't how the code currently gets the book entry, it does so via a search.
Aside from that, that page actually has syntax errors in it that causes the python json parser to throw and exception. As such it isn't currently possible to do that book for multiple reasons.

As such to parse that particular book, either need to find another json lib that can ignore the syntax issue, write a own parser or something else.

I mean feel free to make your own branch and add these changes, nobody is stopping you.

@macr0dev macr0dev reopened this Nov 9, 2017
@macr0dev
Copy link
Owner

macr0dev commented Nov 9, 2017

OK. I'm opening this one back up. I look at what you came up with, but I'm hesitating at it being something that needs to be turned on. Tell me what you think of this.

a regex of both the filename and the album name that checks for a 11 character string at the front that has to contain both numbers and letters and end with a dash. For example:

B00D48L3A6-Lexicon.mp3 : As the file name.
or
B00D48L3A6-Lexicon : As the album Title

I'm thinking between the number/letter requirement, front of the string requirement, and ending with a dash a nice method could be built for people to name their books or perhaps use it as a manual search method also. Hopefully being that restrictive could mean building it in as an option that doesn't have to be turned on and off to avoid false positives.

Thoughts?

@dethrophes
Copy link

dethrophes commented Nov 9, 2017 via email

@macr0dev
Copy link
Owner

macr0dev commented Nov 9, 2017

This is what I get for trying to do stuff on my laptop at work instead of on my three monitor setup at home.

Am I right that you've got this set to check for a preference? What's the worry there?

@brandonscript
Copy link
Contributor

Re-opening this old wound. What's the current status of this, and what's the current way to get id lookup working using the master of this repo?

@macr0dev
Copy link
Owner

According to my history, audible made a major site revision the day of my last comment that resulted in changing the way it scrapes the page and it honestly looks like I just forgot about it.

Are you looking to make use of it as a manual search or are you looking at file naming?

@brandonscript
Copy link
Contributor

Just manual searching. A couple books came up that have a pretty common title, and since the manual results don’t show date or author, I had to try each one until I found the correct match.

@macr0dev
Copy link
Owner

Yeah, I do very much wish that their search field had more options that I could make use of. I'm trying to play catch up on some things and am not currently traveling much this week for work. I'll see if I can slip something in there.

It's been a while since I added a new feature. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants