support link embed akvideo e wstream, miglioria vcrypt
This commit is contained in:
+12
-11
@@ -476,6 +476,7 @@ class UnshortenIt(object):
|
|||||||
|
|
||||||
def _unshorten_vcrypt(self, uri):
|
def _unshorten_vcrypt(self, uri):
|
||||||
try:
|
try:
|
||||||
|
headers = {}
|
||||||
if 'myfoldersakstream.php' in uri or '/verys/' in uri:
|
if 'myfoldersakstream.php' in uri or '/verys/' in uri:
|
||||||
return uri, 0
|
return uri, 0
|
||||||
r = None
|
r = None
|
||||||
@@ -495,23 +496,23 @@ class UnshortenIt(object):
|
|||||||
if 'shield' in uri.split('/')[-2]:
|
if 'shield' in uri.split('/')[-2]:
|
||||||
uri = decrypt(uri.split('/')[-1])
|
uri = decrypt(uri.split('/')[-1])
|
||||||
else:
|
else:
|
||||||
import datetime, hashlib
|
if 'sb/' in uri or 'akv/' in uri or 'wss/' in uri or 'wsd/' in uri:
|
||||||
ip = urllib.urlopen('http://ip.42.pl/raw').read()
|
import datetime, hashlib
|
||||||
day = datetime.date.today().strftime('%Y%m%d')
|
ip = urllib.urlopen('http://ip.42.pl/raw').read()
|
||||||
headers = {
|
day = datetime.date.today().strftime('%Y%m%d')
|
||||||
"Cookie": hashlib.md5(ip+day).hexdigest() + "=1"
|
headers = {
|
||||||
}
|
"Cookie": hashlib.md5(ip+day).hexdigest() + "=1"
|
||||||
uri = uri.replace('sb/', 'sb1/')
|
}
|
||||||
uri = uri.replace('akv/', 'akv1/')
|
uri = uri.replace('sb/', 'sb1/')
|
||||||
uri = uri.replace('wss/', 'wss1/')
|
uri = uri.replace('akv/', 'akv1/')
|
||||||
uri = uri.replace('wsd/', 'wsd1/')
|
uri = uri.replace('wss/', 'wss1/')
|
||||||
|
uri = uri.replace('wsd/', 'wsd1/')
|
||||||
r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False)
|
r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False)
|
||||||
if 'Wait 1 hour' in r.data:
|
if 'Wait 1 hour' in r.data:
|
||||||
uri = ''
|
uri = ''
|
||||||
logger.info('IP bannato da vcrypt, aspetta un ora')
|
logger.info('IP bannato da vcrypt, aspetta un ora')
|
||||||
else:
|
else:
|
||||||
uri = r.headers['location']
|
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]
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
"find_videos": {
|
"find_videos": {
|
||||||
"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": "(https?://akvideo.stream/swembedid/\\d+)",
|
||||||
|
"url": "\\1"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"pattern": "(https://akvideo\\.stream/api/vcmod/fastredirect/embed_ak\\.php\\?id=[0-9]+)",
|
"pattern": "(https://akvideo\\.stream/api/vcmod/fastredirect/embed_ak\\.php\\?id=[0-9]+)",
|
||||||
"url": "\\1"
|
"url": "\\1"
|
||||||
|
|||||||
+2
-2
@@ -14,11 +14,11 @@ def test_video_exists(page_url):
|
|||||||
global data
|
global data
|
||||||
page = httptools.downloadpage(page_url)
|
page = httptools.downloadpage(page_url)
|
||||||
logger.info(page.data)
|
logger.info(page.data)
|
||||||
if 'embed_ak.php' in page_url:
|
if 'embed_ak.php' in page_url or '/embed-' in page.url:
|
||||||
code = scrapertools.find_single_match(page.url, '/embed-([0-9a-z]+)\.html')
|
code = scrapertools.find_single_match(page.url, '/embed-([0-9a-z]+)\.html')
|
||||||
if not code:
|
if not code:
|
||||||
code = scrapertools.find_single_match(page.data, r"""input\D*id=(?:'|")[^'"]+(?:'|").*?value='([a-z0-9]+)""")
|
code = scrapertools.find_single_match(page.data, r"""input\D*id=(?:'|")[^'"]+(?:'|").*?value='([a-z0-9]+)""")
|
||||||
if code :
|
if code:
|
||||||
page = httptools.downloadpage('http://akvideo.stream/video/' + code)
|
page = httptools.downloadpage('http://akvideo.stream/video/' + code)
|
||||||
else:
|
else:
|
||||||
return False, config.get_localized_string(70449) % "Akvideo"
|
return False, config.get_localized_string(70449) % "Akvideo"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"url": "https://wstream.video/video.php?file_code=\\1"
|
"url": "https://wstream.video/video.php?file_code=\\1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "wstream\\.video/(?!api|swembedid)([a-zA-Z0-9/]+.html)",
|
"pattern": "wstream\\.video/(?!api)([a-zA-Z0-9/]+.html)",
|
||||||
"url": "https://wstream.video/\\1"
|
"url": "https://wstream.video/\\1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20
|
|||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
logger.info("(page_url='%s')" % page_url)
|
logger.info("(page_url='%s')" % page_url)
|
||||||
resp = httptools.downloadpage(page_url)
|
resp = httptools.downloadpage(page_url)
|
||||||
|
|
||||||
global data, real_url
|
global data, real_url
|
||||||
data = resp.data
|
data = resp.data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user