diff --git a/servers/ninjastream.json b/servers/ninjastream.json index 06ef620a..f83d1b2e 100644 --- a/servers/ninjastream.json +++ b/servers/ninjastream.json @@ -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" } ] diff --git a/servers/ninjastream.py b/servers/ninjastream.py index aabe7382..6f89060a 100644 --- a/servers/ninjastream.py +++ b/servers/ninjastream.py @@ -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 \ No newline at end of file + return video_urls + +def decode(host): + Host = '' + for n in range(len(host)): + Host += chr(ord(host[n]) ^ ord('2')) + return Host \ No newline at end of file