wstream: aggiunto support ai link presenti sul geniodellostreaming
This commit is contained in:
@@ -173,7 +173,6 @@ def newest(categoria):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
from lib import unshortenit
|
|
||||||
log()
|
log()
|
||||||
matches = support.match(item, patron=[r'class="metaframe rptss" src="([^"]+)"',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
|
matches = support.match(item, patron=[r'class="metaframe rptss" src="([^"]+)"',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -188,24 +187,13 @@ def findvideos(item):
|
|||||||
if 'player.php' in match:
|
if 'player.php' in match:
|
||||||
match = support.httptools.downloadpage(match, follow_redirect=True).url
|
match = support.httptools.downloadpage(match, follow_redirect=True).url
|
||||||
list_url.append(match)
|
list_url.append(match)
|
||||||
|
for i, url in enumerate(list_url):
|
||||||
def unshorten(i, url):
|
itemlist.append(support.Item(
|
||||||
url = unshortenit.unshorten(url)[0]
|
channel=item.channel,
|
||||||
return support.Item(
|
title=list_servers[i],
|
||||||
channel=item.channel,
|
url=url,
|
||||||
title=list_servers[i],
|
action='play',
|
||||||
url=url,
|
quality=list_quality[i],
|
||||||
action='play',
|
infoLabels=item.infoLabels))
|
||||||
quality=list_quality[i],
|
|
||||||
infoLabels=item.infoLabels)
|
|
||||||
import sys
|
|
||||||
if sys.version_info[0] >= 3:
|
|
||||||
from concurrent import futures
|
|
||||||
else:
|
|
||||||
from concurrent_py2 import futures
|
|
||||||
with futures.ThreadPoolExecutor() as executor:
|
|
||||||
unshList = [executor.submit(unshorten, i, url) for i, url in enumerate(list_url)]
|
|
||||||
for it in futures.as_completed(unshList):
|
|
||||||
itemlist.append(it.result())
|
|
||||||
|
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|||||||
@@ -7,12 +7,16 @@
|
|||||||
"find_videos": {
|
"find_videos": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"pattern": "wstream\\.video(?!<)(?:=|/)(?:video[a-zA-Z0-9.?_]*|embed[a-zA-Z0-9]*|)?(?!api|swembedid)(?:-|/|=)?(?:[a-z0-9A-Z]+/)?([a-z0-9A-Z]+)",
|
"pattern": "(?:wstream\\.video)(?!<)(?:=|/)(?:video[a-zA-Z0-9.?_]*|embed[a-zA-Z0-9]*|)?(?!api|swembedid)(?:-|/|=)?(?:[a-z0-9A-Z]+/)?([a-z0-9A-Z]+)",
|
||||||
"url": "http://wstream.video/video.php?file_code=\\1"
|
"url": "http://wstream.video/video.php?file_code=\\1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pattern": "wstream\\.video/((?:api/vcmod/fastredirect/streaming\\.php\\?id=|swembedid/)[$0-9]+)",
|
"pattern": "(?:wstream\\.video)/((?:api/vcmod/fastredirect/streaming\\.php\\?id=|swembedid/)[$0-9]+)",
|
||||||
"url": "http://wstream.video/\\1"
|
"url": "http://wstream.video/\\1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pattern": "https://nored.icu/swembedid/([0-9]+)",
|
||||||
|
"url": "http://nored.icu/swembedid/\\1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ignore_urls": []
|
"ignore_urls": []
|
||||||
|
|||||||
+11
-7
@@ -13,16 +13,19 @@ except ImportError:
|
|||||||
from core import httptools, scrapertools
|
from core import httptools, scrapertools
|
||||||
from platformcode import logger, config, platformtools
|
from platformcode import logger, config, platformtools
|
||||||
|
|
||||||
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0'], ['Host', 'wstream.video']]
|
|
||||||
|
|
||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
|
global headers
|
||||||
|
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0'],
|
||||||
|
['Host', scrapertools.get_domain_from_url(page_url)]]
|
||||||
|
|
||||||
logger.info("(page_url='%s')" % page_url)
|
logger.info("(page_url='%s')" % page_url)
|
||||||
resp = httptools.downloadpage(page_url.replace('wstream.video', '116.202.226.34'), headers=headers, verify=False)
|
resp = httptools.downloadpage(page_url.replace(headers[1][1], '116.202.226.34'), headers=headers, verify=False)
|
||||||
|
|
||||||
global data, real_url
|
global data, real_url
|
||||||
data = resp.data
|
data = resp.data
|
||||||
|
|
||||||
page_url = resp.url.replace('wstream.video', '116.202.226.34')
|
page_url = resp.url.replace(headers[1][1], '116.202.226.34')
|
||||||
if '/streaming.php' in page_url in page_url:
|
if '/streaming.php' in page_url in page_url:
|
||||||
code = httptools.downloadpage(page_url, headers=headers, follow_redirects=False, only_headers=True, verify=False).headers['location'].split('/')[-1].replace('.html', '')
|
code = httptools.downloadpage(page_url, headers=headers, follow_redirects=False, only_headers=True, verify=False).headers['location'].split('/')[-1].replace('.html', '')
|
||||||
# logger.info('WCODE=' + code)
|
# logger.info('WCODE=' + code)
|
||||||
@@ -30,7 +33,7 @@ def test_video_exists(page_url):
|
|||||||
data = httptools.downloadpage(page_url, headers=headers, follow_redirects=True, verify=False).data
|
data = httptools.downloadpage(page_url, headers=headers, follow_redirects=True, verify=False).data
|
||||||
|
|
||||||
real_url = page_url
|
real_url = page_url
|
||||||
if "Not Found" in data or "File was deleted" in data or 'Video is processing' in data:
|
if "Not Found" in data or "File was deleted" in data or 'Video is processing' in data or 'Sorry this video is unavailable' in data:
|
||||||
return False, config.get_localized_string(70449) % 'Wstream'
|
return False, config.get_localized_string(70449) % 'Wstream'
|
||||||
else:
|
else:
|
||||||
return True, ""
|
return True, ""
|
||||||
@@ -75,11 +78,12 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
|
|
||||||
logger.info("[Wstream] url=" + page_url)
|
logger.info("[Wstream] url=" + page_url)
|
||||||
video_urls = []
|
video_urls = []
|
||||||
global data, real_url
|
global data, real_url, headers
|
||||||
# logger.info(data)
|
# logger.info(data)
|
||||||
|
|
||||||
sitekey = scrapertools.find_multiple_matches(data, """data-sitekey=['"] *([^"']+)""")
|
sitekey = scrapertools.find_multiple_matches(data, """data-sitekey=['"] *([^"']+)""")
|
||||||
if sitekey: sitekey = sitekey[-1]
|
if sitekey: sitekey = sitekey[-1]
|
||||||
captcha = platformtools.show_recaptcha(sitekey, page_url.replace('116.202.226.34', 'wstream.video')) if sitekey else ''
|
captcha = platformtools.show_recaptcha(sitekey, page_url.replace('116.202.226.34', headers[1][1])) if sitekey else ''
|
||||||
|
|
||||||
possibleParam = scrapertools.find_multiple_matches(data,r"""<input.*?(?:name=["']([^'"]+).*?value=["']([^'"]*)['"]>|>)""")
|
possibleParam = scrapertools.find_multiple_matches(data,r"""<input.*?(?:name=["']([^'"]+).*?value=["']([^'"]*)['"]>|>)""")
|
||||||
if possibleParam[0][0]:
|
if possibleParam[0][0]:
|
||||||
@@ -95,7 +99,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(707434))
|
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(707434))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
headers.append(['Referer', real_url.replace('116.202.226.34', 'wstream.video')])
|
headers.append(['Referer', real_url.replace('116.202.226.34', headers[1][1])])
|
||||||
_headers = urllib.urlencode(dict(headers))
|
_headers = urllib.urlencode(dict(headers))
|
||||||
|
|
||||||
post_data = scrapertools.find_single_match(data, r"</div>\s*<script type='text/javascript'>(eval.function.p,a,c,k,e,.*?)\s*</script>")
|
post_data = scrapertools.find_single_match(data, r"</div>\s*<script type='text/javascript'>(eval.function.p,a,c,k,e,.*?)\s*</script>")
|
||||||
|
|||||||
Reference in New Issue
Block a user