[Release] MyAnimeList.net Metadata Agent

@Rudisca said:
I’ve same problem with @Spectro87 , but I use Windows. The problem is

When I try to change the agent to Myanimelist it keeps saying “changes could not be saved”.

Hello, first post here, I had the exact same problem.
Was randomly trying out things until I noticed that my init.py file wasn’t named like that, but instead it was init.py . After renaming it to “init.py”, the plugin started working with not a single problem.

@felys_ said:

@Rudisca said:
I’ve same problem with @Spectro87 , but I use Windows. The problem is

When I try to change the agent to Myanimelist it keeps saying “changes could not be saved”.

Hello, first post here, I had the exact same problem.
Was randomly trying out things until I noticed that my init.py file wasn’t named like that, but instead it was init.py . After renaming it to “init.py”, the plugin started working with not a single problem.

my last info is that it needs to be
__init__.py
I haven’t seen or noticed any changes to that. (even HAMA has it this way)

Is there a way to match to the English name instead of the Japanese one?

@Spectro87 said:
Is there a way to match to the English name instead of the Japanese one?

If you mean to use English names on your video files, sure you can do that as long as myanimelist can find this name. That means it should be listed as one of the Alternative Titles.

If you mean to use it as Title in your Plex library I have to disappoint you, this won’t work. The reason for this is that the API, which searches, parses and provides the Data from myanimelist in a much more compressed form uses the title (directly above the cover) as the main title because this one is always there, 100%. There are alternative titles on the website and are parsed by the API but not utilized by the Agent because so far there wasn’t any reason for it to do and there is no guarantee that they will be there.

So if you want to have a good and working library without much work of yourself you should take the Names from Myanimelist. Sometimes there are however titles which are impossible to match like “K” (can’t be searched because myanimelist only accepts searches longer than 3 characters) so you need to take a name from the Alternative Titles for matching (in this case “K-Project” which is then matched as K in your Library).

Not sure what happened. I noticed that new series were not being recognized by the MAL bundle. I went to do a manual match and saw the MAL bundle was missing! I verified that that the permissions were set correctly and the Plex account was the owner. After that failed I downloaded the latest version - 5.0.2. But still nothing.

Is anyone else seeing this problem?

I ran what has always worked when installing the bundle (I am using Ubuntu btw):
chown plex:plex -R /home/user/Plex/Plug-ins/MyAnimeList.bundle
chmod 755 -R /home/user/Plex/Plug-ins/MyAnimeList.bundle

Well scratch that. After stopping the Plex service for a minute and starting it back up, the MAL bundle showed up. No idea the cause of the issue :confused:

@EZarnosky said:
Well scratch that. After stopping the Plex service for a minute and starting it back up, the MAL bundle showed up. No idea the cause of the issue :confused:

maybe just a hiccup of the server. for a second you had me worried.

Not sure what happened. I was starting to get a bit angry. First they trash the Fire TV interface and then mess up a agent bundle I rely on…

I think the version of the agent was fairly old, because I did two reboots, stopped and started the service. But nothing worked until I downloaded your latest version and restarted the service a few time.

Hey, I’m having an issue making a match with the MAL agent and it is confusing me.

The agent won’t match: One Piece: Episode of East Blue - Luffy to 4-nin no Nakama no Daibouken

I have tried different combinations but it never shows up. When I search on MAL itself it is there. How is you list being presented? With a name that long and exactly from MAL I would think the agent cold make a 100% match.

@EZarnosky said:
Hey, I’m having an issue making a match with the MAL agent and it is confusing me.

The agent won’t match: One Piece: Episode of East Blue - Luffy to 4-nin no Nakama no Daibouken

I have tried different combinations but it never shows up. When I search on MAL itself it is there. How is you list being presented? With a name that long and exactly from MAL I would think the agent cold make a 100% match.

Did you try a manual match? Does the manual match search produces any results? I will take a look at this when I get home

So I checked my API search and the API DB is fine (no corruption). However the Search of MAL isn’t, even when I just search for “Episode of East Blue” it isn’t in the first batch of search results not even in 200 search results.

It’s also funny that the first search has other titles than the “search for X in anime” … what the hell happened at MAL?

Maybe they Index their Animes now for a quicker search and this one isn’t indexed yet.

So I don’t know what to tell you, whatever I search for MAL can’t find it. And if MAL can’t find it themselves …

I’ve had this behavior in the past also. To the point I had to use alternate titles to find a series. It is bizarre that on the MAL website it finds it immediately, but via API it can’t. Sounds like they have undocumented API calls or aren’t eating their own dog food. :expressionless:

@EZarnosky said:
I’ve had this behavior in the past also. To the point I had to use alternate titles to find a series. It is bizarre that on the MAL website it finds it immediately, but via API it can’t. Sounds like they have undocumented API calls or aren’t eating their own dog food. :expressionless:

I don’t know, if you can find it through the MAL website search you should be able to find it through the agent too since my API uses the same search URL you would use on the website. Unless the Scanner is changing characters and therefore changes the name slightly in your library. But even then the MAL website should remotely be able to recognize and find what you are searching for.

Hey there,
I’ve been using the plugin successfully for a few days, but still have not figured out how it decides which file belongs to which anime.
I have no unified folder structure nor filenames, but instead I am using MAL tags at the end of the filenames (something like NAME_01v2_[BD_1080p][MID#5114#1#].mkv). It seems like a good bunch of animes is being recognized just fine, but some of them are just wrong. Usually it shows Season2 or Specials or something, instead of Season1. How do I need to set up my folder structure and/or filenames to make this plugin work? Would there be a way to make it work with MAL tags?
Another thing I keep asking myself: I am using a TV series library for everything (series and movies combined). I am only able to set an agent for the lib and have no option to also choose a scanner. This confuses me a bit since in the install documentation it says you have to use a seperate scanner for this to work well. Am I doing things wrong?
Thanks in advance for any help!

First of all thank you for using the Agent.

The Agent only looks up and provides Data for the names that are already in the library. That means recognizing them and putting them into the correct library entry is the job of the Scanner.

Please refer to this link below for your media preparation. I use BABS as Scanner and use the Myanimelist titles (top of the site) as titles for the anime. Occasionally you need to use alternative titles like K-Project for K.

https://support.plex.tv/hc/en-us/categories/200028098-Media-Preparation

For a while I had the Idea of giving the user the option to add the ID so that they can specify which anime data should be retrieved however I have not found a way to store it in the libary entry itself in a good way and this needs to be done by the Scanner too (which I didn’t develop) if you want to have it in the filename.

You need to have both, a scanner and an agent, in your library so that your files get put into the library by the scanner and the agent provides metadata. Why you can’t set a scanner I don’t know and I would refer you to the more general Issue part of the forum to get that solved.

My Suggestion: Use myanimelist as reference to your animes. If it is a movie put it into a Anime movies library, if it is anything else put it into the anime tv shows library. Use BABS to scan your anime.

If you do that you should have a good library of most recognized animes.

Hi, i am having a issue with a show that the agent fails to get the title from MAL, at first i thought that it was just plex beying plex, and doing the usual “plex dance” would fix it, but looking at the log it seems that the agent fails to get the title and returns WARNING (logkit:19) - [MyAnimeList.net] Episodes are not available - cannot concatenate 'str' and 'NoneType' objects even though MAL has the episodes added. The show in question is this

Thanks for reporting this but everything is behaving correctly.

Short Answer:
You get the warning because the episode listed are not available in the response from my backend because it got locked out of making requests to the official myanimelist website.

Longer Answer:
You see the whole process works like this and is not as trivial as it might seem:

If plex has found a series it will perform a search to get a list of accordances. This runs over my backend but the search is always direct so that I get the newest data. The highest accordances in terms of title matching but still over 80% will be used as the version for pulling metadata.

After plex has found a version to use for pulling metadata the agent will request my backend again but this time with the ID. The backend will cache each entry that was requested from myanimelist itself for 7 days, every request that is made will be checked if the “last updated” date is older than 7 days, if this is the case a new set of metadata is being parsed from myanimelist directly.

And here exactly are the problems: I produce a massive amount of requests to the myanimelist website because the official API is really not that great (and promises that it will get updated but never was over years) and to get all the data I need for Plex I only get through the website. For the Anime you have problems with I already need to do 3 (+1 for the search) requests just to get all the metadata I need. A lengthy anime like One piece or Naruto Shippuuden which episodes are in the hundreds I need even more requests because every 100 episodes need yet another request so One piece with 800 episodes would come in about 11 if not more requests.

That is all well and good if myanimelist wouldn’t block after a certain amount of requests and just doesn’t accept anything from that IP for a while. (I’m also in violation of myanimelists regulations of how many requests I can make, which would be 1 every 15 seconds but now imagine that with a lengthy anime like one piece and 800 episodes it would take 3 minutes just to get the whole package of metadata)

That is why it needs to be cached.

However that brings me to the next topic. Since the episodes are that lengthy I do them at last so that I get as much information as possible with the requests I got through. That means I still got details and pictures and maybe the first one or two pages before the website locks me out. However that doesn’t mean you are using the backend alone but everyone who uses the Agent will also use the backend. So if you update or refresh your metadata you might … no, you definitely will, use up all available requests to the website.

Now back to your “problem”. This is probably just a simple issue that the backend just couldn’t get the episodes before the website locked the backend out.

I deleted the entry in the database for the cache (but the cache of the server needs to be refreshed too) so the next request that comes through will refresh the data and, fingers crossed, will pull the episodes too.

I’m sorry that I don’t have a solution or a fix for this. It is how it is right now and the backend I wrote was always only a workaround to the official api. I created the Agent 4 years ago and so far I haven’t seen any changes to the official API at all.

Any solution that could be made requires a full redesign of the backend with better data storage, checking and not overwriting existing data with no data at all (which can happen at the moment) and maybe even reworking the whole parsing part. But I don’t have the time to put it into this.

Another thing is that I can’t test anything at the moment because my storage device decided to break and with no backup most of the data was lost. I am in the process of recovering this but without the data I can’t really test things out.

So yeah, the whole thing is not really fleshed out but it works. however I’m hugely limited on what I’m able to do.

Daraku, what are the odds you might create a plugin that uses the MAL api to let us update our MAL with watched/ downloaded data and sync our MAL with our Libraries in general?

I have been looking for a way to do this for a while, and haven’t found anything. Closest thing I found was https://github.com/z411/trackma but haven’t been able to figure out how to get it to work on a freenas plex plugin install.

I would totally buy you some beer if you could build a plugin for this.

@sweetaction said:
Daraku, what are the odds you might create a plugin that uses the MAL api to let us update our MAL with watched/ downloaded data and sync our MAL with our Libraries in general?

I have been looking for a way to do this for a while, and haven’t found anything. Closest thing I found was GitHub - z411/trackma: Open multi-site list manager for Unix-like systems. (ex-wMAL) but haven’t been able to figure out how to get it to work on a freenas plex plugin install.

I would totally buy you some beer if you could build a plugin for this.

I actually thought about this for a while now, however there are some difficulties.

my knowledge in python is limited as is my time to create a complex plugin like this. Also there is no real documentation, or at least none that I could find, that describes how to get data from plex as what you have watched, are watching etc. There are some github sources that do such things but I couldn’t make heads or tails out of it yet because they are not just a sync plugin.

What I did stumbled upon is the plexpy project which could be a solution to this, but even then you have to create a program that is executed whenever plexpy does something and I would need to change the agent so that the program recognizes that you are currently watching an anime because otherwise you could write garbage in your MAL library which nobody wants.

Another thing is that my media server is dead, I slowly build it up again but this will take some time until I can even make any bugfixes on the Agent itself.

So in shourt: It is on my Radar but I don’t know when and If I can get to it.

Hello there, i have one little qustion. When i using malagent, plex on my appletv wont use external subs, only included. But if i make library with standart agent - it works. How may i fix it?