Integrating V8 and PyV8
#1
From pure self-interest I've started fixing the YouTube plugin whenever something is changed on youtube's side to break it.

It's basically an arms race of them constructing obscure javascript language structures and us figuring out ways to parse it into Python.

As an alternative, I have a local proof-of-concept using Google's own V8 javascript engine and PyV8 (python bindings for such) which mean we in theory can decode anything they throw it us with no more updates to the code required - if we can't parse it, Chrome browser can't either.

However, this would require installing the v8 libraries (c++), several Boost Python libraries (to let python call c++), and then the PyV8 python module.

Is any of this something people feel could/should/would be done? While it seems a lot for just one plugin, the youtube plugin is one of the "main attractions", and it would mean all plugins have access to javascript exection too, for other sites that perhaps use similiar obsfucation techniques or even simplifying basic web-service access.

I'm happy to do the work, but I have no idea where to start or if this is something that's appropriate. I've kinda "fallen into" doing this, so any pointers or suggestions would be appreciated.
Reply
#2
Getting v8 to compile with XBMC probably wouldn't be that difficult but the team is trying to get away from boost completely so depending on boost's python implementation is most likely a big no.

A better approach might be to be able to use JavaScript directly as a scripting language inside XBMC.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
(2014-07-20, 21:41)Montellese Wrote: A better approach might be to be able to use JavaScript directly as a scripting language inside XBMC.

Sounds good - how easy would that be to call from a python script under XBMC?

Using Google's own javascript engine seems like the best choice for forward compatability, and PyV8 seems to be the best choice for using that from python I've found.

The writer of the PyV8 module picked the boost libraries for the integration, sadly, so I have no control over that.

I doubt anyone would relish the task of re-writing the current Youtube module in JS, so we would need a hook for "run this javascript and give me the result" from python.
Reply
#4
(2014-07-20, 22:01)cruise Wrote: Sounds good - how easy would that be to call from a python script under XBMC?
No idea since nobody has looked into this so far.

(2014-07-20, 22:01)cruise Wrote: I doubt anyone would relish the task of re-writing the current Youtube module in JS, so we would need a hook for "run this javascript and give me the result" from python.
Yeah that's basically what I meant.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
Cool.

So what needs to be done to get V8 integrated? It uses slightly non-standard build and sync tools, but I'm not sure how much of an issue that is.
Reply
#6
I hope this comes to fruition, Youtube is used by alot of users and things break all the time. If it wasn't for users like cruise we wont be able to use Youtube. Thanks cruise and everyone for looking into this.
Reply

Logout Mark Read Team Forum Stats Members Help
Integrating V8 and PyV80