Kodi Community Forum
How get the real XBMC user-agent value? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: How get the real XBMC user-agent value? (/showthread.php?tid=202842)



How get the real XBMC user-agent value? - Angelscry - 2014-08-24

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?


RE: How get the real XBMC user-agent value? - elusien - 2014-08-24

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?


RE: How get the real XBMC user-agent value? - Angelscry - 2014-08-24

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.


RE: How get the real XBMC user-agent value? - MimicZ - 2015-12-21

Was this ever solved?


RE: How get the real XBMC user-agent value? - Roman_V_M - 2015-12-21

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.


RE: How get the real XBMC user-agent value? - wsnipex - 2015-12-21

https://github.com/xbmc/xbmc/pull/8643


RE: How get the real XBMC user-agent value? - innovaciones - 2016-11-16

(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



RE: How get the real XBMC user-agent value? - OptimusGREEN - 2017-02-26

Is there a Jarvis equivalent to xbmc.getUserAgent() ?

Trying to get android os details of any system.


RE: How get the real XBMC user-agent value? - wsnipex - 2017-02-26

nope