Addons4Xbox development

Discussion of XBMC4XBOX development.
User avatar
Dom DXecutioner
Posts: 585
Joined: Thu Jul 05, 2012 11:59 pm
Location: California
Has thanked: 249 times
Been thanked: 216 times
Contact:

Re: Addons4Xbox development

Post by Dom DXecutioner » Fri Nov 16, 2012 4:42 am

That's right, BuZz dislikes log spamming. LOL
Image

skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Addons4Xbox development

Post by skatulskijean » Fri Nov 16, 2012 7:33 am

BuZz wrote:If i set up a new addons4Xbox repository it would be nice if people like Jan would add their fixed up stuff, also, and hopefully we can get enough people helping that its kept up to date.
!
Yes, that is a motivation for me and i start a adapting marathon when we it have!
But what is with user wishes or a best of wanted List?
I think mainly we must have the great addons Youtube, Vimeo, BlipTV!
The scriptmodule on my Build since up to date and working!
And with this you have all dependencies for any Addon!

Regards Jan

;)

whufclee
Posts: 922
Joined: Tue Jul 17, 2012 5:42 pm
Location: Essex, UK
Has thanked: 18 times
Been thanked: 109 times
Contact:

Re: Addons4Xbox development

Post by whufclee » Fri Nov 16, 2012 10:35 am

Jan, I would suggest starting a new thread for this. You could start a poll to see what people want working on xbox most. The only ones you have to worry about are the ones that need actual code changes as Addons4Xbox Installer automatically renames the files to the correct format. [removed] and Navi-X are the only ones I use but I imagine Youtube is going to be very popular. For the ones that you adapt would it be possible to have something like "if os = xbox" then do something else? If the authors could have something like this in their code I'm sure they wouldn't mind adding it to the official repo's so the addons are truly universal.

skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Addons4Xbox development

Post by skatulskijean » Fri Nov 16, 2012 11:08 am

For the ones that you adapt would it be possible to have something like "if os = xbox" then do something else? If the authors could have something like this in their code I'm sure they wouldn't mind adding it to the official repo's so the addons are truly universal.

What you mean thats make not all addon Developer and it works not for the greather Addons like Youtube , Vimeo and others!

Addonscriptor is the one and only what i have asked and what this do!
this here is a example:

xbox = xbmc.getCondVisibility("System.Platform.xbox")

if xbox==True:
url = "plugin://video/YouTube/?path=/root/video&action=play_video&videoid=" + id
else:
url = "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=" + id

it have only akzeptanz from the developer when the changes since a little!

i think is better we have a own xbmc4xbox repro and this is when i right understand what buzZ do!

regards jan

skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Addons4Xbox development

Post by skatulskijean » Sat Nov 17, 2012 12:37 pm

BuZz wrote:anyway. still a lot of idea. right now im peeking at jans stuff to generate some diffs to see if using his changes would save some time on some of the non working plugins. If you can save me some time Jan by providing code changes that would be great too. isee in url resolver you disabled some login stuff. which "source" of url resolver did you use btw ? seems there are multiple forks, some which are different but with the same version numbers :/ what was the fix you did for getting urlresolver settings to show ?(i see you mentioned that in your release notes).
Sorry i have not read this before!

Most what i have changed what simple thinks:

On most addons you have :
as example settings = xbmcaddon.Addon()
this will our scriptmodul.xbmcaddon not understand
you must put the addon id in it thats works
settings = xbmcaddon.Addon(id='plugin.video.svt')

a class with () will not works:
example:
class YouTubeStorage(): works not
class YouTubeStorage: works

import json works not
import simplejson as json works

import

from hashlib import md5 works not we have no hashlib!
from md5 import md5 as md5 works
is the same with sha
and you must simple change on the py as exemple hashlib.md5 to md5
i have a working hashlib pyd with a working hashlib.py i look and make for the future a scriptmodul but i must test!

Storageserver :
storageserver will not works we have no common cache on first i hat to look but with the last YouTube plugin the Storageserverdummy works out of the box and it works for other addons to you must simple change import storageserver to import storageserverdummy and on the py to!
Storageserverdummy have no Filcache and the only addon what not works with is is Icefilms but the storageserverdummy on my build for Icefilms have a simple file cache the better way where to implemented commoncache for xbmc4xbox !

the common function for the addons like YouTube give the scriptmodule parsedom
on parsedom you have import io
python 2,4 can not understand import io but most is simple a io.open(filepath, options) and works with open(filepath, options) !

Format will not work on python 2.4
example:

final_url = "{0}?mode={1}&title={2}".format(sys.argv[0], mode, title) will not works
final_url = "%s?mode=%s&title=%s" % (sys.argv[0], mode, title)

inline if works not on python 2.4
example:
test = True if test2 == True else False works not

if test2 == True:
test = True
else:
test = False works

most you have a error with as simple change as to , and it works!

pfad what not works example:
main xbmc: url = "plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=" + id
xbmc4xbox working : url = "plugin://video/YouTube/?path=/root/video&action=play_video&videoid=" + id

URlresolver:
For the first Version what i have do i hat many work on my brain to understand why it not works but with the last Version from Eden you must simple copy the scriptmodule under scriptmodule and as module under plugins (yes this not the right solution) but it works!
The only changes since under the Hoster (hash and accessing the Log ) and for the Youtube and others what access the addons example Youtube the pfad to accessing the Addon!

For most addons when you have all adapted and changed that works and the addon works on main xbmc and you have a HTTp 404 error change from urllib2 to mechanize but make the http error access with urllib2
example [removed] was not working with urllib2 but with change to mechanize my adapted version works!

Sorry i forgot many addons can not create the settings:
example : LiveOnlineFooty
add this with the addon spezific id and its works:
#xbox fox can not create self Folder
addonID = "plugin.video.lof"
addon_work_folder=xbmc.translatePath("special://profile/addon_data/"+addonID)
if not os.path.isdir(addon_work_folder):
os.mkdir(addon_work_folder)
# end xbox Fix


Ok i think that was what i mainly change to make addons compatible on this time!

BuzZ you see it since only 3 changes what have not to do with the python version what we have!
Edit:
On my last build i have changed from urllib2 to mechanize (i think it works better example [removed] to access the website and myvideo.de redirect was not working with urllib2 wit mecchanize it works and it have not the socket timeout syntax problem from urllib2 from python 2.4!

Finaly i think change to a newer python as example 2.5 and we have not to many to adapting on this time !
With the next Xbmc Version Frodo what have python 2.7 we have more syntax Problems as before!

thanks again for your nice work

Regards Jan
Last edited by skatulskijean on Fri Nov 23, 2012 7:56 am, edited 1 time in total.

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sat Nov 17, 2012 1:56 pm

skatulskijean wrote: On most addons you have :
as example settings = xbmcaddon.Addon()
this will our scriptmodul.xbmcaddon not understand
you must put the addon id in it thats works
settings = xbmcaddon.Addon(id='plugin.video.svt')
appreciate the comments.

im rather tired so I will read it again later, but the code above should work without the id, at least for plugins. it didnt work for script modules, but I have fixed that now in the addon module.

appreciate the help jan. once we have a new repo set up, and I have done some more work on the addons installer, I look forward to your contributions ;-)

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sat Nov 17, 2012 1:58 pm

oh and I tried to fix the socket timeout by changing our python2.4 urllib2. i didnt have much time to test. not yet committed. some stuff that is not core language stuff but python modules such as the urllib2 can be fixed up with our old python.

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sat Nov 17, 2012 2:50 pm

some of the other stuff can be fixed without a new python also, as a quick fix.. such as the import json for example. should be doable. anyway, we can discuss more once I have the plugin in better shape and a repository setup.

skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Addons4Xbox development

Post by skatulskijean » Sat Nov 17, 2012 4:13 pm

BuZz wrote:some of the other stuff can be fixed without a new python also, as a quick fix.. such as the import json for example. should be doable. anyway, we can discuss more once I have the plugin in better shape and a repository setup.

thanks
we make this!

regards jan ;)

skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Addons4Xbox development

Post by skatulskijean » Fri Nov 23, 2012 8:20 am

more changes to adapt a addon for xbmc4xbox!

from urlparse import parse_qs works not on python 2.4 on xbmc4xbox

Solution:

from cgi import parse_qs

You çan it make better with a try solution!

from functools import wraps works not on py<ython 2.4 on xbmc4xbox

Solution:

try:
from functools import wraps
except ImportError:
# Python 2.4 compatibility
def wraps(original):
def inner(f):
f.__name__ = original.__name__
f.__doc__ = original.__doc__
f.__module__ = original.__module__
return f
return inner


you can the try: solution use for a better compatible addons !
The import works then on (main xbmc and xbmc4xbox!)!

example the try solution for import json from my last post:

try:
import json
except ImportError:
# Python 2.4 compatibility
import simplejson as json



you have a finally script error

change finaly to raise

EXAMPLE:

try:
yield 42
except: # bare except, catches *anything*
do_something()
finally:
do_something()
give a finally error on python 2.4 (xbmc4xbox)

Solution:

try:
yield 42
except: # bare except, catches *anything*
do_something()
raise # re-raise same exception
do_something()


a other example to change pfad
it give addons from mainline xbmc what access a url and this url have the pfad to access the stream over a addon(the pfad to access a addon or plugin since on xbmc4xbox different to main xbmc and the stream will on xbmc4xbox not work!

EXAMPLE:

Code: Select all

def play_youtube_video(video_id):
	url = video_id
this give a error and you must simple see with a print sythax what is on video_id!
Ok we make this!

Code: Select all

def play_youtube_video(video_id):
	print ("Playing video id: " + video_id )
	url = video_id
on the debug log you see the DVDplayer can not handle plugin!
why :
the print syntax let you see on the Debug-Log what is on video_id
it give a plugin://plugin.video.youtube and the pfad is not xbmc4xbox compatible!
The working pfad to access the Youtube addon is plugin://video/YouTube and we can change with replace to this!

Solution with a simple replace:

Code: Select all

def play_youtube_video(video_id):
	print ("Playing video id: " + video_id )
	url = video_id.replace('plugin://plugin.video.youtube', 'plugin://video/YouTube')
And the Stream works!





regards jan ;)

more on the next Days

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sun Dec 09, 2012 6:25 pm

Hi,

Things are pretty much ready for initial testing and development.

I decided to use the existing addons4xbox google code repository for ease of use, and so everyone can get stuck in.

Hosted here:

http://addons4xbox.googlecode.com/svn/branches/addons/
http://addons4xbox.googlecode.com/ (main googlecode site)

first you need to get the latest version of the addons4xbox installer - you can get it from svn via

svn co https://passion-xbmc.googlecode.com/svn ... 0Installer

(you could install it from the svn repo installer, but make sure you delete any old version, as the version number isn't bumped yet - ill bump the version after some more code changes)

install to program/plugins/

once run there should be an "XBMC4Xbox Add-ons" entry. in there is currently one video addon ([removed]), which should install and install all dependencies. ive tested it briefly and it at least works when i got a working source etc. might need some more improvements though. not very quick due to urlresolver loading all its plugins, could probably be set to only load urlresolver stuff when needed, and not when just browsing.

so we can start adding others now. note only 2 dependencies are included, as the others will be grabbed automatically from the xbmc repository. for any dependencies, our repo will be checked first, followed by the xbmc repo, so we should include any dependencies that don't work without changes, or are not included at xbmc.

I also plan to include a whitelist for xbmc official repo, so we can whitelist stuff that works out of the box, so when people browse their repository, they dont get lots of stuff that will install and throw up errors.

whufclee
Posts: 922
Joined: Tue Jul 17, 2012 5:42 pm
Location: Essex, UK
Has thanked: 18 times
Been thanked: 109 times
Contact:

Re: Addons4Xbox development

Post by whufclee » Sun Dec 09, 2012 6:46 pm

This is brilliant news mate, can't wait to try it out.

So can I just clarify something... We would be able to install via the xbmc.org repo if the addon is in the whitelist and the Addons4Xbox repo would only host addons that have been adapted for xbox use?

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sun Dec 09, 2012 7:25 pm

whufclee wrote:This is brilliant news mate, can't wait to try it out.

So can I just clarify something... We would be able to install via the xbmc.org repo if the addon is in the whitelist and the Addons4Xbox repo would only host addons that have been adapted for xbox use?
the idea is we only host stuff that needs modification. anything else we should use the main repo, so the idea is to whitelist the stuff that works, or blacklist the stuff that doesnt - depending which works best - maybe blacklisting would be better as then new stuff would show up and we wouldnt need to update as often perhaps.

if I got your question right anyway.

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sun Dec 09, 2012 7:41 pm

added a quick modification of youtube to the repository. only slightly tested. just as another plugin as a starting point. btw there are issues with the xbmc4xbox addons in that it doesnt recursively grab all files correctly. this is partly my fault for making it less fussy for non svn based repositories, but im about to fix that up in a mo

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sun Dec 09, 2012 7:52 pm

ok. that issue should be sorted, so please checkout a fresh addons4xbox installer

User avatar
Kozz
Posts: 238
Joined: Wed Jul 04, 2012 4:42 am
Has thanked: 22 times
Been thanked: 51 times

Re: Addons4Xbox development

Post by Kozz » Sun Dec 09, 2012 8:27 pm

Excellent work, gonna check it out after I do a checkout ;)
Image

whufclee
Posts: 922
Joined: Tue Jul 17, 2012 5:42 pm
Location: Essex, UK
Has thanked: 18 times
Been thanked: 109 times
Contact:

Re: Addons4Xbox development

Post by whufclee » Sun Dec 09, 2012 9:59 pm

Buzz I'm impressed, it's already working very well. I installed some unofficial repo's from the online scrape with no problems and it installed the few addons I tried with no problems. I downloaded Navi-X from fusion and tried to install that but something didn't work, can't find it anywhere so I'll do a little debugging on that... maybe script installs needs a bit of work?

Installs repo's and plugins via zip with no problems. I can't seem to get it to install from a zip file on fusion though, I have to manually download the zip via filemanager and then install from the local zip file. Is this a limitation of the xbox? It's not a big problems either way.

[removed] didn't work for me but I've since spoken to kozz who explained that problem, something to do with the xbmcaddon module.

Also, this has been a bug since the original release but I may as well mention it... When installing some addons it tries to install modules which are already installed and comes up with an error message that the module couldn't be installed. A quick press of OK and everything is working so it's not a big problem but maybe it could be sorted? Can't remember which addon I tried to install but it tried to re-install simplejson and came up with the error message, however the plugin worked fine. I'll do a proper test tomorrow when I have a bit more time on my hands and will upload some debug logs.

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sun Dec 09, 2012 10:37 pm

thanks. the [removed] issue is from the settings.xml getting blanked. an interaction with multiple addons and settings and the emulation layer. get the latest xbmcaddon code from https://svn.exotica.org.uk:8443/xbmc4xb ... xbmcaddon/ and try reinstalling [removed] and see if it helps. I may have to do some more work on it.

anyway, it's a start ;-)

Will look into issues, ones related to the addons4xbox installer can be added http://code.google.com/p/passion-xbmc/issues/list and I will look into them. I am aware of a fair few obvious problems already. I need to spend some more time going over the code.

User avatar
BuZz
Site Admin
Posts: 1889
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 62 times
Been thanked: 422 times
Contact:

Re: Addons4Xbox development

Post by BuZz » Sun Dec 09, 2012 10:49 pm

It actually needs something else but ill look into it this week.

skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Addons4Xbox development

Post by skatulskijean » Mon Dec 10, 2012 12:17 pm

Thanks Buzz !
That is what i mean !
i must not create my own repro from adapted addons!
the only what we can as next step do it the backward integration on the skins self like main xbmc!
can i have access to add more !

like Vimeo , BlipTV scriptmodule xbmcswift2 and the new xbmcswift addons !
Most addons have the dependencies from Vimeo - Youtube and Bliptv to stream the Videos!


Regards Jan

Ps works on your adapted youtube addon the login!

Post Reply