support link embed akvideo e wstream, miglioria vcrypt

This commit is contained in:
mac12m99
2020-03-15 11:04:22 +01:00
committed by marco
parent 97745aa237
commit db609ce972
5 changed files with 20 additions and 14 deletions

View File

@@ -476,6 +476,7 @@ class UnshortenIt(object):
def _unshorten_vcrypt(self, uri):
try:
headers = {}
if 'myfoldersakstream.php' in uri or '/verys/' in uri:
return uri, 0
r = None
@@ -495,23 +496,23 @@ class UnshortenIt(object):
if 'shield' in uri.split('/')[-2]:
uri = decrypt(uri.split('/')[-1])
else:
import datetime, hashlib
ip = urllib.urlopen('http://ip.42.pl/raw').read()
day = datetime.date.today().strftime('%Y%m%d')
headers = {
"Cookie": hashlib.md5(ip+day).hexdigest() + "=1"
}
uri = uri.replace('sb/', 'sb1/')
uri = uri.replace('akv/', 'akv1/')
uri = uri.replace('wss/', 'wss1/')
uri = uri.replace('wsd/', 'wsd1/')
if 'sb/' in uri or 'akv/' in uri or 'wss/' in uri or 'wsd/' in uri:
import datetime, hashlib
ip = urllib.urlopen('http://ip.42.pl/raw').read()
day = datetime.date.today().strftime('%Y%m%d')
headers = {
"Cookie": hashlib.md5(ip+day).hexdigest() + "=1"
}
uri = uri.replace('sb/', 'sb1/')
uri = uri.replace('akv/', 'akv1/')
uri = uri.replace('wss/', 'wss1/')
uri = uri.replace('wsd/', 'wsd1/')
r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False)
if 'Wait 1 hour' in r.data:
uri = ''
logger.info('IP bannato da vcrypt, aspetta un ora')
else:
uri = r.headers['location']
if "4snip" in uri:
if 'out_generator' in uri:
uri = re.findall('url=(.*)$', uri)[0]

View File

@@ -3,6 +3,10 @@
"find_videos": {
"ignore_urls": ["http://akvideo.stream/video", "http://akvideo.stream/video/api"],
"patterns": [
{
"pattern": "(https?://akvideo.stream/swembedid/\\d+)",
"url": "\\1"
},
{
"pattern": "(https://akvideo\\.stream/api/vcmod/fastredirect/embed_ak\\.php\\?id=[0-9]+)",
"url": "\\1"

View File

@@ -14,11 +14,11 @@ def test_video_exists(page_url):
global data
page = httptools.downloadpage(page_url)
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')
if not code:
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)
else:
return False, config.get_localized_string(70449) % "Akvideo"

View File

@@ -11,7 +11,7 @@
"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"
},
{

View File

@@ -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):
logger.info("(page_url='%s')" % page_url)
resp = httptools.downloadpage(page_url)
global data, real_url
data = resp.data