- Fix AnimeWorld

- Nuovo Canale Paramount Network
This commit is contained in:
Alhaziel01
2021-01-16 12:37:37 +01:00
parent 0075f61d6c
commit 4a5dca826e
5 changed files with 125 additions and 88 deletions
+41
View File
@@ -0,0 +1,41 @@
{
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "paramountnetwork.it/([^/]+/[A-Za-z0-9]+)",
"url": "https://www.paramountnetwork.it/\\1"
}
]
},
"free": true,
"id":"paramount_server",
"name": "Paramount",
"settings": [
{
"default": false,
"enabled": true,
"id": "black_list",
"label": "@70708",
"type": "bool",
"visible": true
},
{
"default": 0,
"enabled": true,
"id": "favorites_servers_list",
"label": "@60655",
"lvalues": [
"No",
"1",
"2",
"3",
"4",
"5"
],
"type": "list",
"visible": false
}
]
}
+33
View File
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
from core import httptools, support, jsontools
from platformcode import config, logger
def test_video_exists(page_url):
global data
logger.debug('page url=', page_url)
response = httptools.downloadpage(page_url)
if response.code == 404:
return False, config.get_localized_string(70449) % 'Paramount'
else:
data = response.data
return True, ""
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.debug("url=" + page_url)
qualities = []
video_urls = []
mgid = support.match(data, patron=r'uri":"([^"]+)"').match
url = 'https://media.mtvnservices.com/pmt/e1/access/index.html?uri=' + mgid + '&configtype=edge&ref=' + page_url
ID, rootUrl = support.match(url, patron=[r'"id":"([^"]+)",',r'brightcove_mediagenRootURL":"([^"]+)"']).matches
url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
urls = support.match(url, patron=r'RESOLUTION=(\d+x\d+).*?(http[^ ]+)').matches
for quality, url in urls:
if quality not in qualities:
qualities.append(quality)
video_urls.append(["m3u8 {}p [Paramount]".format(quality.split('x')[-1]), url])
video_urls.sort(key=lambda url: int(support.match(url[0], patron=r'(\d+)p').match))
return video_urls