Skip to content

Commit

Permalink
[python] add method to get our useragent string
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnipex committed Dec 23, 2015
1 parent 24ece34 commit cbd95f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xbmc/interfaces/legacy/ModuleXbmc.cpp
Expand Up @@ -51,6 +51,7 @@
#include "storage/MediaManager.h"
#include "utils/LangCodeExpander.h"
#include "utils/StringUtils.h"
#include "utils/SystemInfo.h"
#include "AddonUtils.h"

#include "LanguageHook.h"
Expand Down Expand Up @@ -519,6 +520,11 @@ namespace XBMCAddon
return convertedLanguage;
}

String getUserAgent()
{
return CSysInfo::GetUserAgent();
}

int getSERVER_WEBSERVER() { return CApplication::ES_WEBSERVER; }
int getSERVER_AIRPLAYSERVER() { return CApplication::ES_AIRPLAYSERVER; }
int getSERVER_UPNPSERVER() { return CApplication::ES_UPNPSERVER; }
Expand Down
11 changes: 11 additions & 0 deletions xbmc/interfaces/legacy/ModuleXbmc.h
Expand Up @@ -403,6 +403,17 @@ namespace XBMCAddon
*/
void audioResume();

/**
* getUserAgent() -- Returns Kodi's HTTP UserAgent string
*
* example:
* xbmc.getUserAgent()
*
* example output:
* Kodi/17.0-ALPHA1 (X11; Linux x86_64) Ubuntu/15.10 App_Bitness/64 Version/17.0-ALPHA1-Git:2015-12-23-5770d28
*/
String getUserAgent();

/**
* convertLanguage(language, format) -- Returns the given language converted to the given format as a string.
*
Expand Down

0 comments on commit cbd95f1

Please sign in to comment.