Fix Ninjastream

This commit is contained in:
Alhaziel01
2021-03-09 16:28:16 +01:00
parent 87694b51ab
commit 421f145a94
2 changed files with 10 additions and 5 deletions

View File

@@ -1,10 +1,9 @@
{
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "ninjastream.to/(?:watch/)?([0-9a-zA-Z]+)",
"pattern": "ninjastream\\.to/(?:watch|download)/([0-9a-zA-Z]+)",
"url": "https://ninjastream.to/watch/\\1"
}
]

View File

@@ -20,11 +20,17 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
logger.debug("URL", page_url)
video_urls = []
h = json.loads(support.match(data, patron='stream="([^"]+)"').match.replace('"','"').replace('\\',''))
baseurl = h['host'] + h['hash']
h = json.loads(support.match(data, patron='stream="([^"]+)"').match.replace('"','"'))
baseurl = decode(h['host']) + h['hash']
matches = support.match(baseurl + '/index.m3u8', patron=r'RESOLUTION=\d+x(\d+)\s*([^\s]+)').matches
for quality, url in matches:
video_urls.append(["{} {}p [NinjaStream]".format(url.split('.')[-1], quality), '{}/{}'.format(baseurl, url)])
return video_urls
return video_urls
def decode(host):
Host = ''
for n in range(len(host)):
Host += chr(ord(host[n]) ^ ord('2'))
return Host