Since I just released the newest version of the MALAgent I thought it would be time to get a new thread and use this thread ONLY for support.
you can visit the official release thread here.
Since I just released the newest version of the MALAgent I thought it would be time to get a new thread and use this thread ONLY for support.
you can visit the official release thread here.
2013-03-24 08:48:43,125 (260c) : CRITICAL (core:561) - Exception in the search function of agent named 'MyAnimeList.net', called with keyword arguments {'openSubtitlesHash': '95b5e6e86ca08c79', 'episode': '12', 'episodic': '1', 'show': 'Haganai', 'season': '1', 'filename': 'D:%5CAnime%5CHaganai%5CHaganai%20-%2012%20(1920x1080%20BD%20AC3)%2Emkv', 'plexHash': 'd1f7f17bbae0458cd0789cc13f3e01d3660fa848', 'duration': '-1', 'id': '3702'} (most recent call last): File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 923, in _search agent.search(results, media, lang) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\MAL.bundle\Contents\Code\__init__.py", line 85, in search doSearch(results, media, lang) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\MAL.bundle\Contents\Code\__init__.py", line 24, in doSearch xml = XML.ElementFromURL(mal_url, headers=headers) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\parsekit.py", line 345, in ElementFromURL ).content, encoding=encoding, max_size=max_size) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\parsekit.py", line 301, in ElementFromString return self._core.data.xml.from_string(string, encoding = encoding) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\data.py", line 169, in from_string return etree.fromstring(markup) File "lxml.etree.pyx", line 2743, in lxml.etree.fromstring (src\lxml\lxml.etree.c:52665) File "parser.pxi", line 1573, in lxml.etree._parseMemoryDocument (src\lxml\lxml.etree.c:79932) File "parser.pxi", line 1452, in lxml.etree._parseDoc (src\lxml\lxml.etree.c:78774) File "parser.pxi", line 960, in lxml.etree._BaseParser._parseDoc (src\lxml\lxml.etree.c:75389) File "parser.pxi", line 564, in lxml.etree._ParserContext._handleParseResultDoc (src\lxml\lxml.etree.c:71739) File "parser.pxi", line 645, in lxml.etree._handleParseResult (src\lxml\lxml.etree.c:72614) File "parser.pxi", line 585, in lxml.etree._raiseParseError (src\lxml\lxml.etree.c:71955) XMLSyntaxError: Entity 'mdash' not defined, line 62, column 41
2013-03-24 08:48:41,444 (1958) : CRITICAL (core:561) - Exception in the search function of agent named 'MyAnimeList.net', called with keyword arguments {'openSubtitlesHash': '22672ddd7e0dbede', 'episode': '26', 'episodic': '1', 'show': 'Hack Sign', 'season': '1', 'filename': 'D:%5CAnime%5Chack__SIGN%5Chack__SIGN%20-1x26%20-%20Return%2Emkv', 'plexHash': 'd8611eb06b920f3776e10a42b319eb1709398b6e', 'duration': '-1', 'id': '3674'} (most recent call last): File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 923, in _search agent.search(results, media, lang) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\MAL.bundle\Contents\Code\__init__.py", line 85, in search doSearch(results, media, lang) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\MAL.bundle\Contents\Code\__init__.py", line 24, in doSearch xml = XML.ElementFromURL(mal_url, headers=headers) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\parsekit.py", line 345, in ElementFromURL ).content, encoding=encoding, max_size=max_size) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\parsekit.py", line 301, in ElementFromString return self._core.data.xml.from_string(string, encoding = encoding) File "C:\Users\Gunnar\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\components\data.py", line 169, in from_string return etree.fromstring(markup) File "lxml.etree.pyx", line 2743, in lxml.etree.fromstring (src\lxml\lxml.etree.c:52665) File "parser.pxi", line 1573, in lxml.etree._parseMemoryDocument (src\lxml\lxml.etree.c:79932) File "parser.pxi", line 1452, in lxml.etree._parseDoc (src\lxml\lxml.etree.c:78774) File "parser.pxi", line 960, in lxml.etree._BaseParser._parseDoc (src\lxml\lxml.etree.c:75389) File "parser.pxi", line 564, in lxml.etree._ParserContext._handleParseResultDoc (src\lxml\lxml.etree.c:71739) File "parser.pxi", line 645, in lxml.etree._handleParseResult (src\lxml\lxml.etree.c:72614) File "parser.pxi", line 596, in lxml.etree._raiseParseError (src\lxml\lxml.etree.c:72123) XMLSyntaxError: None
I am having these exceptions when using it with my anime library.
did you enter your MyAnimeList Account in the Agent Settings?
Yes. Also, I do not get any data beyond name/date for the series .hack//SIGN and .hack//Roots - might be connected to the name starting with dot, as others series seem fine.
And for some reason I do not get any results when I search for Haganai or Boku wa Tomodachi ga Sukunai, even though both names yield results when I do a direct search on the site.
Yes. Also, I do not get any data beyond name/date for the series .hack//SIGN and .hack//Roots - might be connected to the name starting with dot, as others series seem fine.
And for some reason I do not get any results when I search for Haganai or Boku wa Tomodachi ga Sukunai, even though both names yield results when I do a direct search on the site.
yeah there are some bugs in it at the moment. I will look into it. I don't know why there is no exact match right now. The biggest Problem I've got right now is that I can't search for an ID in the MAL API only for the title. Also there is a problem when the there are characters in the title but can't be used on the filesystem (':' for example). But this should be fixed when I get the matching done.
I've uploaded a new version.
The Agent now will match the names and organize the search results so there shouldn't be a Incorrect match.
The Problem I've got right now is to get results which got special characters like Black★Rock Shooter (OVA). But I think the scanner is parsing something "wrong" so I don't know how to fix it yet.
Hello Daraku,
I checked this agent out today and I think the biggest problem is that the MAL API is not very flexible. Search queries have to be very precise and that is why names like Black★Rock Shooter (OVA) fail. I hope you don't mind, but I made some changes and moved some code around a bit. The changes are on Github: https://github.com/sander1/MAL.bundle The changes are not always clear, because the newline character changed somehow :unsure: I've tried to describe some of the changes in the commit messages, but if you like I can explain some more. This code hasn't been tested extensively, but Black★Rock Shooter (OVA) is found ;)
Hello Daraku,
I checked this agent out today and I think the biggest problem is that the MAL API is not very flexible. Search queries have to be very precise and that is why names like Black★Rock Shooter (OVA) fail. I hope you don't mind, but I made some changes and moved some code around a bit. The changes are on Github: https://github.com/sander1/MAL.bundle The changes are not always clear, because the newline character changed somehow :unsure: I've tried to describe some of the changes in the commit messages, but if you like I can explain some more. This code hasn't been tested extensively, but Black★Rock Shooter (OVA) is found ;)
Thank you I did a few changes to the agent myself over the last few days and modified mostly the update method to use the unofficial MAL API and it is more comfortable to use it then the official API.
Well my problem with Black★Rock Shooter (OVA) was that the ★ was encoded in latin-1 (thats what I think the scanner does) and after I tried a bunch of solutions I couldn't find a way to parse it in a "readable" way.
Plex:
2013-03-26 22:41:14,118 (1504) : INFO (agentkit:914) - Searching for matches for {'show': 'Black\xe2\x98\x85rock Shooter Ova', 'id': '191', 'year': None}
but if I Log media.show I get
Black★Rock Shooter (OVA)
Quite confusing
But with the my updated version it works quite good because I don't need to tell the update method the name of the show because the unofficial API does support ID search functionality.
In the Code you wrote are a few things I will use in my newer version because I didn't know how to do them yet or just didn't implement because I wanted to get it working :)
The next step I will do is to use the unofficial API to do my searches but the only response I get is in JSON and not in XML but there should be a way to parse that.
Edit:
Okay I tested the newer version with my library and I got 36/76 hits. Not quite pleasing but now I try to get the unofficial API into the search algorithm and I think I will get a bunch more hits if it is working.
Edit #2: Oh and I still get a hit on Black★Rock Shooter (OVA) even though he searched for Black★Rock Shooter (OVA) xD. But I won't get a result from the Unofficial API which brings me back to the encoding problem :angry:
That's it. It is working, kind of. I implemented the unofficial API in the search method and I get results for Anime I didn't get the last time. BUT now and I don't even know why the search Results aren't displayed even though I append them to the results variable and Log it. There are a bunch of search results but they doesn't get displayed.
def doSearch(results, media, lang): anime_title = media.showLog("[MyAnimeList Agent]: Search for Anime: " + anime_title)
#build url
mal_url = BASE_SEARCH_URL + String.Quote(anime_title, usePlus=True)#get the JSON from url
Log("[MyAnimeList Agent]: Requesting Data from API")
json = JSON.ObjectFromURL(mal_url)Log("[MyAnimeList Agent]: Found Data")
for entry in json:
anime_id = int(entry[‘id’])
anime_name = entry[‘title’]
anime_match_score = int((difflib.SequenceMatcher(None, anime_name, anime_title).ratio())*100)
if entry[‘start_date’] is not None:
anime_year = entry[‘start_date’].split(’-’)[0]
else:
anime_year = NoneLog("--------------------------") Log("Anime-ID: " + str(anime_id)) Log("Anime-Name: " + anime_name) Log("Anime-Match: " + str(anime_match_score)) Log("Anime-Year: " + str(anime_year)) results.Append(MetadataSearchResult( id = anime_id, name = anime_name, year = anime_year, score = anime_match_score, lang = Locale.Language.English))
for x in results:
Log(x)
return
therefore I don't get any metadata to the shows.
The 'id' can't be an integer, it has to be a string. Change anime_id = int(entry['id']) to anime_id = entry['id'] (or anime_id = str(entry['id']) if it's an integer in the json data) and it'll probably start working again.
still no exception or any error at all while searching on the plex/web I always get "no matches found" even though the results variable is filled with some MetadataSearchResults
for example
2013-03-29 17:35:08,403 (11ec) : DEBUG (networking:172) - Requesting 'http://mal-api.com/anime/search?q=Accel+World'
2013-03-29 17:35:08,657 (11ec) : INFO (logkit:16) - [MyAnimeList Agent]: Found Data
2013-03-29 17:35:08,663 (11ec) : INFO (logkit:16) - --------------------------
2013-03-29 17:35:08,663 (11ec) : INFO (logkit:16) - Anime-ID: 11759
2013-03-29 17:35:08,663 (11ec) : INFO (logkit:16) - Anime-Name: Accel World
2013-03-29 17:35:08,663 (11ec) : INFO (logkit:16) - Anime-Match: 100
2013-03-29 17:35:08,667 (11ec) : INFO (logkit:16) - Anime-Year: 2012
2013-03-29 17:35:08,667 (11ec) : INFO (logkit:16) - --------------------------
2013-03-29 17:35:08,667 (11ec) : INFO (logkit:16) - Anime-ID: 13939
2013-03-29 17:35:08,673 (11ec) : INFO (logkit:16) - Anime-Name: Accel World EX
2013-03-29 17:35:08,673 (11ec) : INFO (logkit:16) - Anime-Match: 88
2013-03-29 17:35:08,673 (11ec) : INFO (logkit:16) - Anime-Year: 2012
2013-03-29 17:35:08,677 (11ec) : INFO (logkit:16) - --------------------------
2013-03-29 17:35:08,677 (11ec) : INFO (logkit:16) - Anime-ID: 13859
2013-03-29 17:35:08,677 (11ec) : INFO (logkit:16) - Anime-Name: Accel World Specials
2013-03-29 17:35:08,683 (11ec) : INFO (logkit:16) - Anime-Match: 70
2013-03-29 17:35:08,683 (11ec) : INFO (logkit:16) - Anime-Year: 2012
2013-03-29 17:35:08,683 (11ec) : INFO (logkit:16) - MetadataSearchResult(lang='en', thumb=None, score=100, year=u'2012', id=11759, name=u'Accel World')
2013-03-29 17:35:08,687 (11ec) : INFO (logkit:16) - MetadataSearchResult(lang='en', thumb=None, score=88, year=u'2012', id=13939, name=u'Accel World EX')
2013-03-29 17:35:08,687 (11ec) : INFO (logkit:16) - MetadataSearchResult(lang='en', thumb=None, score=70, year=u'2012', id=13859, name=u'Accel World Specials')
2013-03-29 17:35:08,697 (11ec) : DEBUG (runtime:896) - Response: [200] str, 1276 bytes
okay fixed it
anime_id = str(entry['id'])
did the trick
Thought I'd explore this since I'm currently having issues with anidb. Works fairly well with some limited testing. Nice and simple.
Suggestion: in the class declaration, add 'accepts_from = [ 'com.plexapp.agents.localmedia' ]' so that any local images in the series folder (eg backgrounds) will be picked up.
Thought I'd explore this since I'm currently having issues with anidb. Works fairly well with some limited testing. Nice and simple.
Suggestion: in the class declaration, add 'accepts_from = [ 'com.plexapp.agents.localmedia' ]' so that any local images in the series folder (eg backgrounds) will be picked up.
sounds good, will do :)
Edit:
new version is up
nice agent, just what i was looking for,i only run in one problem. it doesn't seen to find the anime K http://myanimelist.net/anime/14467/K, even searching for doesn't work
Edit: i got to work with the alternate name
i have also matching problems with not exact same title as that myanimelist has, especially with names that has a : in it.
Hi, is it possible get this metadata agent under movies section?
Can't seem to detect my anime movies which are distributed 1 file in each folder.
nice agent, just what i was looking for,i only run in one problem. it doesn't seen to find the anime K http://myanimelist.net/anime/14467/K, even searching for doesn't work
Edit: i got to work with the alternate name
i have also matching problems with not exact same title as that myanimelist has, especially with names that has a : in it.
Problem with K was that it is only one character and with the special characters in the name, well thats more a problem of the scanner because he just removes them. Still you can always use the fix wrong matching. :)
Hi, is it possible get this metadata agent under movies section?
Can't seem to detect my anime movies which are distributed 1 file in each folder.
Try to put " - 01" after the name and it will find them with your anime shows.
another problem i found is that when the mal name contains special charecters (. : ), and the file names dont have those (windows doenst like that those characters) it doenst find those anime on mal.
maybe you can also ad suport for http://fanart.tv for for banners and backgrounds
another problem i found is that when the mal name contains special charecters (. : ), and the file names dont have those (windows doenst like that those characters) it doenst find those anime on mal.
maybe you can also ad suport for http://fanart.tv for for banners and backgrounds
Yeah I encountered this while testing it but I don't have a solution for it because I actually don't have control over it, like you said windows for example doesn't like them.
To your Suggestion. Like I said before I actually didn't want to integrate a another service into MAL because then it's just not the MAL Agent anymore (since MAL doesn't support other images than the Poster). But I will add it to my Todo list and think about it.
can you also add the data for the episode dureration? of isnt this possible because of the api?
edit: nevermind i see that its is not possible