zach-morris / plugin.program.iagl

The Internet Archive Game Launcher (IAGL) will launch Games from the Internet using Kodi
GNU General Public License v3.0
344 stars 49 forks source link

Error changing default download directory #51

Closed manurafal closed 5 years ago

manurafal commented 5 years ago

Kodi version: 17.6 System: Android 8.1 Device: Tvbox amlogic s905x2 Language: Spanish

When I try to change the default directory of a platform, an error appears. Attached record of the Kodi.log

00:28:21.936 T:18446744072618592624 NOTICE: IAGL: Lets Play! 00:28:24.514 T:18446744072541972848 WARNING: Skin Helper Service --> Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.skin.helper.service/resources/lib/listitem_monitor.py", line 312, in set_listitem_details details["year"], details["imdbnumber"], details["tvshowtitle"]) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.simplecache/lib/simplecache.py", line 284, in decorated result = func(*args, **kwargs) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.module.metadatautils/lib/metadatautils.py", line 280, in get_imdbtvdb_id imdbid = self.get_omdb_info("", title, "", content_type).get("imdbnumber", "") AttributeError: 'NoneType' object has no attribute 'get' 00:28:24.514 T:18446744072541972848 ERROR: Skin Helper Service --> Exception in resources.lib.listitem_monitor ! --> 'NoneType' object has no attribute 'get' 00:28:25.024 T:18446744072541972848 NOTICE: IAGL: Lets Play! 00:28:40.309 T:18446744072541972848 NOTICE: Previous line repeats 1 times. 00:28:40.309 T:18446744072541972848 WARNING: Attempt to use invalid handle -1 00:28:43.295 T:18446744072541972848 ERROR: EXCEPTION: Error: GetSources given is NULL. 00:28:43.309 T:18446744072541972848 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

zach-morris commented 5 years ago

Thanks for the debug log. Interesting that this fails for you but not on other OS's. I've added a change that will try a slightly different method if the first fails.

I'm guessing if you add a files source in Kodi, the error will also go away. The error seems to be that Kodi doesn't have anywhere to browse.

manurafal commented 5 years ago

I have done what you told me, but the error continues.

manurafal commented 5 years ago

What can I do to solve it?

zach-morris commented 5 years ago

You can get the latest commit, overwrite the addon files on your box, and test it if you like. Otherwise, I will push an update to my repository in the near(ish) future.

manurafal commented 5 years ago

I install de latest commit and now I can not download games and have the next errors:

manurafal commented 5 years ago

I have also installed the IARL and it works well, I can download games and change the default directory of a platform, but with the IAGL I have problems.

By the way, my tvbox is rooted.

Thanks for your quick answers and for your work.

zach-morris commented 5 years ago

Do you have some weird non-ascii character in your folder name?

manurafal commented 5 years ago

This is the folder route:

/Juegos/Game Boy Advance/

zach-morris commented 5 years ago

The error shows:

Error Type: <type 'exceptions.UnicodeDecodeError'>
Error Contents: 'ascii' codec can't decode byte 0xc2 in position 6: ordinal not in range(128)

Which appears to mean there's a character "¥" in your path, which python does not like. If possible, post a debug log (i.e. turn debug logging ON in Kodi, see #2 here) and or post your game list xml header and post it to hastebin rather than paste it in a comment.

manurafal commented 5 years ago

You're right, there are some files with ANSI encoding and not UNICODE. I indicate some of which have ANSI condificación, please change them to UNICODE coding.

GBA_ZachMorris.xml ZX_Spectrum_ZachMorris.xml Sega_CD_ZachMorris Sega_SG1000_ZachMorris SNES_ZachMorris TG16_Bestof_ZachMorris TG16_ZachMorris VirtualBoy_ZachMorris Win31_ZachMorris Wonderswan_Color_ZachMorris Wonderswan_ZachMorris PowderToy_ZachMorris PS1_ZachMorris Quake_Lefty420 REminiscence_ZachMorris SCUMMVM_ZachMorris ...............

zach-morris commented 5 years ago

None of the dat files have an encoding line in them, python assumes utf-8 according to the documentation. I don't think that would resolve the issue since it's python is complaining about the character. I also can't recreate this issue, so it seems like some difference with your OS or version of Kodi...

Does your path have a non-ascii character in it? If so, does a path with only ascii characters in it work?

manurafal commented 5 years ago

I changed the encoding of the files to UTF8 and now everything works fine. My path only has ascii characters.

zach-morris commented 5 years ago

Are you referring to adding the following to the file?

<?xml version="1.0" encoding="UTF-8"?>

If not, what exactly did you add to the xml file?

I'm not sure I understand why that would make it work, but if it does, then I wont argue with making the change ¯_(ツ)_/¯

manurafal commented 5 years ago

I have not modified the content, just changed the encoding of the file to UTF8. I use the Notepad ++ program (https://notepad-plus-plus.org/), I only open the file and I record it again as UTF8, but I do not modify the content. I suppose that if there is some character non-ascii when recording in file in UTF8 the program changes or eliminates it, but I do not modify the content.

zach-morris commented 5 years ago

OK. Well it must be something the android box is doing to the files then. Since they show by default as UTF-8 on my computer. I've added the xml encoding line to every dat file, so that will hopefully resolve the issue