Solved script.toolbox Import Error
#1
Hi,

I've just done a fresh install on all my devices and the import option is throwing an error. Doesn't matter what version of the skin, official Kodi repo or Gades own.

If someone has a chance can they confirm it for me?

Fresh install 14.2 (I used PC & Android across several devices)
Install Rapier
Install script.toolbox
Restart Kodi
Change any setting in the Skin Settings
Skin Settings > Export Skin Settings
Skin Settings > Import Skin Settings -> Select the settings you exported

I tried several backups I have, all failed

I don't know which other skins use the import/export settings so cant really try without going through each skin and just trying to narrow down the problem.

Code:
12:21:59 T:5720  NOTICE: Thread LanguageInvoker start, auto delete: false
12:21:59 T:5720  NOTICE: -->Python Interpreter Initialized<--
12:22:03 T:5720   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'simplejson.scanner.JSONDecodeError'>
                                            Error Contents: Invalid control character '"' at: line 2 column 1 (char 48024)
                                            Traceback (most recent call last):
                                              File "D:\Kodi\portable_data\addons\script.toolbox\default.py", line 230, in <module>
                                                Main()
                                              File "D:\Kodi\portable_data\addons\script.toolbox\default.py", line 27, in __init__
                                                self._StartInfoActions()
                                              File "D:\Kodi\portable_data\addons\script.toolbox\default.py", line 73, in _StartInfoActions
                                                import_skinsettings()
                                              File "D:\Kodi\portable_data\addons\script.toolbox\resources\lib\Utils.py", line 98, in import_skinsettings
                                                importstring = read_from_file()
                                              File "D:\Kodi\portable_data\addons\script.toolbox\resources\lib\Utils.py", line 253, in read_from_file
                                                fc = simplejson.load(f)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\__init__.py", line 431, in load
                                                use_decimal=use_decimal, **kw)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\__init__.py", line 488, in loads
                                                return _default_decoder.decode(s)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\decoder.py", line 370, in decode
                                                obj, end = self.raw_decode(s)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\decoder.py", line 389, in raw_decode
                                                return self.scan_once(s, idx=_w(s, idx).end())
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\scanner.py", line 119, in scan_once
                                                return _scan_once(string, idx)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\scanner.py", line 92, in _scan_once
                                                return parse_array((string, idx + 1), _scan_once)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\decoder.py", line 250, in JSONArray
                                                value, end = scan_once(s, end)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\scanner.py", line 92, in _scan_once
                                                return parse_array((string, idx + 1), _scan_once)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\decoder.py", line 250, in JSONArray
                                                value, end = scan_once(s, end)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\scanner.py", line 87, in _scan_once
                                                return parse_string(string, idx + 1, encoding, strict)
                                              File "D:\Kodi\portable_data\addons\script.module.simplejson\lib\simplejson\decoder.py", line 84, in py_scanstring
                                                raise JSONDecodeError(msg, s, end)
                                            JSONDecodeError: Invalid control character '"' at: line 2 column 1 (char 48024)
                                            -->End of Python script error report<--

Cheers Smile
Reply
#2
Could you post your guisettings.xml file?
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
Hi IAmTheDude360.

Just tried both exporting and importing on Kodi 15 beta2 with latest script.toolbox Git, and I'm having no errors at all.

Rapier uses the correct code on both Helix and Isengard.

Can you try downloading the latest version from Github and installing from zip?
Reply
#4
Oh FFS.

Guys, my many apologies.

In the midst of doing my backing up it looks like I'd got my files reversed.

The HTPC backup I was trying to import was in fact my FIreStick and vice versa.

No wonder it was failing trying to import incorrect paths...

HTPC imported successfully but FireTV didn't until I remembered that this time round I'd used xbmc_env.properties to change the data location on Android.

Edited the backup.txt and it imported fine.

*Just to confirm though, if the file paths are incorrect in the backup.txt then the script will fail the import?*


On a similar note. Kodi doesnt give the option of using SMB paths for custom images in Rapier (probably a good reason mind) but I had a play in the backup.txt and changed some to SMB and it picked up the images just fine.

I'm hoping to be able to fully customize Rapier how I like it on HTPC, edit the guisettings to point the images to the centralized SMB images then export and import to my other devices.

Am I just looking for trouble? Smile

Apologies again for the schoolboy error...
Reply
#5
(2015-06-25, 15:10)IAmTheDude360 Wrote: *Just to confirm though, if the file paths are incorrect in the backup.txt then the script will fail the import?*

It seems as if the file didnt contain valid JSON anymore. I can only guess though as long as you dont post the files which caused the error. Wink
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#6
Glad you got it working Smile

(2015-06-25, 15:10)IAmTheDude360 Wrote: On a similar note. Kodi doesnt give the option of using SMB paths for custom images in Rapier (probably a good reason mind) but I had a play in the backup.txt and changed some to SMB and it picked up the images just fine.

I'm hoping to be able to fully customize Rapier how I like it on HTPC, edit the guisettings to point the images to the centralized SMB images then export and import to my other devices.

That must be a limitation in the function Skin.SetImage(). You should be able to sucessfully edit the guisettings.xml file manually to change the paths.

Do you know if that is the same for other skins or do they maybe use a different approach to set background images?
Reply
#7
(2015-06-25, 15:18)phil65 Wrote: It seems as if the file didnt contain valid JSON anymore. I can only guess though as long as you dont post the files which caused the error. Wink

Coolio. Here's the backup from the FireStick with which I was trying to import into the HTPC. This also failed on the FireStick which is what I thought was to do with the location change in Android.

http://pastebin.com/0GfW5N9c

Also is the guisettings from the clean HTPC I was trying to import to: http://pastebin.com/QSZ52Pmn

The rest are lost to the recycle bin now though Smile (hope pastebin is ok.)

Hope that helps some Smile
(2015-06-25, 15:33)Gade Wrote: Glad you got it working Smile

That must be a limitation in the function Skin.SetImage(). You should be able to sucessfully edit the guisettings.xml file manually to change the paths.

Do you know if that is the same for other skins or do they maybe use a different approach to set background images?

I don't know about other skins, always been Rapier for me Smile

What Ill do though, is get the HTPC set up completely then do the guisettings SMB edits and see how it goes for a few sessions. Once I'm happy its working fine Ill then try and export/import to the FireStick.

Once that is done and I know the backups are working Ill check out some other skins see if they do anything different.

Its not a major issue on the whole, I'm just in the mindset of getting everything centralized on a server so its easier to handle the amount of devices I have and intend on getting in the future. Also to get ready for the future headless Kodi version down the line Smile

The Android paths for the FireStick are the same as for the Ouya, FIreTV and both my N4 & N7 so if it works on the Stick it should be fine on the rest,

OT: Regarding the FireStick, I found some info that I'd missed before. It does have 1GB of RAM but only 512mb is available to the system, the rest is reserved for the GPU.

After a reset and moving everything off the stick and to the server, it has between 60mb and 120mb free now rather than dropping as low as 20mb. Makes a world of difference in performance! Smile
Reply
#8
#Update#

Just ran into the same error again.

I only made a few changes to my first custom homescreen this time to test.

Heres the guisettings and backup.txt - https://dl.dropboxusercontent.com/u/9066...rchive.zip

This guisettings only has a couple of edits where Ive changed it to the SMB path which works in the skin fine but wont import.

I also tried it by manually deleting the SMB edits and importing but it still fails.

It wont import to either the HTPC or FireStick.

Hope thats some help Smile


;edit; I also copied the guisettings with the SMB edits directly across from the HTPC to the FireStick and they all loaded perfectly!
Reply
#9
you probably tried to import a text file from a remote, right?
Try newest GIT. This should fix it: https://github.com/phil65/script.toolbox...4e108b745f
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#10
(2015-06-25, 23:50)phil65 Wrote: you probably tried to import a text file from a remote, right?
Try newest GIT. This should fix it: https://github.com/phil65/script.toolbox...4e108b745f

...Oo...Honestly never thought to mention I was doing that...

11:36:58 T:5444 DEBUG: script.toolbox: loaded textfile smb://DUDENETCLOUD/Cloud/skin.rapier.backup.txt

Worked like a charm. Exported HTPC and imported on FireStick AND quickly booted up my Nexus 7 to confirm.

They both imported perfectly.

Man, just changing one word in a script can make all the difference. Pfft way over my head, amazing what some cleaver folks can do!
Reply
#11
(2015-06-25, 17:08)IAmTheDude360 Wrote:
(2015-06-25, 15:33)Gade Wrote: Glad you got it working Smile

That must be a limitation in the function Skin.SetImage(). You should be able to sucessfully edit the guisettings.xml file manually to change the paths.

Do you know if that is the same for other skins or do they maybe use a different approach to set background images?

I don't know about other skins, always been Rapier for me Smile

What Ill do though, is get the HTPC set up completely then do the guisettings SMB edits and see how it goes for a few sessions. Once I'm happy its working fine Ill then try and export/import to the FireStick.

Once that is done and I know the backups are working Ill check out some other skins see if they do anything different.

That will be very helpful. No rush though - you should only do it if you have the time Smile

(2015-06-25, 17:08)IAmTheDude360 Wrote: Its not a major issue on the whole, I'm just in the mindset of getting everything centralized on a server so its easier to handle the amount of devices I have and intend on getting in the future. Also to get ready for the future headless Kodi version down the line Smile

I should actually do something similar to all my devices at some point. That would make things a lot easier in the future.

Glad you got things working - and thanks for helping out, Phil Smile
Reply

Logout Mark Read Team Forum Stats Members Help
script.toolbox Import Error0