henrikdk / xbmc-common-plugin-functions Goto Github PK
View Code? Open in Web Editor NEWCommon Functions and ParseDOM module for XBMC plugins (Now on GitHub)
Common Functions and ParseDOM module for XBMC plugins (Now on GitHub)
Future builds of Kodi will use Python 3.
While testing my own addon (that has a dependency to script.module.parsedom) I found that script.module.parsedom is not Python 3 compatible.
Is Python 3 something you are planning to support?
request url: ....?param1=123=321
result getParameters: param1='123'
need: param1='123=321'
fix: line 117 replace to
splitCommand = command.split('=', 1)
I noticed that some videos in Youtube Plugins have wired plots (unparsed XML content) and started investigation.
For the plot the following statement is used:
parseDOM(node, "media:description")
If node contains something like:
<media:description type='plain'>Foo Description here</media:description>
everything works as expected because ['Foo Description here']
is returned.
But sometimes there is no description. In that case node contains:
<media:description type='plain'/>
parseDom fails here, it should return an empty list, instead it returns everything in node after the desired tag. This results in a video description containing unparsed xml content.
For example see newest youtube videos, they often have no description (I used this for investigation: rkB4wMaJVqw
).
In my raspbmc the youtube plugin failed with this error (I think that is related with your plugin):
22:26:38 T:2903708736 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: invalid literal for float(): 13.2ALPHA1
Traceback (most recent call last):
File "/home/pi/.xbmc/addons/plugin.video.youtube/default.py", line 117, in <module>
params = common.getParameters(sys.argv[2])
File "/home/pi/.xbmc/addons/script.module.parsedom/lib/CommonFunctions.py", line 111, in getParameters
if getXBMCVersion() >= 12.0:
File "/home/pi/.xbmc/addons/script.module.parsedom/lib/CommonFunctions.py", line 103, in getXBMCVersion
version = float(version)
ValueError: invalid literal for float(): 13.2ALPHA1
-->End of Python script error report<--
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.