From 046241797a0e70d2ac577b087e3df11596b5ab83 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 12 Sep 2018 16:47:59 -0300 Subject: [PATCH] nuevo metodo para obtener el user agent global --- plugin.video.alfa/core/httptools.py | 3 +++ 1 file changed, 3 insertions(+) mode change 100755 => 100644 plugin.video.alfa/core/httptools.py diff --git a/plugin.video.alfa/core/httptools.py b/plugin.video.alfa/core/httptools.py old mode 100755 new mode 100644 index 5f2f2355..bc20a2a1 --- a/plugin.video.alfa/core/httptools.py +++ b/plugin.video.alfa/core/httptools.py @@ -56,6 +56,9 @@ default_headers["Accept-Encoding"] = "gzip" HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = config.get_setting('httptools_timeout', default=15) if HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT == 0: HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = None +def get_user_agent(): + # Devuelve el user agent global para ser utilizado cuando es necesario para la url. + return default_headers["User-Agent"] def get_url_headers(url): domain_cookies = cj._cookies.get("." + urlparse.urlparse(url)[1], {}).get("/", {})