migliorato unshortenit e fix akvideo
This commit is contained in:
+23
-23
@@ -488,7 +488,7 @@ class UnshortenIt(object):
|
|||||||
|
|
||||||
|
|
||||||
def _unshorten_vcrypt(self, uri):
|
def _unshorten_vcrypt(self, uri):
|
||||||
uri = uri.replace('.net','.pw')
|
uri = uri.replace('.net', '.pw')
|
||||||
try:
|
try:
|
||||||
headers = {}
|
headers = {}
|
||||||
if 'myfoldersakstream.php' in uri or '/verys/' in uri:
|
if 'myfoldersakstream.php' in uri or '/verys/' in uri:
|
||||||
@@ -564,7 +564,7 @@ class UnshortenIt(object):
|
|||||||
elif '/speedx/' in uri:
|
elif '/speedx/' in uri:
|
||||||
uri = uri.replace('http://linkup.pro/speedx', 'http://speedvideo.net')
|
uri = uri.replace('http://linkup.pro/speedx', 'http://speedvideo.net')
|
||||||
else:
|
else:
|
||||||
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
|
r = httptools.downloadpage(uri, follow_redirects=True, timeout=self._timeout, cookies=False)
|
||||||
uri = r.url
|
uri = r.url
|
||||||
link = re.findall("<iframe[^<>]*src=\\'([^'>]*)\\'[^<>]*>", r.data)
|
link = re.findall("<iframe[^<>]*src=\\'([^'>]*)\\'[^<>]*>", r.data)
|
||||||
# fix by greko inizio
|
# fix by greko inizio
|
||||||
@@ -576,8 +576,8 @@ class UnshortenIt(object):
|
|||||||
if short:
|
if short:
|
||||||
uri = short[0]
|
uri = short[0]
|
||||||
if not r:
|
if not r:
|
||||||
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
|
r = httptools.downloadpage(uri, follow_redirects=False, timeout=self._timeout, cookies=False)
|
||||||
uri = r.url
|
uri = r.headers['location']
|
||||||
if "4snip" in uri:
|
if "4snip" in uri:
|
||||||
if 'out_generator' in uri:
|
if 'out_generator' in uri:
|
||||||
uri = re.findall('url=(.*)$', uri)[0]
|
uri = re.findall('url=(.*)$', uri)[0]
|
||||||
@@ -668,7 +668,7 @@ def unshorten_only(uri, type=None, timeout=10):
|
|||||||
|
|
||||||
def unshorten(uri, type=None, timeout=10):
|
def unshorten(uri, type=None, timeout=10):
|
||||||
unshortener = UnshortenIt()
|
unshortener = UnshortenIt()
|
||||||
uri, status = unshortener.unwrap_30x(uri, timeout=timeout)
|
# uri, status = unshortener.unwrap_30x(uri, timeout=timeout)
|
||||||
uri, status = unshortener.unshorten(uri, type=type)
|
uri, status = unshortener.unshorten(uri, type=type)
|
||||||
if status == 200:
|
if status == 200:
|
||||||
uri, status = unshortener.unwrap_30x(uri, timeout=timeout)
|
uri, status = unshortener.unwrap_30x(uri, timeout=timeout)
|
||||||
@@ -688,22 +688,22 @@ def findlinks(text):
|
|||||||
text += '\n' + unshorten(matches[0])[0]
|
text += '\n' + unshorten(matches[0])[0]
|
||||||
elif matches:
|
elif matches:
|
||||||
# non threaded for webpdb
|
# non threaded for webpdb
|
||||||
# for match in matches:
|
for match in matches:
|
||||||
# sh = unshorten(match)[0]
|
sh = unshorten(match)[0]
|
||||||
# text += '\n' + sh
|
text += '\n' + sh
|
||||||
import sys
|
# import sys
|
||||||
if sys.version_info[0] >= 3:
|
# if sys.version_info[0] >= 3:
|
||||||
from concurrent import futures
|
# from concurrent import futures
|
||||||
else:
|
# else:
|
||||||
from concurrent_py2 import futures
|
# from concurrent_py2 import futures
|
||||||
with futures.ThreadPoolExecutor() as executor:
|
# with futures.ThreadPoolExecutor() as executor:
|
||||||
unshList = [executor.submit(unshorten, match) for match in matches]
|
# unshList = [executor.submit(unshorten, match) for match in matches]
|
||||||
for link in futures.as_completed(unshList):
|
# for link in futures.as_completed(unshList):
|
||||||
if link.result()[0] not in matches:
|
# if link.result()[0] not in matches:
|
||||||
links = link.result()[0]
|
# links = link.result()[0]
|
||||||
if type(links) == list:
|
# if type(links) == list:
|
||||||
for l in links:
|
# for l in links:
|
||||||
text += '\n' + l
|
# text += '\n' + l
|
||||||
else:
|
# else:
|
||||||
text += '\n' + str(link.result()[0])
|
# text += '\n' + str(link.result()[0])
|
||||||
return text
|
return text
|
||||||
@@ -4,16 +4,12 @@
|
|||||||
"ignore_urls": ["http://akvideo.stream/video", "http://akvideo.stream/video/api"],
|
"ignore_urls": ["http://akvideo.stream/video", "http://akvideo.stream/video/api"],
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"pattern": "akvideo\\.stream/((?:api/vcmod/fastredirect/streaming\\.php\\?id=|swembedid/)[$0-9]+)",
|
"pattern": "https?://(?:akvideo\\.stream|akvi\\.club)/[^\\s]+[/=]([$0-9]+)(?:[\\s<]|$|\\.html)",
|
||||||
"url": "http://akvideo.stream/\\1"
|
"url": "http://akvideo.stream/swembedid/\\1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "(https://akvideo\\.stream/api/vcmod/fastredirect/embed_ak\\.php\\?id=[0-9]+)",
|
"pattern": "https?://(?:akvideo\\.stream|akvi\\.club)/(?:embed-|video\\.php\\?file_code=)?([a-z0-9]+)(?:[\\s<]|$|\\.html)",
|
||||||
"url": "\\1"
|
"url": "http://akvi.club/embed-\\1.html"
|
||||||
},
|
|
||||||
{
|
|
||||||
"pattern": "akvideo.stream/(?:video/|video\\.php\\?file_code=)?(?:embed-)?([a-zA-Z0-9]+)",
|
|
||||||
"url": "http://akvideo.stream/video/\\1"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user