[Release] MyAnimeList.net Metadata Agent

I was having the same problem, it was not getting any info so there is no summary, tagline, rating, year, poster, etc. It just started happening while I was running 3.3.1 and still occurred with 3.5.

While I was poking around I happened to click 'Edit Library' in my Anime section and in the Advanced section noticed that for some reason my Agent had been switched from MyAnimeList.net to Person Media Shows. I switched it back to MyAnimeList.net, hit 'Save Changes' and it found all the new shows I've added.

Make sure that you guys triple check that. I'm the only one that has access or even knows how to make Plex changes, and for some reason it looks like it switched on its own.

Same here, there're several animes do not have their poster art downloaded.
Latest version with Windows 7.

like I said before please add the log file to your post as attachement so that I can take a look. Without it I can't help you.

And here is how do you find the log file https://support.plex.tv/hc/en-us/articles/200250417

Great project! thanks! There seems to be some minor bugs though. Particularly with the Poster Cover, but it also happens with (Genre, Producer, Background, ect).

In your API you have:

http://daraku-mal-api.net/restful-services/anime/JSON/id/300

{"url":["http:\/\/cdn.myanimelist.net\/images\/anime\/4\/26940.jpg","http:\/\/cdn.myanimelist.net\/images\/anime\/7\/11957.jpg","http:\/\/cdn.myanimelist.net\/images\/anime\/2\/12743.jpg","http:\/\/cdn.myanimelist.net\/images\/anime\/4\/20718.jpg"]}

But when there is only 1 Cover art, your API returns: 

http://daraku-mal-api.net/restful-services/anime/JSON/id/1225

[{"anime":{"airedEnd":"1996-06-25T00:00:00.000+02:00","airedStart":"1995-07-25T00:00:00.000+02:00","cover":{"url":"http:\/\/cdn.myanimelist.net\/images\/anime\/7\/12744.jpg"},"duration":"45 min. per episode","episodes":3,

i.e. The cover['url'] key returns a str, and is NOT in a LIST (if only 1 entree is returned).

This currently breaks your code, which is expecting a list, and then when it gets a string (if only 1 entree is returned), it initially passes "h" as the url for the cover. And can't download the cover. It's not able to set the cover art for any anime which only has 1 poster returned by ur API... I think you'll have to have ur API always return a LIST of strings for ur code to work (even if only 1 entree is returned)... or test the code to see if collections['anime']['cover']['url'] is a string or a list before you pass it into the for loop.

This is also the case for when genre/backgrounds/producer/ect/ect all have 1 entree and the API returns it as a single string instead of a list. It complains later that unicode doesn't have __iter__ (later in the plex code).

Great project! thanks! There seems to be some minor bugs though. Particularly with the Poster Cover, but it also happens with (Genre, Producer, Background, ect).


thank you for this detailed bug report I will look into it and fix it in the next few days.

okay fixed it and updated the API, it should work now, let me know if there is anything else

Heyas!

I noticed you updated the API, and it now has the single entries returned as a list of strings. Thanks!

I do notice now though you changed the key on cover/producer/genre... each now is ['cover']['values']...

http://daraku-mal-api.net/restful-services/anime/JSON/id/1225

[{"id":"1225","title":"3x3 Eyes Seima Densetsu","cover":{"values":["http://cdn.myanimelist.net/images/anime/7/12744.jpg"]},"episodes":"3","typ...

But the latest code you have posted (v3.5) still references them as ['cover']['url']. I think you'll have to update the code to access the new ['values'] key... or else change the API to use the old keys   ['url']   /  ['name']   /  ['name']...   I do not think any of the code you have posted on your source-forge site will work as is...

Heyas!
 
I noticed you updated the API, and it now has the single entries returned as a list of strings. Thanks!
 
I do notice now though you changed the key on cover/producer/genre... each now is ['cover']['values']...
http://daraku-mal-api.net/restful-services/anime/JSON/id/1225

[{"id":"1225","title":"3x3 Eyes Seima Densetsu","cover":{"values":["http://cdn.myanimelist.net/images/anime/7/12744.jpg"]},"episodes":"3","typ...
But the latest code you have posted (v3.5) still references them as ['cover']['url']. I think you'll have to update the code to access the new ['values'] key... or else change the API to use the old keys   ['url']   /  ['name']   /  ['name']...   I do not think any of the code you have posted on your source-forge site will work as is...

well, this is quite confusing, while accessing the XML it returns

   http://cdn.myanimelist.net/images/anime/7/12744.jpg

but in JSON its
 

"cover":{"values":["http://cdn.myanimelist.net/images/anime/7/12744.jpg"]},

strange behaviour, I try to fix this on API side. Hopefully I get it working so you don't need to download another version :)

Edit:
New API version is up, quite easy to fix, thank you again :)

HA.. your API further changed... you no longer have an ['anime'] key in the API...

You used to have:

http://daraku-mal-ap...me/JSON/id/1225

[{"anime":{"airedEnd":"1996-06-25T00:00:00.000+02:00","airedStart":"1995-07-25T00:00:00.000+02:00","cover":{"url":"http:\/\/cdn.myanimelist.net\/images\/anime\/7\/12744.jpg"},"duration":"45 min. per episode","episodes":3,

But now...

http://daraku-mal-ap...me/JSON/id/1225

[{"id":"1225","title":"3x3 Eyes Seima Densetsu","cover":{"url":["http://cdn.myanimelist.net/images/anime/7/12744.jpg"]},"episodes":"3","type":"OVA","airedStart":"1995-07-25T00:00:00.000+02:00","airedEnd":"1996-06-25T00:00:00.000+02:00","otherTitles":{"synonyms":"Shin 3x

It has no ['anime'] key referencing it. So in your MALAgent code all the times you reference: collection['anime']   you get a key error.

[{"anime":{"airedEnd":"1996-06-25T00:00:00.000+02:00","airedStart":"1995-07-25T00:00:00.000+02:00","cover":{"url":"http:\/\/cdn.myanimelist.net\/images\/anime\/7\/12744.jpg"},"duration":"45 min. per 

this is how the response looks like right now, as it should have been.

I hope this fixes the problems ;)

HAHA.. no... It is now as it originally was in the very beginning...  For Single Entries of "Cover", "Genre", and "Producer" it returns a String... NOT a List of Strings... This causes anime's with only 1 entry to set "h" as the first URL for the cover art (for example in the entry you listed)....

http://daraku-mal-api.net/restful-services/anime/JSON/id/1225

[{"anime":{"airedEnd":"1996-06-25T00:00:00.000+02:00","airedStart":"1995-07-25T00:00:00.000+02:00","cover":{"url":"http:\/\/cdn.myanimelist.net\/images\/anime\/7\/12744.jpg"},"duration":"45 min. per ...

It should be:

[{"anime":{"airedEnd":"1996-06-25T00:00:00.000+02:00","airedStart":"1995-07-25T00:00:00.000+02:00","cover":{"url":["http:\/\/cdn.myanimelist.net\/images\/anime\/7\/12744.jpg"]},"duration":"45 min. per ...

I.e. Square Brackets  [  ..  ] should be around the ['cover]['url'] key even if only 1 string is in it. This should be true for "Genre" and "Producer" as well...

... Or if you keep the API as is, you need to have your Agent test if it is a string or list before passing it into your for loop...

if isinstance(cover,basestring):
   cover = [cover]

well, back to square one then, god damnit

so.... after like 5 hours yesterday trying to fix this, I actually broke my code so hard that I think it's better to start from scratch ... I think this shouldn't take that much time because most of the work is already done.

I'm glad I'm using SVN for code management so I only needed to checkout a older revision of my code :D

New Agent Version: 3.6
 

Version: 3.6
- Animes without english title will now return banner and background images again
- Animes Informations like cover etc. with only one element will now be added to the metadata again
- the original available at date of the show will now be set for every episode animes will be displayed in the "On deck" category

New Agent Version: 3.7
 

- minor bugfixing for Movie section, should work again

sorry for that, didn't really pay attention to the whole movie section thing

I copied the MAL.bundle to the plug ins directory and restarted my server (on Maverick), but I don't see the agent under TV show.  Do I need to do something else?  Thanks.

Nope, this should be all you need to do actually, don't know why its not working, take a look at the plex log file, you could probably find an answer there

I looked over the Server log and Scanner log but I don't see anything weird.  It seems to start okay, according to the log.  I just don't see it as an option when I go to fix unmatched episodes.

Aug 03, 2014 20:36:46 [0x10ad98000] DEBUG - Starting plug-in ~/Library/Application Support/Plex Media Server/Plug-ins/MAL.bundle.

Aug 03, 2014 20:36:46 [0x10ad98000] DEBUG - Perfect cache hit, we don't need to start [net.devvsbugs.coding.plex.myanimelistagent] yet.

just did a little search and stumbled over this reddit post http://www.reddit.com/r/PleX/comments/1x4ciz/plex_not_showing_any_media_agents_all_of_the/ maybe this will help you

Small question, i've read everything here and on your Sourceforge page so maybe i overlooked it, sorry if that's the case.

Does this plugin only do scraping, or does it also sync back to myanimelist, like when i watch an episode this is synced back to my myanimelist account and shows it as watched there ?