KoD 0.7.2

- - aggiunto raiplay
- agigunto d.s.d.a (ex documentaristreamingda)
- svariati fix ai canali (eurostreaming, streamtime, piratestreaming, altadefinizioneclick)
- la videoteca ora può essere messa nelle unità di rete
- aggiunto server upstream
- altri piccoli fix vari
This commit is contained in:
marco
2020-02-04 18:24:33 +01:00
parent be85578100
commit 23e9ac3875
33 changed files with 681 additions and 552 deletions
+58 -6
View File
@@ -26,7 +26,7 @@ def find_in_text(regex, text, flags=re.IGNORECASE | re.DOTALL):
class UnshortenIt(object):
_adfly_regex = r'adf\.ly|j\.gs|q\.gs|u\.bb|ay\.gy|atominik\.com|tinyium\.com|microify\.com|threadsphere\.bid|clearload\.bid|activetect\.net|swiftviz\.net|briskgram\.net|activetect\.net|baymaleti\.net|thouth\.net|uclaut\.net|gloyah\.net|larati\.net'
_adfly_regex = r'adf\.ly|j\.gs|q\.gs|u\.bb|ay\.gy|atominik\.com|tinyium\.com|microify\.com|threadsphere\.bid|clearload\.bid|activetect\.net|swiftviz\.net|briskgram\.net|activetect\.net|baymaleti\.net|thouth\.net|uclaut\.net|gloyah\.net|larati\.net|scuseami\.net'
_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'
@@ -36,9 +36,12 @@ class UnshortenIt(object):
_shrink_service_regex = r'shrink-service\.it'
_rapidcrypt_regex = r'rapidcrypt\.net'
_cryptmango_regex = r'cryptmango|xshield\.net'
_vcrypt_regex = r'vcrypt\.net'
_vcrypt_regex = r'vcrypt\.net|vcrypt\.pw'
_linkup_regex = r'linkup\.pro|buckler.link'
listRegex = [_adfly_regex, _linkbucks_regex, _adfocus_regex, _lnxlu_regex, _shst_regex, _hrefli_regex, _anonymz_regex,
_shrink_service_regex, _rapidcrypt_regex, _cryptmango_regex, _vcrypt_regex, _linkup_regex]
_maxretries = 5
_this_dir, _this_filename = os.path.split(__file__)
@@ -473,14 +476,16 @@ class UnshortenIt(object):
def _unshorten_vcrypt(self, uri):
try:
if 'myfoldersakstream.php' in uri or '/verys/' in uri:
return uri, 0
r = None
import base64, pyaes
import pyaes
def decrypt(str):
str = str.replace("_ppl_", "+").replace("_eqq_", "=").replace("_sll_", "/")
iv = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
key = "naphajU2usWUswec"
decoded = base64.b64decode(str)
decoded = b64decode(str)
decoded = decoded + '\0' * (len(decoded) % 16)
crypt_object = pyaes.AESModeOfOperationCBC(key, iv)
decrypted = ''
@@ -521,8 +526,31 @@ class UnshortenIt(object):
def _unshorten_linkup(self, uri):
try:
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
return r.url, r.code
r = None
if '/tv/' in uri:
uri = uri.replace('/tv/', '/tva/')
elif 'delta' in uri:
uri = uri.replace('/delta/', '/adelta/')
elif '/ga/' in uri:
uri = b64decode(uri.split('/')[-1]).strip()
elif '/speedx/' in uri:
uri = uri.replace('http://linkup.pro/speedx', 'http://speedvideo.net')
else:
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
uri = r.url
link = re.findall("<iframe[^<>]*src=\\'([^'>]*)\\'[^<>]*>", r.data)
# fix by greko inizio
if not link:
link = re.findall('action="(?:[^/]+.*?/[^/]+/([a-zA-Z0-9_]+))">', r.data)
if link:
uri = link
short = re.findall('^https?://.*?(https?://.*)', uri)
if short:
uri = short[0]
if not r:
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
uri = r.url
return uri, r.code
except Exception as e:
return uri, str(e)
@@ -546,3 +574,27 @@ def unshorten(uri, type=None, timeout=10):
if status == 200:
uri, status = unshortener.unwrap_30x(uri, timeout=timeout)
return uri, status
def findlinks(text):
unshortener = UnshortenIt()
matches = []
for regex in unshortener.listRegex:
regex = '(?:https?://(?:[\w\d]+\.)?)?(?:' + regex + ')/[a-zA-Z0-9_=/]+'
for match in re.findall(regex, text):
matches.append(match)
if len(matches) == 1:
text += '\n' + unshorten(matches[0])[0]
elif matches:
# non threaded for webpdb
# for match in matches:
# sh = unshorten(match)[0]
# text += '\n' + sh
from concurrent import futures
with futures.ThreadPoolExecutor() as executor:
unshList = [executor.submit(unshorten, match) for match in matches]
for link in futures.as_completed(unshList):
if link.result()[0] not in matches:
text += '\n' + link.result()[0]
return text