How get the real XBMC user-agent value?
#1
Actually, when a XBMC python add-on is accessing an internet server (using urllib or urllib2) the user agent used is Python-urllib/2.7. The user agent could always been modified using urllib, but how could we get the real XBMC user-agent value from XBMC? Or, is their a way to rebuilt it?
Reply
#2
I don't know that there is in fact a single "real" XBMC user-agent value for XBMC.

For example the XBMC debug log add-on has the following code:

Code:
ADDON_TITLE = addon.getAddonInfo('name')
ADDON_VERSION = addon.getAddonInfo('version')

headers = {'User-Agent': '%s-%s' % (ADDON_TITLE, ADDON_VERSION)}

Is this what you are asking about?
DEBUG log: http://kodi.wiki/view/Log_file/Easy
HTPC advice: http://mymediaexperience.com , http://lifehacker.com/5828747/how-to-bui...lete-guide
My HTPC: an Acer Revo RL80 Nettop PC:
Windows 10
Intel Core-i3-2377M @ 1.5GHz, 4GB DDR3 @ 665MHz, Intel HD3000
465GB SATA disk, DVD-RW, 1.8TB Seagate USB disk


Reply
#3
Thank you, but no. That the opposite that I want. I want to be able to send something like this :

Code:
User-Agent: XBMC/13.0-ALPHA3 Git:20130430-e8fe5cf (Windows NT 6.1;WOW64;Win64;x64; http://www.xbmc.org)

through headers by using urlllib. But not a fake XBMC user-agent value. The real XBMC user-agent value of the system.
Reply
#4
Was this ever solved?
Reply
#5
Why bother? Send whatever User-Agent string you like. Or note the pattern and construct User-Agent based on that pattern. Kodi version can be extracted via 'System.BuildVersion' info-label.
Reply
#6
https://github.com/xbmc/xbmc/pull/8643
Reply
#7
(2015-12-21, 21:02)wsnipex Wrote: https://github.com/xbmc/xbmc/pull/8643

Great! this works on Krypton, here is an example:

Code:
import xbmc
real_user_agent = xbmc.getUserAgent()
print real_user_agent
Reply
#8
Is there a Jarvis equivalent to xbmc.getUserAgent() ?

Trying to get android os details of any system.
Reply
#9
nope
Reply

Logout Mark Read Team Forum Stats Members Help
How get the real XBMC user-agent value?0