added localized strings and update unshortenit.py

This commit is contained in:
angedam
2018-08-06 21:22:21 +02:00
parent 5f89b8ecb6
commit b3f4316a19
8 changed files with 476 additions and 71 deletions

View File

@@ -37,9 +37,9 @@ ACTION_MOVE_UP = 3
set_animation = False
xinfoplus_set = config.get_setting("infoplus_set")
if xinfoplus_set == "Sin animación":
if xinfoplus_set == config.get_localized_string(70129):
set_animation = False
if xinfoplus_set == "Con animación":
if xinfoplus_set == config.get_localized_string(70130):
set_animation = True
def start(item, recomendaciones=[], from_window=False):
@@ -400,7 +400,7 @@ class main(xbmcgui.WindowDialog):
self.plot.autoScroll(11000, 6000, 30000)
except:
xbmc.executebuiltin(
'Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")')
config.get_localized_string(70500))
self.plot.setText(dhe(self.infoLabels.get("plot", "")))
xbmc.sleep(200)
@@ -842,7 +842,7 @@ class related(xbmcgui.WindowDialog):
self.info_peli.autoScroll(7000, 6000, 30000)
except:
xbmc.executebuiltin(
'Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")')
config.get_localized_string(70500))
self.info_peli.setText(self.info)
if set_animation:
self.info_peli.setAnimations(
@@ -859,9 +859,9 @@ class related(xbmcgui.WindowDialog):
('WindowClose', 'effect=zoom end=0% time=1000 condition=true',)])
if self.infoLabels.get("status") == "Ended" and self.item.contentType != "movie":
status = "[COLOR aquamarine][B]Finalizada %s[/B][/COLOR]"
status = config.get_localized_string(70515)
elif self.infoLabels.get("status") and self.item.contentType != "movie":
status = "[COLOR aquamarine][B]En emisión %s[/B][/COLOR]"
status = config.get_localized_string(70516)
else:
status = "[COLOR aquamarine][B]%s[/B][/COLOR]"
@@ -1238,7 +1238,7 @@ class Busqueda(xbmcgui.WindowXMLDialog):
else:
self.getControl(1).setLabel(config.get_localized_string(60494))
self.getControl(5).setLabel("[COLOR tomato][B]Cerrar[/B][/COLOR]")
self.getControl(5).setLabel(config.get_localized_string(60495))
self.control_list.reset()
items = []
for item_l in self.lista:
@@ -1577,7 +1577,7 @@ class ActorInfo(xbmcgui.WindowDialog):
self.info_actor.autoScroll(7000, 6000, 30000)
except:
xbmc.executebuiltin(
'Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")')
config.get_localized_string(70500))
self.info_actor.setText(
"[COLOR coral][B]%s[/B][/COLOR]" % actor_tmdb.result.get("biography", config.get_localized_string(60504)))
@@ -1601,7 +1601,7 @@ class ActorInfo(xbmcgui.WindowDialog):
else:
self.titulos.append([entradas["id"], entradas.get("title", entradas.get("original_title", "")), thumb])
self.dialog.update(40, '[COLOR rosybrown]Obteniendo filmografía...[/COLOR]')
self.dialog.update(40, config.get_localized_string(60505))
self.mas_pelis = 8
self.idps = []
self.botones = []
@@ -1673,7 +1673,7 @@ class ActorInfo(xbmcgui.WindowDialog):
self.botones.append(self.btn_right)
xbmc.sleep(200)
self.dialog.update(80, '[COLOR plum]Recopilando imágenes...[/COLOR]')
self.dialog.update(80, config.get_localized_string(60506))
self.images = []
for images in actor_tmdb.result.get("images", {}).get("profiles", []):
imagen = "https://image.tmdb.org/t/p/original" + images["file_path"]

View File

@@ -46,7 +46,7 @@ def buscartrailer(item, trailers=[]):
item.contentTitle = item.contentTitle.strip()
elif keyboard:
fulltitle = re.sub('\[\/*(B|I|COLOR)\s*[^\]]*\]', '', item.fulltitle.strip())
item.contentTitle = platformtools.dialog_input(default=fulltitle, heading="Introduce el título a buscar")
item.contentTitle = platformtools.dialog_input(default=fulltitle, heading=config.get_localized_string(70505))
if item.contentTitle is None:
item.contentTitle = fulltitle
else:
@@ -86,21 +86,21 @@ def buscartrailer(item, trailers=[]):
title = "[COLOR green]%s[/COLOR]"
else:
title = "%s"
itemlist.append(item.clone(title=title % "Búsqueda en Youtube", action="youtube_search",
itemlist.append(item.clone(title=title % config.get_localized_string(70507), action="youtube_search",
text_color="green"))
itemlist.append(item.clone(title=title % "Búsqueda en Filmaffinity",
itemlist.append(item.clone(title=title % config.get_localized_string(70024),
action="filmaffinity_search", text_color="green"))
# Si se trata de una serie, no se incluye la opción de buscar en Abandomoviez
if not item.show and not item.infoLabels['tvshowtitle']:
itemlist.append(item.clone(title=title % "Búsqueda en Abandomoviez",
itemlist.append(item.clone(title=title % config.get_localized_string(70508),
action="abandomoviez_search", text_color="green"))
itemlist.append(item.clone(title=title % "Búsqueda en Jayhap (Youtube, Vimeo & Dailymotion)",
itemlist.append(item.clone(title=title % config.get_localized_string(70509),
action="jayhap_search", text_color="green"))
if item.contextual:
global window_select, result
select = Select("DialogSelect.xml", config.get_runtime_path(), item=item, itemlist=itemlist,
caption="Buscando: " + item.contentTitle)
caption=config.get_localized_string(70506) + item.contentTitle)
window_select.append(select)
select.doModal()
@@ -177,11 +177,11 @@ def youtube_search(item):
'Siguiente')
if next_page != "":
next_page = urlparse.urljoin("https://www.youtube.com", next_page)
itemlist.append(item.clone(title=">> Siguiente", action="youtube_search", extra="youtube", page=next_page,
itemlist.append(item.clone(title=config.get_localized_string(70502), action="youtube_search", extra="youtube", page=next_page,
thumbnail="", text_color=""))
if not itemlist:
itemlist.append(item.clone(title="La búsqueda no ha dado resultados (%s)" % titulo,
itemlist.append(item.clone(title=config.get_localized_string(70501) % titulo,
action="", thumbnail="", text_color=""))
if keyboard:
@@ -189,7 +189,7 @@ def youtube_search(item):
title = "[COLOR green]%s[/COLOR]"
else:
title = "%s"
itemlist.append(item.clone(title=title % "Búsqueda Manual en Youtube", action="manual_search",
itemlist.append(item.clone(title=title % config.get_localized_string(70510), action="manual_search",
text_color="green", thumbnail="", extra="youtube"))
return itemlist
@@ -232,11 +232,11 @@ def abandomoviez_search(item):
next_page = scrapertools.find_single_match(data, '<a href="([^"]+)">Siguiente')
if next_page != "":
next_page = urlparse.urljoin("http://www.abandomoviez.net/%s" % item.prefix, next_page)
itemlist.append(item.clone(title=">> Siguiente", action="abandomoviez_search", page=next_page, thumbnail="",
itemlist.append(item.clone(title=config.get_localized_string(70502), action="abandomoviez_search", page=next_page, thumbnail="",
text_color=""))
if not itemlist:
itemlist.append(item.clone(title="La búsqueda no ha dado resultados", action="", thumbnail="",
itemlist.append(item.clone(title=config.get_localized_string(70501), action="", thumbnail="",
text_color=""))
if keyboard:
@@ -244,7 +244,7 @@ def abandomoviez_search(item):
title = "[COLOR green]%s[/COLOR]"
else:
title = "%s"
itemlist.append(item.clone(title=title % "Búsqueda Manual en Abandomoviez",
itemlist.append(item.clone(title=title % config.get_localized_string(70511),
action="manual_search", thumbnail="", text_color="green", extra="abandomoviez"))
return itemlist
@@ -256,13 +256,13 @@ def search_links_abando(item):
data = scrapertools.downloadpage(item.url)
itemlist = []
if "Lo sentimos, no tenemos trailer" in data:
itemlist.append(item.clone(title="No hay ningún vídeo disponible", action="", text_color=""))
itemlist.append(item.clone(title=config.get_localized_string(70503), action="", text_color=""))
else:
if item.contextual:
progreso = platformtools.dialog_progress("Buscando en abandomoviez", "Cargando trailers...")
progreso = platformtools.dialog_progress(config.get_localized_string(70512), config.get_localized_string(70504))
progreso.update(10)
i = 0
message = "Cargando trailers..."
message = config.get_localized_string(70504)
patron = '<div class="col-md-3 col-xs-6"><a href="([^"]+)".*?' \
'Images/(\d+).gif.*?</div><small>(.*?)</small>'
matches = scrapertools.find_multiple_matches(data, patron)
@@ -304,7 +304,7 @@ def search_links_abando(item):
title = "[COLOR green]%s[/COLOR]"
else:
title = "%s"
itemlist.append(item.clone(title=title % "Búsqueda Manual en Abandomoviez",
itemlist.append(item.clone(title=title % config.get_localized_string(70511),
action="manual_search", thumbnail="", text_color="green", extra="abandomoviez"))
return itemlist
@@ -349,11 +349,11 @@ def filmaffinity_search(item):
next_page = scrapertools.find_single_match(data, '<a href="([^"]+)">&gt;&gt;</a>')
if next_page != "":
next_page = urlparse.urljoin("http://www.filmaffinity.com/es/", next_page)
itemlist.append(item.clone(title=">> Siguiente", page=next_page, action="filmaffinity_search", thumbnail="",
itemlist.append(item.clone(title=config.get_localized_string(70502), page=next_page, action="filmaffinity_search", thumbnail="",
text_color=""))
if not itemlist:
itemlist.append(item.clone(title="La búsqueda no ha dado resultados (%s)" % item.contentTitle,
itemlist.append(item.clone(title=config.get_localized_string(70501) % item.contentTitle,
action="", thumbnail="", text_color=""))
if keyboard:
@@ -361,7 +361,7 @@ def filmaffinity_search(item):
title = "[COLOR green]%s[/COLOR]"
else:
title = "%s"
itemlist.append(item.clone(title=title % "Búsqueda Manual en Filmaffinity",
itemlist.append(item.clone(title=title % config.get_localized_string(70513),
action="manual_search", text_color="green", thumbnail="", extra="filmaffinity"))
return itemlist
@@ -373,7 +373,7 @@ def search_links_filmaff(item):
itemlist = []
data = scrapertools.downloadpage(item.url)
if not '<a class="lnkvvid"' in data:
itemlist.append(item.clone(title="No hay ningún vídeo disponible", action="", text_color=""))
itemlist.append(item.clone(title=config.get_localized_string(70503), action="", text_color=""))
else:
patron = '<a class="lnkvvid".*?<b>(.*?)</b>.*?iframe.*?src="([^"]+)"'
matches = scrapertools.find_multiple_matches(data, patron)
@@ -402,7 +402,7 @@ def search_links_filmaff(item):
title = "[COLOR green]%s[/COLOR]"
else:
title = "%s"
itemlist.append(item.clone(title=title % "Búsqueda Manual en Filmaffinity",
itemlist.append(item.clone(title=title % config.get_localized_string(70513),
action="manual_search", thumbnail="", text_color="green", extra="filmaffinity"))
return itemlist
@@ -437,14 +437,14 @@ def jayhap_search(item):
text_color="white"))
if not itemlist:
itemlist.append(item.clone(title="La búsqueda no ha dado resultados (%s)" % item.contentTitle,
itemlist.append(item.clone(title=config.get_localized_string(70501) % item.contentTitle,
action="", thumbnail="", text_color=""))
else:
tokens = data['tokens']
tokens['yt_token'] = tokens.pop('youtube')
tokens['vm_token'] = tokens.pop('vimeo')
tokens['dm_token'] = tokens.pop('dailymotion')
itemlist.append(item.clone(title=">> Siguiente", page=tokens, action="jayhap_search", extra="jayhap",
itemlist.append(item.clone(title=config.get_localized_string(70502), page=tokens, action="jayhap_search", extra="jayhap",
thumbnail="", text_color=""))
if keyboard:
@@ -452,7 +452,7 @@ def jayhap_search(item):
title = "[COLOR green]%s[/COLOR]"
else:
title = "%s"
itemlist.append(item.clone(title=title % "Búsqueda Manual en Jayhap", action="manual_search",
itemlist.append(item.clone(title=title % config.get_localized_string(70514), action="manual_search",
text_color="green", thumbnail="", extra="jayhap"))
return itemlist
@@ -485,7 +485,7 @@ try:
except:
pass
self.getControl(1).setLabel("[COLOR orange]" + self.caption + "[/COLOR]")
self.getControl(5).setLabel("[COLOR tomato][B]Cerrar[/B][/COLOR]")
self.getControl(5).setLabel(config.get_localized_string(60495))
self.items = []
for item in self.itemlist:
item_l = xbmcgui.ListItem(item.title)

View File

@@ -12,11 +12,10 @@ import re
import time
import urllib
from base64 import b64decode
from platformcode import logger
import xbmc
from core import httptools
from platformcode import config
def find_in_text(regex, text, flags=re.IGNORECASE | re.DOTALL):
@@ -28,24 +27,30 @@ def find_in_text(regex, text, flags=re.IGNORECASE | re.DOTALL):
class UnshortenIt(object):
_adfly_regex = r'adf\.ly|q\.gs|j\.gs|u\.bb|ay\.gy|threadsphere\.bid|restorecosm\.bid|clearload\.bid'
_adfly_regex = r'adf\.ly|j\.gs|q\.gs|u\.bb|ay\.gy|atominik\.com|tinyium\.com|microify\.com|threadsphere\.bid|clearload\.bid'
_linkbucks_regex = r'linkbucks\.com|any\.gs|cash4links\.co|cash4files\.co|dyo\.gs|filesonthe\.net|goneviral\.com|megaline\.co|miniurls\.co|qqc\.co|seriousdeals\.net|theseblogs\.com|theseforums\.com|tinylinks\.co|tubeviral\.com|ultrafiles\.net|urlbeat\.net|whackyvidz\.com|yyv\.co'
_adfocus_regex = r'adfoc\.us'
_lnxlu_regex = r'lnx\.lu'
_shst_regex = r'sh\.st|gestyy\.com'
_shst_regex = r'sh\.st|festyy\.com|ceesty\.com'
_hrefli_regex = r'href\.li'
_anonymz_regex = r'anonymz\.com'
_shrink_service_regex = r'shrink-service\.it'
_rapidcrypt_regex = r'rapidcrypt\.net'
_maxretries = 5
_this_dir, _this_filename = os.path.split(__file__)
_timeout = 10
def unshorten(self, uri, type=None):
domain = urlsplit(uri).netloc
if not domain:
return uri, "No domain found in URI!"
had_google_outbound, uri = self._clear_google_outbound_proxy(uri)
if re.search(self._adfly_regex, domain,
re.IGNORECASE) or type == 'adfly':
return self._unshorten_adfly(uri)
@@ -68,15 +73,15 @@ class UnshortenIt(object):
return self._unshorten_anonymz(uri)
if re.search(self._rapidcrypt_regex, domain, re.IGNORECASE):
return self._unshorten_rapidcrypt(uri)
return uri, 200
def unwrap_30x(self, uri, timeout=10):
domain = urlsplit(uri).netloc
self._timeout = timeout
loop_counter = 0
try:
if loop_counter > 5:
raise ValueError("Infinitely looping redirect from URL: '%s'" %
(uri,))
# headers stop t.co from working so omit headers if this is a t.co link
if domain == 't.co':
r = httptools.downloadpage(uri, timeout=self._timeout)
@@ -86,29 +91,28 @@ class UnshortenIt(object):
r = httptools.downloadpage(uri, timeout=self._timeout)
uri = re.findall(r'.*url\=(.*?)\"\.*', r.data)[0]
return uri, r.code
else:
while True:
retries = 0
while True:
r = httptools.downloadpage(
uri,
timeout=self._timeout,
follow_redirects=False)
if not r.sucess:
return uri, -1
if 'location' in r.headers and retries < self._maxretries:
r = httptools.downloadpage(
uri,
timeout=self._timeout,
follow_redirects=False,
only_headers=True)
if not r.success:
return uri, -1
retries = 0
if 'location' in r.headers and retries < self._maxretries:
r = httptools.downloadpage(
r.headers['location'],
follow_redirects=False,
only_headers=True)
uri = r.url
loop_counter += 1
retries = retries + 1
else:
return r.url, r.code
r.headers['location'],
follow_redirects=False)
uri = r.url
retries += 1
else:
return r.url, r.code
except Exception as e:
return uri, str(e)
def _clear_google_outbound_proxy(self, url):
'''
So google proxies all their outbound links through a redirect so they can detect outbound links.
@@ -117,13 +121,16 @@ class UnshortenIt(object):
This is useful for doing things like parsing google search results, or if you're scraping google
docs, where google inserts hit-counters on all outbound links.
'''
# This is kind of hacky, because we need to check both the netloc AND
# part of the path. We could use urllib.parse.urlsplit, but it's
# easier and just as effective to use string checks.
if url.startswith("http://www.google.com/url?") or \
url.startswith("https://www.google.com/url?"):
qs = urlparse(url).query
query = parse_qs(qs)
if "q" in query: # Google doc outbound links (maybe blogspot, too)
return True, query["q"].pop()
elif "url" in query: # Outbound links from google searches
@@ -132,10 +139,11 @@ class UnshortenIt(object):
raise ValueError(
"Google outbound proxy URL without a target url ('%s')?" %
url)
return False, url
def _unshorten_adfly(self, uri):
logger.info()
try:
r = httptools.downloadpage(
uri, timeout=self._timeout, cookies=False)
@@ -144,11 +152,14 @@ class UnshortenIt(object):
if len(ysmm) > 0:
ysmm = re.sub(r'var ysmm \= \'|\'\;', '', ysmm[0])
left = ''
right = ''
for c in [ysmm[i:i + 2] for i in range(0, len(ysmm), 2)]:
left += c[0]
right = c[1] + right
# Additional digit arithmetic
encoded_uri = list(left + right)
numbers = ((i, n) for i, n in enumerate(encoded_uri) if str.isdigit(n))
@@ -156,9 +167,12 @@ class UnshortenIt(object):
xor = int(first[1]) ^ int(second[1])
if xor < 10:
encoded_uri[first[0]] = str(xor)
decoded_uri = b64decode("".join(encoded_uri).encode())[16:-16].decode()
if re.search(r'go\.php\?u\=', decoded_uri):
decoded_uri = b64decode(re.sub(r'(.*?)u=', '', decoded_uri)).decode()
return decoded_uri, r.code
else:
return uri, 'No ysmm variable found'
@@ -170,15 +184,25 @@ class UnshortenIt(object):
'''
(Attempt) to decode linkbucks content. HEAVILY based on the OSS jDownloader codebase.
This has necessidated a license change.
'''
if config.is_xbmc():
import xbmc
r = httptools.downloadpage(uri, timeout=self._timeout)
firstGet = time.time()
baseloc = r.url
if "/notfound/" in r.url or \
"(>Link Not Found<|>The link may have been deleted by the owner|To access the content, you must complete a quick survey\.)" in r.data:
return uri, 'Error: Link not found or requires a survey!'
link = None
content = r.data
regexes = [
r"<div id=\"lb_header\">.*?/a>.*?<a.*?href=\"(.*?)\".*?class=\"lb",
r"AdBriteInit\(\"(.*?)\"\)",
@@ -187,49 +211,69 @@ class UnshortenIt(object):
r"src=\"http://static\.linkbucks\.com/tmpl/mint/img/lb\.gif\" /></a>.*?<a href=\"(.*?)\"",
r"id=\"content\" src=\"([^\"]*)",
]
for regex in regexes:
if self.inValidate(link):
link = find_in_text(regex, content)
if self.inValidate(link):
match = find_in_text(r"noresize=\"[0-9+]\" src=\"(http.*?)\"", content)
if match:
link = find_in_text(r"\"frame2\" frameborder.*?src=\"(.*?)\"", content)
if self.inValidate(link):
scripts = re.findall("(<script type=\"text/javascript\">[^<]+</script>)", content)
if not scripts:
return uri, "No script bodies found?"
js = False
for script in scripts:
# cleanup
script = re.sub(r"[\r\n\s]+\/\/\s*[^\r\n]+", "", script)
if re.search(r"\s*var\s*f\s*=\s*window\['init'\s*\+\s*'Lb'\s*\+\s*'js'\s*\+\s*''\];[\r\n\s]+", script):
js = script
if not js:
return uri, "Could not find correct script?"
token = find_in_text(r"Token\s*:\s*'([a-f0-9]{40})'", js)
if not token:
token = find_in_text(r"\?t=([a-f0-9]{40})", js)
assert token
authKeyMatchStr = r"A(?:'\s*\+\s*')?u(?:'\s*\+\s*')?t(?:'\s*\+\s*')?h(?:'\s*\+\s*')?K(?:'\s*\+\s*')?e(?:'\s*\+\s*')?y"
l1 = find_in_text(r"\s*params\['" + authKeyMatchStr + r"'\]\s*=\s*(\d+?);", js)
l2 = find_in_text(
r"\s*params\['" + authKeyMatchStr + r"'\]\s*=\s?params\['" + authKeyMatchStr + r"'\]\s*\+\s*(\d+?);",
js)
if any([not l1, not l2, not token]):
return uri, "Missing required tokens?"
authkey = int(l1) + int(l2)
p1_url = urljoin(baseloc, "/director/?t={tok}".format(tok=token))
r2 = httptools.downloadpage(p1_url, timeout=self._timeout)
p1_url = urljoin(baseloc, "/scripts/jquery.js?r={tok}&{key}".format(tok=token, key=l1))
r2_1 = httptools.downloadpage(p1_url, timeout=self._timeout)
r2 = httptools.downloadpage(p1_url, timeout=self._timeout)
time_left = 5.033 - (time.time() - firstGet)
xbmc.sleep(max(time_left, 0) * 1000)
if config.is_xbmc():
xbmc.sleep(max(time_left, 0) * 1000)
else:
time.sleep(5 * 1000)
p3_url = urljoin(baseloc, "/intermission/loadTargetUrl?t={tok}&aK={key}&a_b=false".format(tok=token,
key=str(authkey)))
r3 = httptools.downloadpage(p3_url, timeout=self._timeout)
resp_json = json.loads(r3.data)
if "Url" in resp_json:
return resp_json['Url'], r3.code
return "Wat", "wat"
def inValidate(self, s):
@@ -237,23 +281,30 @@ class UnshortenIt(object):
# (s == null || s != null && (s.matches("[\r\n\t ]+") || s.equals("") || s.equalsIgnoreCase("about:blank")))
if not s:
return True
if re.search("[\r\n\t ]+", s) or s.lower() == "about:blank":
return True
else:
return False
def _unshorten_adfocus(self, uri):
orig_uri = uri
try:
r = httptools.downloadpage(uri, timeout=self._timeout)
html = r.data
adlink = re.findall("click_url =.*;", html)
if len(adlink) > 0:
uri = re.sub('^click_url = "|"\;$', '', adlink[0])
if re.search(r'http(s|)\://adfoc\.us/serve/skip/\?id\=', uri):
http_header = dict()
http_header["Host"] = "adfoc.us"
http_header["Referer"] = orig_uri
r = httptools.downloadpage(uri, headers=http_header, timeout=self._timeout)
uri = r.url
return uri, r.code
else:
@@ -283,16 +334,23 @@ class UnshortenIt(object):
try:
r = httptools.downloadpage(uri, timeout=self._timeout)
html = r.data
session_id = re.findall(r'sessionId\:(.*?)\"\,', html)
if len(session_id) > 0:
session_id = re.sub(r'\s\"', '', session_id[0])
http_header = dict()
http_header["Content-Type"] = "application/x-www-form-urlencoded"
http_header["Host"] = "sh.st"
http_header["Referer"] = uri
http_header["Origin"] = "http://sh.st"
http_header["X-Requested-With"] = "XMLHttpRequest"
xbmc.sleep(5 * 1000)
if config.is_xbmc():
xbmc.sleep(5 * 1000)
else:
time.sleep(5 * 1000)
payload = {'adSessionId': session_id, 'callback': 'c'}
r = httptools.downloadpage(
'http://sh.st/shortest-url/end-adsession?' +
@@ -300,6 +358,7 @@ class UnshortenIt(object):
headers=http_header,
timeout=self._timeout)
response = r.data[6:-2].decode('utf-8')
if r.code == 200:
resp_uri = json.loads(response)['destinationUrl']
if resp_uri is not None:
@@ -325,8 +384,7 @@ class UnshortenIt(object):
r = httptools.downloadpage(
extracted_uri,
timeout=self._timeout,
follow_redirects=False,
only_headers=True)
follow_redirects=False)
return r.url, r.code
except Exception as e:
return uri, str(e)
@@ -339,9 +397,12 @@ class UnshortenIt(object):
try:
r = httptools.downloadpage(uri, timeout=self._timeout, cookies=False)
html = r.data
uri = re.findall(r"<input type='hidden' name='\d+' id='\d+' value='([^']+)'>", html)[0]
from core import scrapertools
uri = scrapertools.decodeHtmlentities(uri)
uri = uri.replace("&sol;", "/") \
.replace("&colon;", ":") \
.replace("&period;", ".") \
@@ -349,6 +410,7 @@ class UnshortenIt(object):
.replace("&num;", "#") \
.replace("&quest;", "?") \
.replace("&lowbar;", "_")
return uri, r.code
except Exception as e:
@@ -358,7 +420,9 @@ class UnshortenIt(object):
try:
r = httptools.downloadpage(uri, timeout=self._timeout, cookies=False)
html = r.data
uri = re.findall(r'<a class="button" href="([^"]+)">Click to continue</a>', html)[0]
uri = re.findall(r'<a class="push_button blue" href=([^>]+)>', html)[0]
return uri, r.code
except Exception as e:
@@ -379,6 +443,7 @@ def unshorten_only(uri, type=None, timeout=10):
def unshorten(uri, type=None, timeout=10):
unshortener = UnshortenIt()
uri, status = unshortener.unwrap_30x(uri, timeout=timeout)
uri, status = unshortener.unshorten(uri, type=type)
if status == 200:
uri, status = unshortener.unwrap_30x(uri, timeout=timeout)

View File

@@ -4699,3 +4699,71 @@ msgctxt "#70499"
msgid "Genre: "
msgstr ""
msgctxt "#70500"
msgid "Notification([COLOR red][B]Update Kodi to its latest version[/B][/COLOR], [COLOR skyblue]for best info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgstr ""
msgctxt "#70501"
msgid "Search did not match (%s)"
msgstr ""
msgctxt "#70502"
msgid ">> Next"
msgstr ""
msgctxt "#70503"
msgid "There is no available video"
msgstr ""
msgctxt "#70504"
msgid "Loading trailers..."
msgstr ""
msgctxt "#70505"
msgid "Enter the title to search"
msgstr ""
msgctxt "#70506"
msgid "Searching: "
msgstr ""
msgctxt "#70507"
msgid "Search in Youtube"
msgstr ""
msgctxt "#70508"
msgid "Search in Abandomoviez"
msgstr ""
msgctxt "#70509"
msgid "Search in Jayhap (Youtube, Vimeo & Dailymotion)"
msgstr ""
msgctxt "#70510"
msgid "Manual Search in Youtube"
msgstr ""
msgctxt "#70511"
msgid "Manual Search in Abandomoviez"
msgstr ""
msgctxt "#70512"
msgid "Searching in abandomoviez"
msgstr ""
msgctxt "#70513"
msgid "Manual Searching in Filmaffinity"
msgstr ""
msgctxt "#70514"
msgid "Manual Search in Jayhap"
msgstr ""
msgctxt "#70515"
msgid "[COLOR aquamarine][B]Completed %s[/B][/COLOR]"
msgstr ""
msgctxt "#70516"
msgid "[COLOR aquamarine][B]In progress %s[/B][/COLOR]"
msgstr ""

View File

@@ -4684,6 +4684,74 @@ msgid "Producer: "
msgstr "Produzione: "
msgctxt "#70499"
msgid "Genere: "
msgstr "Género: "
msgid "Genre: "
msgstr "Genere: "
msgctxt "#70500"
msgid "Notification([COLOR red][B]Update Kodi to its latest version[/B][/COLOR], [COLOR skyblue]for best info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgstr "Notifica([COLOR red][B]Aggiorna Kodi alla sua ultima versione[/B][/COLOR], [COLOR skyblue]per migliori info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgctxt "#70501"
msgid "Search did not match (%s)"
msgstr "La ricerca non ha dato risultati (%s)"
msgctxt "#70502"
msgid ">> Next"
msgstr ">> Successivo"
msgctxt "#70503"
msgid "There is no available video"
msgstr "Nessun video disponibile"
msgctxt "#70504"
msgid "Loading trailers..."
msgstr "Caricamento trailers..."
msgctxt "#70505"
msgid "Enter the title to search"
msgstr "Inserisci il titolo da cercare"
msgctxt "#70506"
msgid "Searching: "
msgstr "Ricerca: "
msgctxt "#70507"
msgid "Search in Youtube"
msgstr "Ricerca in Youtube"
msgctxt "#70508"
msgid "Search in Abandomoviez"
msgstr "Ricerca inAbandomoviez"
msgctxt "#70509"
msgid "Search in Jayhap (Youtube, Vimeo & Dailymotion)"
msgstr "Ricerca in Jayhap (Youtube, Vimeo & Dailymotion)"
msgctxt "#70510"
msgid "Manual Search in Youtube"
msgstr "Ricerca Manuale in Youtube"
msgctxt "#70511"
msgid "Manual Search in Abandomoviez"
msgstr "Ricerca Manuale in Abandomoviez"
msgctxt "#70512"
msgid "Searching in abandomoviez"
msgstr "Ricerca in abandomoviez"
msgctxt "#70513"
msgid "Manual Searching in Filmaffinity"
msgstr "Ricerca Manuale in Filmaffinity"
msgctxt "#70514"
msgid "Manual Search in Jayhap"
msgstr "Ricerca Manuale in Jayhap"
msgctxt "#70515"
msgid "[COLOR aquamarine][B]Completed %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]Completata %s[/B][/COLOR]"
msgctxt "#70516"
msgid "[COLOR aquamarine][B]In progress %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]In Corso %s[/B][/COLOR]"

View File

@@ -4687,3 +4687,71 @@ msgctxt "#70499"
msgid "Genre: "
msgstr "Género: "
msgctxt "#70500"
msgid "Notification([COLOR red][B]Update Kodi to its latest version[/B][/COLOR], [COLOR skyblue]for best info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgstr "Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgctxt "#70501"
msgid "Search did not match (%s)"
msgstr "La búsqueda no ha dado resultados (%s)"
msgctxt "#70502"
msgid ">> Next"
msgstr ">> Siguiente"
msgctxt "#70503"
msgid "There is no available video"
msgstr "No hay ningún vídeo disponible"
msgctxt "#70504"
msgid "Loading trailers..."
msgstr "Cargando trailers..."
msgctxt "#70505"
msgid "Enter the title to search"
msgstr "Introduce el título a buscar"
msgctxt "#70506"
msgid "Searching: "
msgstr "Buscando: "
msgctxt "#70507"
msgid "Search in Youtube"
msgstr "Búsqueda en Youtube"
msgctxt "#70508"
msgid "Search in Abandomoviez"
msgstr "Búsqueda en Abandomoviez"
msgctxt "#70509"
msgid "Search in Jayhap (Youtube, Vimeo & Dailymotion)"
msgstr "Búsqueda en Jayhap (Youtube, Vimeo & Dailymotion)"
msgctxt "#70510"
msgid "Manual Search in Youtube"
msgstr "Búsqueda Manual en Youtube"
msgctxt "#70511"
msgid "Manual Search in Abandomoviez"
msgstr "Búsqueda Manual en Abandomoviez"
msgctxt "#70512"
msgid "Searching in abandomoviez"
msgstr "Buscando en abandomoviez"
msgctxt "#70513"
msgid "Manual Searching in Filmaffinity"
msgstr "Búsqueda Manual en Filmaffinity"
msgctxt "#70514"
msgid "Manual Search in Jayhap"
msgstr "Búsqueda Manual en Jayhap"
msgctxt "#70515"
msgid "[COLOR aquamarine][B]Completed %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]Finalizada %s[/B][/COLOR]"
msgctxt "#70516"
msgid "[COLOR aquamarine][B]In progress %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]En emisión %s[/B][/COLOR]"

View File

@@ -4687,3 +4687,71 @@ msgctxt "#70499"
msgid "Genre: "
msgstr "Género: "
msgctxt "#70500"
msgid "Notification([COLOR red][B]Update Kodi to its latest version[/B][/COLOR], [COLOR skyblue]for best info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgstr "Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgctxt "#70501"
msgid "Search did not match (%s)"
msgstr "La búsqueda no ha dado resultados (%s)"
msgctxt "#70502"
msgid ">> Next"
msgstr ">> Siguiente"
msgctxt "#70503"
msgid "There is no available video"
msgstr "No hay ningún vídeo disponible"
msgctxt "#70504"
msgid "Loading trailers..."
msgstr "Cargando trailers..."
msgctxt "#70505"
msgid "Enter the title to search"
msgstr "Introduce el título a buscar"
msgctxt "#70506"
msgid "Searching: "
msgstr "Buscando: "
msgctxt "#70507"
msgid "Search in Youtube"
msgstr "Búsqueda en Youtube"
msgctxt "#70508"
msgid "Search in Abandomoviez"
msgstr "Búsqueda en Abandomoviez"
msgctxt "#70509"
msgid "Search in Jayhap (Youtube, Vimeo & Dailymotion)"
msgstr "Búsqueda en Jayhap (Youtube, Vimeo & Dailymotion)"
msgctxt "#70510"
msgid "Manual Search in Youtube"
msgstr "Búsqueda Manual en Youtube"
msgctxt "#70511"
msgid "Manual Search in Abandomoviez"
msgstr "Búsqueda Manual en Abandomoviez"
msgctxt "#70512"
msgid "Searching in abandomoviez"
msgstr "Buscando en abandomoviez"
msgctxt "#70513"
msgid "Manual Searching in Filmaffinity"
msgstr "Búsqueda Manual en Filmaffinity"
msgctxt "#70514"
msgid "Manual Search in Jayhap"
msgstr "Búsqueda Manual en Jayhap"
msgctxt "#70515"
msgid "[COLOR aquamarine][B]Completed %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]Finalizada %s[/B][/COLOR]"
msgctxt "#70516"
msgid "[COLOR aquamarine][B]In progress %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]En emisión %s[/B][/COLOR]"

View File

@@ -4687,3 +4687,71 @@ msgctxt "#70499"
msgid "Genre: "
msgstr "Género: "
msgctxt "#70500"
msgid "Notification([COLOR red][B]Update Kodi to its latest version[/B][/COLOR], [COLOR skyblue]for best info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgstr "Notification([COLOR red][B]Actualiza Kodi a su última versión[/B][/COLOR], [COLOR skyblue]para mejor info[/COLOR],8000, "http://i.imgur.com/mHgwcn3.png")"
msgctxt "#70501"
msgid "Search did not match (%s)"
msgstr "La búsqueda no ha dado resultados (%s)"
msgctxt "#70502"
msgid ">> Next"
msgstr ">> Siguiente"
msgctxt "#70503"
msgid "There is no available video"
msgstr "No hay ningún vídeo disponible"
msgctxt "#70504"
msgid "Loading trailers..."
msgstr "Cargando trailers..."
msgctxt "#70505"
msgid "Enter the title to search"
msgstr "Introduce el título a buscar"
msgctxt "#70506"
msgid "Searching: "
msgstr "Buscando: "
msgctxt "#70507"
msgid "Search in Youtube"
msgstr "Búsqueda en Youtube"
msgctxt "#70508"
msgid "Search in Abandomoviez"
msgstr "Búsqueda en Abandomoviez"
msgctxt "#70509"
msgid "Search in Jayhap (Youtube, Vimeo & Dailymotion)"
msgstr "Búsqueda en Jayhap (Youtube, Vimeo & Dailymotion)"
msgctxt "#70510"
msgid "Manual Search in Youtube"
msgstr "Búsqueda Manual en Youtube"
msgctxt "#70511"
msgid "Manual Search in Abandomoviez"
msgstr "Búsqueda Manual en Abandomoviez"
msgctxt "#70512"
msgid "Searching in abandomoviez"
msgstr "Buscando en abandomoviez"
msgctxt "#70513"
msgid "Manual Searching in Filmaffinity"
msgstr "Búsqueda Manual en Filmaffinity"
msgctxt "#70514"
msgid "Manual Search in Jayhap"
msgstr "Búsqueda Manual en Jayhap"
msgctxt "#70515"
msgid "[COLOR aquamarine][B]Completed %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]Finalizada %s[/B][/COLOR]"
msgctxt "#70516"
msgid "[COLOR aquamarine][B]In progress %s[/B][/COLOR]"
msgstr "[COLOR aquamarine][B]En emisión %s[/B][/COLOR]"