- Paramount in adesso in onda

- StreamingCommunity come server
This commit is contained in:
Alhaziel01
2021-01-16 16:54:31 +01:00
parent 4a5dca826e
commit 09cc856460
5 changed files with 84 additions and 11 deletions

View File

@@ -57,7 +57,7 @@ def live(item):
info = jsontools.load(support.match(host +'/api/on-air?channelId=' + ch_dict[title]).data) info = jsontools.load(support.match(host +'/api/on-air?channelId=' + ch_dict[title]).data)
support.info(info) support.info(info)
plot= '[B]' + info['seriesTitle'] +'[/B]\n' + info['description'] if 'seriesTitle' in info else '' plot= '[B]' + info['seriesTitle'] +'[/B]\n' + info['description'] if 'seriesTitle' in info else ''
itemlist.append(item.clone(title=support.typo(title,'bold'), contentTitle=title, fulltitle=title, show=title, url=host+url, plot=plot, action='play', forcethumb=True)) itemlist.append(item.clone(title=support.typo(title,'bold'), contentTitle=title, fulltitle=title, show=title, url=host+url, plot=plot, action='play', forcethumb=True, no_return=True))
return support.thumb(itemlist, live=True) return support.thumb(itemlist, live=True)

View File

@@ -190,12 +190,5 @@ def episodios(item):
def findvideos(item): def findvideos(item):
getHeaders() itemlist = [item.clone(title = 'StreamingCommunity', server='streamingcommunity_server')]
logger.debug() return support.server(item, item.url)
itemlist=[]
url = support.match(support.match(item).data.replace('"','"').replace('\\',''), patron=r'video_url"\s*:\s*"([^"]+)"').match
for res in ['480p', '720p', '1080p']:
newurl = '{}/{}'.format(url, res)
if session.head(newurl, headers=headers).status_code == 200:
itemlist += [item.clone(title=support.config.get_localized_string(30137), server='directo', url=newurl, quality=res, action='play')]
return support.server(item, itemlist=itemlist)

View File

@@ -0,0 +1,41 @@
{
"active": true,
"find_videos": {
"ignore_urls": [],
"patterns": [
{
"pattern": "https://streamingcommunity.net/[^/]+/([A-Za-z0-9]+)",
"url": "https://streamingcommunity.net/watch/\\1"
}
]
},
"free": true,
"id":"streamingcommunity_server",
"name": "StreamingCommunity",
"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
}
]
}

View File

@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
import requests, sys
from core import httptools, support
from platformcode import config, logger
if sys.version_info[0] >= 3: from concurrent import futures
else: from concurrent_py2 import futures
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14',
'content-type': 'application/json;charset=UTF-8',
'Referer': 'https://streamingcommunity.net'}
def test_video_exists(page_url):
global data
logger.debug('page url=', page_url)
response = httptools.downloadpage(page_url, headers=headers)
if response.code == 404:
return False, config.get_localized_string(70449) % 'StreamingCommunity'
else:
data = response.data
return True, ""
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.debug("url=" + page_url)
video_urls = []
url = support.match(data.replace('"','"').replace('\\',''), patron=r'video_url"\s*:\s*"([^"]+)"').match
def videourls(res):
newurl = '{}/{}'.format(url, res)
if requests.head(newurl, headers=headers).status_code == 200:
video_urls.append(["m3u8 {} [StreamingCommunity]".format(res), newurl])
with futures.ThreadPoolExecutor() as executor:
for res in ['480p', '720p', '1080p']:
executor.submit(videourls, res)
if not video_urls: video_urls = [["m3u8 [StreamingCommunity]", url]]
else: video_urls.sort(key=lambda url: int(support.match(url[0], patron=r'(\d+)p').match))
return video_urls

View File

@@ -241,7 +241,7 @@ def live(item):
from concurrent_py2 import futures from concurrent_py2 import futures
itemlist = [] itemlist = []
channels_dict = {} channels_dict = {}
channels = ['raiplay', 'mediasetplay', 'la7'] channels = ['raiplay', 'mediasetplay', 'la7', 'paramount']
with futures.ThreadPoolExecutor() as executor: with futures.ThreadPoolExecutor() as executor:
itlist = [executor.submit(load_live, channel) for channel in channels] itlist = [executor.submit(load_live, channel) for channel in channels]