Fix Ninjastream
This commit is contained in:
@@ -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"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user