Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Youtube Playback #3

Open
GoogleCodeExporter opened this issue Jun 12, 2015 · 2 comments
Open

Youtube Playback #3

GoogleCodeExporter opened this issue Jun 12, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Hi,
   youtube playback is solved. XBMC or xbmc-send don't handle correctly long-url sent by iThing. I've patched playMedia function in play2wifi with:

    def playMedia(self, data):
        sub1 = 'Content-Location: '
        sub2 = '\nStart-Position: '
        location = data.split(sub1)[-1].split(sub2)[0]
        self.__mylogger.debug("Found the following Media to play: "+location)
        if location.find("googlevideo") > 0:
            url_data = urllib.urlencode(dict("url"=location))
            ret = urllib.urlopen("http://tinyurl.com/api-create.php", data=url_data).read().strip()
            subprocess.call(["xbmc-send", "-a", "PlayMedia("+ret+")"], cwd="./", stdout=open("/dev/null", 'w'))
        else:
            subprocess.call(["xbmc-send", "-a", "PlayMedia("+location+")"], cwd="./", stdout=open("/dev/null", 'w'))


creating a tinyurl on-the-fly and works. I think that you can change the 
condition (location.find("googlevideo")) and check the url length OR create a 
local playlist file and then playback this file with PlayMedia function.

Bye,
Angelo

Original issue reported on code.google.com by [email protected] on 4 Jan 2011 at 11:41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant