[Release] MyAnimeList.net Metadata Agent

Released a new version, 6.0.1 which should fix the issue. Was an idiotic bug.

@Fribbtastic you are awesome! I will update right away.

@Fribbtastic I have successfully updated my library and all looks great.

While looking at the library and comparing it to my movies library, I had an idea that I felt I should suggest to you as a possible feature request. (If you are open to it) Is it possible to sync the alternate title data on MAL to the Tagline or original title section? Ideally, I would actually like a check option to sync the title to original title and the sort by title and then sync the English title to the main title field.

Regardless, of feature requests, thanks again for your help fixing that bug!

You can open a new issue here and tag it as feature request then we can discuss those things there.

I’m getting the following error with PMS 1.15.5.994 on Ubuntu 18.04. My guess is that MAL requires SNI to access now and the default Framework doesn’t support it but that doesn’t sound right for other sites.

2019-04-30 22:46:25,056 (7f56fffff700) :  DEBUG (myanimelist:137) - [MyAnimeList.net] [MyAnimeListUtils] Cover: https://cdn.myanimelist.net/images/anime/11/39717.jpg
2019-04-30 22:46:25,056 (7f56fffff700) :  DEBUG (networking:166) - Requesting 'https://cdn.myanimelist.net/images/anime/11/39717.jpg'
2019-04-30 22:46:25,110 (7f56fffff700) :  CRITICAL (agentkit:1078) - Exception in the update function of agent named 'MyAnimeList.net Agent', called with guid 'net.fribbtastic.coding.plex.myanimelist://11757?lang=en' (most recent call last):
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1076, in _update
    agent.update(obj, media, lang, **kwargs)
  File "/home/cereal/.plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MyAnimeList.bundle/Contents/Code/__init__.py", line 171, in update
    self.updateTvShow(metadata, media, lang)
  File "/home/cereal/.plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MyAnimeList.bundle/Contents/Code/__init__.py", line 87, in updateTvShow
    AGENT_MYANIMELIST.getData(metadata, "tvshow", media)
  File "/home/cereal/.plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MyAnimeList.bundle/Contents/Code/myanimelist.py", line 140, in getData
    metadata.posters[str(apiAnimeCovers)] = Proxy.Media(HTTP.Request(str(apiAnimeCovers), sleep=2.0).content)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 265, in content
    return self.__str__()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 243, in __str__
    self.load()
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/components/networking.py", line 181, in load
    f = self._opener.open(req, timeout=self._timeout)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 438, in open
    response = self._open(req, data)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 456, in _open
    '_open', req)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 416, in _call_chain
    result = func(*args)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 1225, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/plexmediaserver/Resources/Plug-ins-4610c6e8d/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/urllib2_new.py", line 1192, in do_open
    raise URLError(err)
URLError: <urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)>

Thanks for reporting this.

I could reproduce the problem and while I have not fully understood why the problem turns up, seems like this is a very old problem that plex has (found forum posts from 2016), I changed the library used to request the anime covers from myanimelist and the SSL protocol context.

While testing the changed way it worked for me and covers were downloaded again. I uploaded a new version in the usual place.

GitHub Issue: https://github.com/Fribb/MyAnimeList.bundle/issues/9

https://coding.fribbtastic.net/projects/myanimelistagent/

Thanks for the update again! A few weeks ago image art stopped downloading. I came here to post about it but you already fixed it!

Thanks.

Is there any way to force a match by manually specifiying the myanimelist id?

No matter what I name the files, I cannot get a valid match against https://myanimelist.net/anime/39592/Kidou_Senshi_Gundam__The_Origin (Mostly getting the 2015 version, but not the 2019 version)

There is no way to reference an Anime directly by its ID on myanimelist.

However, searching a bit on MAL if you use the title ’ Mobile Suit Gundam: The Origin’ I think you should be able to find it.

And if that doesn’t help you can always do a manual match.

Unfortunately, no luck. See https://imgur.com/a/bw8TZQG.

Would it be worth raising a feature request for it on github? I might have a play around at some point and submit a pull request if I get anywhere (python is not my primary development language).

I’m thinking something along the lines of you manually searching during fix match for id:, and instead of it making a search request to the fribbtastic API, instead making a get anime details request and faking a search response.

I think you have two options:

  1. Rename your file to Kidou Senshi Gundam - The Origin and try again.
  2. Go to Search Options, check that MyAnimeList,net Agent is selected and look for Kidou Senshi Gundam: The Origin.

Oh boy, I finally understood the issue.

This is probably a problem with how the search on MAL works since the Atarashii API probably also only parses the website search. Whatever you search you only get the 2015 version.

The Agent could bypass this if you could add the ID in the Title or as tag or something.

You can create this as an issue on github and assign it the feature request tag so that I can take a look on how this could be done.

Hi, found a little bug with the date. Some Animes does not have an day or month on MAL. So your regex gives an error.

ERROR (myanimelist:128) - [MyAnimeList.net] [MyAnimeListUtils] There was an Error while adding the Aired Date time data '2009-12' does not match format '%Y-%m-%d'

Your Plugin does not add an date in the metadata.
Example Anime without day: https://myanimelist.net/anime/7805/Baka_to_Test_to_Shoukanjuu__Mondai_-_Christmas_ni_Tsuite_Kotae_Nasai
Example Anime without day and month: https://myanimelist.net/anime/1369/Detective_Conan_OVA_01__Conan_vs_Kid_vs_Yaiba

Maybe you add 01 if day/month is missing?

This is not really a bug. I expect this to be a valid Date format which it is not.

I could possibly hack something together there to get a date from the available information but since MAL is not really consistent I would have to deal with too many possible options like ‘Dec, 2009’ or ‘2000’ just from the two you linked.

However, I can do it as I did with the episode in which I use the current system date if the available date is not valid.

Personally, I don’t think we should neglect MAL that much if you don’t get the right Data then we rather should add the data to MAL instead of finding a workaround in the Agent. This would then profit both.

added MyAnimeList.bundle to %LOCALAPPDATA%\Plex Media Server\Plug-ins then restarted plex server but agent doesn’t appear in list of available options for libraries. However, I got hamatv to work. Am I missing something?

edit: fixed, weird, I have to go into settings>agents for plex to recognize Myanimelist got installed.

Hello, for a couple years now, the mls agent worked flawlessly but for some reason since monday it completely disappeared from plex, i checked the plug-in folder in case anything changed from an update or something but no, the mls bundle is still there with the correct permissions and yet it suddenly stopped showing up on plex, what can i do? (I’m on linux)

That is weird, it shouldn’t just vanish just like that. Some things you can do to check.

  1. restart the server
  2. check the log files of plex and the agent
  3. check the permissions and ownership of the folders if it is correctly set

to point 2. Power down the server and delete the log files and then start the server and look into the log files so that you don’t need to dig through a very long file just because you have old data in them. You can also upload them to pastebin.com or something like it so that I can take a look, make sure to remove any personal information like remote IP address, tokens etc.

Here you go:

Plex Media Server.log (669.8 KB)
com.plexapp.system.log (78.9 KB)

A few key points i found in them:

WARN - Request for plug-in [net.fribbtastic.coding.plex.myanimelist] but it doesn’t exist.

ERROR (networking:219) - Error opening URL ‘http://127.0.0.1:32400/:/plugins/net.fribbtastic.coding.plex.myanimelist’

you have a weird behavior there.

the server log says that it can’t find it and then after that it was found in cache and doesn’t need to be loaded

Column 1  : Oct 24, 2019 13:36:43.611 [0x7fdd82ffd700] DEBUG - Perfect cache hit, we don't need to start [net.fribbtastic.coding.plex.myanimelist] yet.

can you clear the server cache, check your permissions and ownership of all the files inside of the agent to make sure that plex can actually open it?!

Here are the new logs:
Plex Media Server.log (643.6 KB)
com.plexapp.system.log (69.9 KB)
And here are the folder permissions:

drwxr-xr-x  3 plex plex 4096 Sep 12  2018  MyAnimeList.bundle

:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/MyAnimeList.bundle/Contents/Code$ ls -all
total 52
drwxr-xr-x 2 plex plex  4096 Sep 12  2018 .
drwxr-xr-x 4 plex plex  4096 Sep 12  2018 ..
-rwxrw-r-- 1 plex plex  6863 Aug 20  2018 __init__.py
-rwxrw-r-- 1 plex plex 13939 Aug 20  2018 myanimelist.py
-rwxrw-r-- 1 plex plex  4679 Aug 20  2018 theMovieDB.py
-rwxrw-r-- 1 plex plex  4933 Aug 20  2018 theTVDB.py
-rwxrw-r-- 1 plex plex  1221 Aug 20  2018 utils.py