Solved Problem with User-Agent on xbmc.player().play()
#1
I try to add User-Agent when playing on XBMC and I found this topic
http://forum.xbmc.org/showthread.php?tid=14643
I found "sphere" tell that you can use
Code:
|User-Agent=Foo%20Bar
then trying to use this on my XBMC swift2 plugin
Code:
USER_AGENT = "AppleCoreMedia/1.0.0.10A523 (iPad; U; CPU OS 6_0_1 like Mac OS X; en_us)"
play_url += '?|User-Agent=%s' % USER_AGENT
it doesn't work so I try to encode the USER_AGENT
Code:
USER_AGENT = "AppleCoreMedia%2f1.0.0.10A523%20%28iPad%3B%20U%3B%20CPU%20OS%206_0_1%20like%20Mac%20OS%20X%3B%20en_us%29"
it doesn't work again.

this is all of my try
Code:
USER_AGENT = "AppleCoreMedia/1.0.0.10A523 (iPad; U; CPU OS 6_0_1 like Mac OS X; en_us)"
play_url += '?|User-Agent=%s' % USER_AGENT
Code:
USER_AGENT = "AppleCoreMedia/1.0.0.10A523 (iPad; U; CPU OS 6_0_1 like Mac OS X; en_us)"
play_url += '|User-Agent=%s' % USER_AGENT
Code:
USER_AGENT = "AppleCoreMedia%2f1.0.0.10A523%20%28iPad%3B%20U%3B%20CPU%20OS%206_0_1%20like%20Mac%20OS%20X%3B%20en_us%29"
play_url += '?|User-Agent=%s' % USER_AGENT
Code:
USER_AGENT = "AppleCoreMedia%2f1.0.0.10A523%20%28iPad%3B%20U%3B%20CPU%20OS%206_0_1%20like%20Mac%20OS%20X%3B%20en_us%29"
play_url += '|User-Agent=%s' % USER_AGENT

Can anyone help me to do the right thing please?
Reply
#2
This from https://github.com/dersphere/plugin.vide...don.py#L82
Code:
@plugin.route('/trailer/play/<play_url>')
def play_trailer(play_url):
    downloads = plugin.get_storage('downloads')
    if play_url in downloads:
        if xbmcvfs.exists(downloads[play_url]):
            play_url = downloads[play_url]
            return plugin.set_resolved_url(play_url)
    play_url += '?|User-Agent=%s' % USER_AGENT
    return plugin.set_resolved_url(play_url)
as you can see on
Code:
play_url += '?|User-Agent=%s' % USER_AGENT
I try to change to
Code:
AppleCoreMedia/1.0.0.10A523 (iPad; U; CPU OS 6_0_1 like Mac OS X; en_us)

but it doesn't work!

help me please.
Reply
#3
can anyone help me?

I have no idea.

thanks for help.
Reply
#4
I try to change to
AppleCoreMedia/1.0.0.10A523 (iPad; U; CPU OS 6_0_1 like Mac OS X; en_us)

it not work for me
Reply
#5
i have no idea about this Confused
Reply
#6
I report this bug to
https://github.com/xbmc/xbmc/issues
Reply

Logout Mark Read Team Forum Stats Members Help
Problem with User-Agent on xbmc.player().play()0