fix mystream
This commit is contained in:
@@ -4,11 +4,7 @@
|
||||
"ignore_urls": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "https://embed.mystream.to/(\\w+)",
|
||||
"url": "https://embed.mystream.to/\\1"
|
||||
},
|
||||
{
|
||||
"pattern": "https://mystream.to/watch/(\\w+)",
|
||||
"pattern": "(?:\\w+\\.)?my?stream\\.(?:to|fun)/(?:watch/)?([a-zA-Z0-9]+)",
|
||||
"url": "https://embed.mystream.to/\\1"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -2,33 +2,28 @@
|
||||
# --------------------------------------------------------
|
||||
# Conector mystream By Alfa development Group
|
||||
# --------------------------------------------------------
|
||||
|
||||
import re
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from lib.aadecode import decode as aadecode
|
||||
from platformcode import logger
|
||||
from lib import js2py
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url)
|
||||
global page_data
|
||||
page_data = data.data
|
||||
if data.code == 404:
|
||||
return False, "[mystream] El archivo no existe o ha sido borrado"
|
||||
if "<title>video is no longer available" in data.data or "<title>Video not found" in data.data:
|
||||
return False, "[mystream] El archivo no existe o ha sido borrado"
|
||||
return False, config.get_localized_string(70449) % "mystream"
|
||||
if "<title>video is no longer available" in data.data or "<title>Video not found" in data.data or "We are unable to find the video" in data.data:
|
||||
return False, config.get_localized_string(70449) % "mystream"
|
||||
return True, ""
|
||||
|
||||
|
||||
def get_video_url(page_url, premium = False, user = "", password = "", video_password = ""):
|
||||
logger.info("url=" + page_url)
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
headers = {'referer': page_url}
|
||||
data = httptools.downloadpage(page_url, headers=headers).data
|
||||
data = re.sub(r'"|\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
code = scrapertools.find_single_match(data, '(?s)<script>\s*゚ω゚(.*?)</script>').strip()
|
||||
text_decode = aadecode(code)
|
||||
matches = scrapertools.find_multiple_matches(text_decode, "'src', '([^']+)'")
|
||||
for url in matches:
|
||||
video_urls.append(['mystream [mp4]',url])
|
||||
return video_urls
|
||||
global page_data
|
||||
dec = scrapertools.find_single_match(page_data, '(\$=~\[\];.*?\(\)\))\(\);')
|
||||
deObfCode = js2py.eval_js(dec)
|
||||
video_urls.append(['mp4 [mystream]', scrapertools.find_single_match(str(deObfCode), "'src',\s*'([^']+)")])
|
||||
return video_urls
|
||||
Reference in New Issue
Block a user