- completato il supporto al futuro Kodi 19\n- ridisegnato infoplus\n- fix vari ed eventuali\n
This commit is contained in:
marco
2020-09-29 21:08:25 +02:00
parent d153ac5918
commit 8a8d1e4f5e
195 changed files with 20697 additions and 23038 deletions
+18 -20
View File
@@ -1,16 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from urllib.parse import urlsplit, urlparse, parse_qs, urljoin
except:
import os, re, sys, json, time
if sys.version_info[0] >= 3:
PY3 = True
from urllib.parse import urlsplit, urlparse, parse_qs, urljoin, urlencode
from urllib.request import urlopen
else:
PY3 = False
from urllib import urlencode, urlopen
from urlparse import urlsplit, urlparse, parse_qs, urljoin
import json
import os
import re
import time
import urllib
from base64 import b64decode
from core import httptools, scrapertools
@@ -61,17 +62,13 @@ class UnshortenIt(object):
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':
if re.search(self._adfly_regex, domain, re.IGNORECASE) or type == 'adfly':
uri, code = self._unshorten_adfly(uri)
if re.search(self._adfocus_regex, domain,
re.IGNORECASE) or type == 'adfocus':
if re.search(self._adfocus_regex, domain, re.IGNORECASE) or type == 'adfocus':
uri, code = self._unshorten_adfocus(uri)
if re.search(self._linkbucks_regex, domain,
re.IGNORECASE) or type == 'linkbucks':
if re.search(self._linkbucks_regex, domain, re.IGNORECASE) or type == 'linkbucks':
uri, code = self._unshorten_linkbucks(uri)
if re.search(self._lnxlu_regex, domain,
re.IGNORECASE) or type == 'lnxlu':
if re.search(self._lnxlu_regex, domain, re.IGNORECASE) or type == 'lnxlu':
uri, code = self._unshorten_lnxlu(uri)
if re.search(self._shrink_service_regex, domain, re.IGNORECASE):
uri, code = self._unshorten_shrink_service(uri)
@@ -368,7 +365,7 @@ class UnshortenIt(object):
if len(code) > 0:
payload = {'click': code[0]}
r = httptools.downloadpage(
'http://lnx.lu?' + urllib.urlencode(payload),
'http://lnx.lu?' + urlencode(payload),
timeout=self._timeout)
return r.url, r.code
else:
@@ -400,7 +397,7 @@ class UnshortenIt(object):
payload = {'adSessionId': session_id, 'callback': 'c'}
r = httptools.downloadpage(
'http://sh.st/shortest-url/end-adsession?' +
urllib.urlencode(payload),
urlencode(payload),
headers=http_header,
timeout=self._timeout)
response = r.data[6:-2].decode('utf-8')
@@ -520,8 +517,9 @@ class UnshortenIt(object):
if 'sb/' in uri or 'akv/' in uri or 'wss/' in uri or 'wsd/' in uri:
import datetime, hashlib
from base64 import b64encode
ip = urllib.urlopen('https://api.ipify.org/').read()
ip = urlopen('https://api.ipify.org/').read()
day = datetime.date.today().strftime('%Y%m%d')
if PY3: day = day.encode()
headers = {
"Cookie": hashlib.md5(ip+day).hexdigest() + "=1"
}
@@ -643,7 +641,7 @@ class UnshortenIt(object):
try:
id = uri.split('/')[-2]
reqUrl = 'https://stayonline.pro/ajax/linkView.php'
p = urllib.urlencode({"id": id})
p = urlencode({"id": id})
r = httptools.downloadpage(reqUrl, post=p)
data = r.data
try: