- 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

@@ -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