- logger.info -> logger.log

- fix unshortenit kodi 19
This commit is contained in:
Alhaziel01
2020-08-17 11:17:55 +02:00
parent bfb80f6889
commit c7e41f41a2
162 changed files with 1011 additions and 1034 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ from platformcode import logger
def get_long_url(short_url):
logger.info("short_url = '%s'" % short_url)
logger.log("short_url = '%s'" % short_url)
data = httptools.downloadpage(short_url).data
ysmm = scrapertools.find_single_match(data, "var ysmm = '([^']+)';")
+4 -4
View File
@@ -17,7 +17,7 @@ from platformcode import logger
# Obtiene la URL que hay detrás de un enlace a linkbucks
def get_long_url(short_url):
logger.info("(short_url='%s')" % short_url)
logger.log("(short_url='%s')" % short_url)
request_headers = []
request_headers.append(["User-Agent",
@@ -33,17 +33,17 @@ def get_long_url(short_url):
while True:
for name, value in response_headers:
if name == "set-cookie":
logger.info("Set-Cookie: " + value)
logger.log("Set-Cookie: " + value)
cookie_name = scrapertools.scrapertools.find_single_match(value, '(.*?)\=.*?\;')
cookie_value = scrapertools.scrapertools.find_single_match(value, '.*?\=(.*?)\;')
request_headers.append(["Cookie", cookie_name + "=" + cookie_value])
body, response_headers = scrapertools.read_body_and_headers(url, headers=request_headers)
logger.info("body=" + body)
logger.log("body=" + body)
try:
location = scrapertools.scrapertools.find_single_match(body, '<textarea.*?class="caja_des">([^<]+)</textarea>')
logger.info("location=" + location)
logger.log("location=" + location)
break
except:
n = n + 1
+3 -3
View File
@@ -38,15 +38,15 @@ servers = get_server_list()
def get_long_urls(data):
logger.info()
logger.log()
patron = '<a href="http://([^"]+)"'
matches = re.compile(patron, re.DOTALL).findall(data)
for short_url in matches:
if short_url.startswith(tuple(servers)):
logger.info(": " + short_url)
logger.log(": " + short_url)
longurl_data = httptools.downloadpage(
"http://api.longurl.org/v2/expand?url=" + urllib.quote_plus(short_url)).data
logger.info(longurl_data)
logger.log(longurl_data)
try:
long_url = scrapertools.scrapertools.find_single_match(longurl_data, '<long-url><!\[CDATA\[(.*?)\]\]></long-url>')
except:
+2 -2
View File
@@ -5,9 +5,9 @@ from platformcode import logger
def get_long_url(short_url):
logger.info("(short_url='%s')" % short_url)
logger.log("(short_url='%s')" % short_url)
location = scrapertools.get_header_from_response(short_url, header_to_get="location")
logger.info("location=" + location)
logger.log("location=" + location)
return location