Kodi Community Forum

Full Version: Tools for kodi video scrap addon in python 3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,...

I desire to update my video python 2 addon to python 3...

my python 2 video addon used  CommonFunctions from script.common.plugin.cache
but
it seems  not working with python 3 version...at this moment

so i have tried with  BeautifulSoup but no working  too.....

so my question is this one,....

what are the tools that i can use  to make a functionnal video scrap addon with kodi python 3 version,.....?

EDIT:: SOrry.. i havent seen that post --->>> :: 325637 (thread)
a python 3 compatible version of Beautifulsoup is available in our repo for v19:
http://mirrors.kodi.tv/addons/migration/...ifulsoup4/
(2019-04-03, 17:54)ronie Wrote: [ -> ]a python 3 compatible version of Beautifulsoup is available in our repo for v19:
http://mirrors.kodi.tv/addons/migration/...ifulsoup4/

Hey ronie,...

Thx  for your intervention,...

but i still have issues with ""import from zip"" the file :  script.module.beautifulsoup4-4.6.0.0.zip

after manual install of the beautifulsoup addon,
i have got  this error :

Code:
ImportError: No module named html.entities

after manual add of html  lib from python 3 install folder,..

i have this issue


Code:
Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: chr() arg not in range(256)

""and it s apparenetly related to the fact that  Python 2 chr give  a one character string in the ASCII range. This is an 8-bit string, so the maximum parameter value for
chr is 255.... In Python 3 you'll get a unicode character and unicode code points can go up to much higher values.""

...

have you an idea..?
hard to tell without seeing the code and a full Debug Log.

looking at the error alone, i'd say your not using a py3 version of kodi... but that's just a guess.
(2019-04-03, 22:45)ronie Wrote: [ -> ]....
i'd say your not using a py3 version of kodi... but that's just a guess.

do you consider leia 18.1 version as a python3 kodi version..?
nope, you need to install the 'feature_python3' test build of kodi.
they can be found here: http://mirrors.kodi.tv/test-builds/
(2019-04-03, 23:35)ronie Wrote: [ -> ]nope, you need to install the 'feature_python3' test build of kodi.
the can be found here: http://mirrors.kodi.tv/test-builds/

ohh thx for the info .....and sorry for misunderstanding..

i go catch this version 'feature_python3' test build of kodi...now.. Wink)

thx for the enlightenment,...Wink)
@ronie 
I am trying to convert a couple of addons to py3 so that I may submit to the official repo.
I tried installing the script.common.plugin.cache-2.5.10.zip from
Code:
http://mirrors.kodi.tv/addons/migration/script.common.plugin.cache/
It immediately gives an error on install
from the log file
Code:
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: 'str' object has no attribute 'decode'
Traceback (most recent call last):
File "/home/gujal/.kodi/addons/script.common.plugin.cache/default.py", line 40, in <module>
 run()
File "/home/gujal/.kodi/addons/script.common.plugin.cache/default.py", line 30, in run
 sys.path = [settings.getAddonInfo('path').decode('utf-8') + "/lib"] + sys.path
AttributeError: 'str' object has no attribute 'decode'
-->End of Python script error report<--
From the error, it looks like the module is still using python2 calls and is not updated for python3
Here is the full debug log
ilopinunuj.kodi (paste)

Please advise
correct, script.common.plugin.cache has not been updated to python3.
@ronie

i come back to you because i still have issue with the script.module.beautifulsoup4-4.6.0.0.zip and the KodiSetup-20190305-66746cbe-feature_python3-x64.exe

i cant install from zip

the original addon.xml of beautifulsoup4-4.6.0.0 has xbmc.python"  version="2.25.0"

i have modified this to xbmc.python"  version="2.26.0"

but with no succes

and when i add manually script.module.beautifulsoup4-4.6.0.0
i have an import error  on from bs4 import BeautifulSoup


SOLUTION :
i have put some lib from python 3 install folder in my addon folder to do the trick


,....