YouTube Addon porting

Discussion of plugin / script development for XBMC4Xbox
tim619
Posts: 204
Joined: Sun Mar 10, 2013 10:22 am
Has thanked: 25 times
Been thanked: 59 times

YouTube Addon porting

Post by tim619 »

Finally I decided to port the bromix youtube addon, also it is now listed as the official kodi youtube addon.
I'm very near having it completely working on xbox it's only a path function which needs to be edited. I debugged now for hours and coming step by step to the aim :)
His code is very "objected" and not documented that makes it harder... also it seems the functions are completely equivalent on kodi and x4x but returning different things.
browsebot
Posts: 14
Joined: Tue Jul 08, 2014 12:25 am
Has thanked: 3 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by browsebot »

Thanks so much for the update on the progress. Historically, you've always been one of the core group of dedicated developers, so I'm sure the community has full confidence that you'll get it up and running on the xbox. It's just a matter of time, and people that are still using a console originally released in 2001 tend to be the patient type. :)
NOTTHESAME
Posts: 532
Joined: Thu Aug 02, 2012 7:46 am
Has thanked: 82 times
Been thanked: 61 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by NOTTHESAME »

If anybody wants to use a temp youtube install Search Youtube from xunitytalk repo, downfall is no offical videos work and 720p playback, their is no option for this, but it works.
mel123
Posts: 15
Joined: Mon Jul 28, 2014 3:02 pm
Has thanked: 5 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by mel123 »

Hi,
I tryed youtube as you described .Not working on xbox.can you please put the addon in.Thank you.
NOTTHESAME
Posts: 532
Joined: Thu Aug 02, 2012 7:46 am
Has thanked: 82 times
Been thanked: 61 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by NOTTHESAME »

https://www.dropbox.com/s/86o30lzkr92n0 ... x.zip?dl=0
Ftp to xbox,unzip and copy to your plugin videos, you dont have to install with zip.
mel123
Posts: 15
Joined: Mon Jul 28, 2014 3:02 pm
Has thanked: 5 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by mel123 »

Hi notthesame.Thanks for youtube FTP.It work on xbox .GREAT
tim619
Posts: 204
Joined: Sun Mar 10, 2013 10:22 am
Has thanked: 25 times
Been thanked: 59 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by tim619 »

The "Youtube Search" addon is a bit out of date but still works fine. The downside is that it can only fetch 720p, 360p, 240p,... NO 480p that means for xbox only 360p is possible with this version...

Nevertheless I patched it to always take 360p.
http://www94.zippyshare.com/v/QS7GL5Yx/file.html

My work on YouTube addon by bromix is nearly finished but there is one major problem left that can't be fixed with Python easily:
bromix wrote his own routine do set sys.args that means instead of link params like ?key=value he does plugin://pluginname/here/come/the/args/coded/as/foldernames
of course those folders arent available so also default.py is missing but kodi just looks in the parent dir for a default.py until it reaches the pluginname path -> it will find the default.py
and only warns. x4x instead doesn't look all those folders and gives error. My idea was now to answer this bad routine with an even badder routine: just create all those folders and in every folder put a copy of default.py -> I think this will work although it's very ugly
User avatar
BuZz
Site Admin
Posts: 1890
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 65 times
Been thanked: 422 times
Contact:

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by BuZz »

I would just rewrite the url generation / parameters etc - so it uses key=value querystring style parameters. I looked at the youtube plugin before briefly, and got it partially working afair - most of the url handling is done in one place isn't it ?

[edit]

to be more specific, I adjusted previous code that worked like this by just sticking the entire path into a single parameter like

plugin://pluginname/here/come/the/args/

to

plugin://pluginname/?params=/here/come/the/args/

you can then just have a bit of code that gets the value, and passes it over to the existing code etc.
tim619
Posts: 204
Joined: Sun Mar 10, 2013 10:22 am
Has thanked: 25 times
Been thanked: 59 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by tim619 »

I'm not sure if that's easier. What could you get working? Maybe you did other things so I can see your idea.

I edited xbmc_context.py:

Code: Select all

        if override:
            self._uri = sys.argv[0].replace("video/", "video*")
            #xbmc.log("sysarg0: " + str(sys.argv[0]))
            #xbmc.log("sysarg1: " + str(sys.argv[1]))
            #xbmc.log("sysarg2: " + str(sys.argv[2]))
            comps = urlparse.urlparse(self._uri)
            temp_netloc = comps.netloc
            temp_netloc = temp_netloc.replace("video*", "video/")
            comps = comps._replace(netloc=temp_netloc)
            self._path = urllib.unquote(comps.path).decode('utf-8')
abstract_context.py:

Code: Select all

    def create_uri(self, path=u'/', params=None):
        if not params:
            params = {}
            pass

        uri = create_uri_path(path)
        #if uri:
        #    uri = "%s://%s%s" % ('plugin', self._plugin_id.encode('utf-8'), uri)
        #else:
        #    uri = "%s://%s/" % ('plugin', self._plugin_id.encode('utf-8'))
        #    pass
        if uri:
            uri = "%s://%s%s%s" % ('plugin', 'video/', self._plugin_id.encode('utf-8'), uri)
        else:
            uri = "%s://%s%s/" % ('plugin', 'video/', self._plugin_id.encode('utf-8'))
            pass
Maybe one more cannot see atm. I also wrote a nice "Youtube Updater" it downloads the latest version from github patches it and installs/updates the addon.
Obviously the patching routing is missing for now.

In my opinion it could work like said adding all folder structures and copies of default.py each copy maybe with slightly different import paths.
User avatar
BuZz
Site Admin
Posts: 1890
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 65 times
Been thanked: 422 times
Contact:

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by BuZz »

I updated my previous post.
tim619
Posts: 204
Joined: Sun Mar 10, 2013 10:22 am
Has thanked: 25 times
Been thanked: 59 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by tim619 »

Yes that would be the better way but I can not imagine how much work would be left without seeing what you already changed, it would be nice if you could upload the things you changed maybe I see better what is missing.
User avatar
Dom DXecutioner
Posts: 585
Joined: Thu Jul 05, 2012 11:59 pm
Location: California
Has thanked: 249 times
Been thanked: 219 times
Contact:

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by Dom DXecutioner »

@tim619: As a matter of suggestion, it'd probably be best if you open a new topic specifically for YouTube work in progress.
Image
User avatar
BuZz
Site Admin
Posts: 1890
Joined: Wed Jul 04, 2012 12:50 am
Location: UK
Has thanked: 65 times
Been thanked: 422 times
Contact:

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by BuZz »

I don't have any code - I only had a quick play some time ago.
skatulskijean
Posts: 1028
Joined: Wed Jul 04, 2012 8:01 am
Has thanked: 1 time
Been thanked: 148 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by skatulskijean »

Working on update from my Youtubesearch addon .

Change to youtube v3 api
Download option for video and only audio from the video over contextmenu
working with best video for main xbmc and best playing suported videos on xbmc4xbox.
more come later

regards jan
tim619
Posts: 204
Joined: Sun Mar 10, 2013 10:22 am
Has thanked: 25 times
Been thanked: 59 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by tim619 »

@Buzz
I've now edited the code as you said, it seems indeed easier and now only one function is left :D
(instead of plugin://plugin.video.youtube/special/popular_right_now/ -> plugin://plugin.video.youtube/?args=/special/popular_right_now/ etc)
Edit: I think it works now, need to test on xbox :o
@Dom
Yes you're right already thought about it, too and will open another thread soon.
mel123
Posts: 15
Joined: Mon Jul 28, 2014 3:02 pm
Has thanked: 5 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by mel123 »

Hi,
Any news about new youtube?
Thankyou
NOTTHESAME
Posts: 532
Joined: Thu Aug 02, 2012 7:46 am
Has thanked: 82 times
Been thanked: 61 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by NOTTHESAME »

Did you try to use the temp version tim patch for the mean time, i been using it and it works fine.
mel123
Posts: 15
Joined: Mon Jul 28, 2014 3:02 pm
Has thanked: 5 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by mel123 »

Hi,Thanks for your reply.I cannot find it.Where will i get it from.
User avatar
sixties keith
Posts: 534
Joined: Wed Aug 01, 2012 9:30 am
Has thanked: 27 times
Been thanked: 32 times

YouTube Addon Porting

Post by sixties keith »

cheers for this, going to test it out really soon, ok to post over at totalxbmc or better to wait for full release? thanks
Image

120gb hdd, vinyl magma skin, front lights, side strip lights, clear jewel mod with lights, ir dongle mod, hdd indicator. X3 with LCD many mods inc custom x3 jewel.
NOTTHESAME
Posts: 532
Joined: Thu Aug 02, 2012 7:46 am
Has thanked: 82 times
Been thanked: 61 times

Re: Have you a request for addons or scripts for xbmc4xbox ?

Post by NOTTHESAME »

mel123 wrote:Hi,Thanks for your reply.I cannot find it.Where will i get it from.
Page 11 but heres the link thanks to tim. http://www94.zippyshare.com/v/QS7GL5Yx/file.html
Post Reply