- Rimosso Server Streaming Community
- Aggiunta Possibilità di Passare video_urls come parametro
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import json, requests, sys
|
||||
from core import support
|
||||
from core import support, channeltools
|
||||
from platformcode import logger
|
||||
if sys.version_info[0] >= 3:
|
||||
from concurrent import futures
|
||||
@@ -190,5 +190,21 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = [item.clone(title = 'StreamingCommunity', server='streamingcommunity_server')]
|
||||
return support.server(item, item.url)
|
||||
video_urls = []
|
||||
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'}
|
||||
data = support.match(item, headers=headers).data.replace('"','"').replace('\\','')
|
||||
url = support.match(data, 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))
|
||||
itemlist = [item.clone(title = 'StreamingCommunity', video_urls=video_urls, thumbnail=channeltools.get_channel_parameters(item.channel)["thumbnail"], forcethumb=True)]
|
||||
return support.server(item, itemlist=itemlist)
|
||||
@@ -1163,26 +1163,27 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
# s = servertools.get_server_from_url(videoitem.url)
|
||||
# videoitem.server = s[2] if s else 'directo'
|
||||
# videoitem.title = s[0] if s else config.get_localized_string(30137)
|
||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||
if not srv_param: # do not exists or it's empty
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
info(findS)
|
||||
if not findS:
|
||||
if item.channel == 'community':
|
||||
findS= (config.get_localized_string(30137), videoitem.url, 'directo')
|
||||
else:
|
||||
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
if not findS:
|
||||
info(videoitem, 'Non supportato')
|
||||
return
|
||||
videoitem.server = findS[2]
|
||||
videoitem.title = findS[0]
|
||||
videoitem.url = findS[1]
|
||||
if not videoitem.video_urls:
|
||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||
if not srv_param: # do not exists or it's empty
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
info(findS)
|
||||
if not findS:
|
||||
if item.channel == 'community':
|
||||
findS= (config.get_localized_string(30137), videoitem.url, 'directo')
|
||||
else:
|
||||
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
if not findS:
|
||||
info(videoitem, 'Non supportato')
|
||||
return
|
||||
videoitem.server = findS[2]
|
||||
videoitem.title = findS[0]
|
||||
videoitem.url = findS[1]
|
||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||
|
||||
if srv_param.get('active', False):
|
||||
item.title = typo(item.contentTitle.strip() if item.contentTitle else item.fulltitle.strip(), 'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title
|
||||
if videoitem.video_urls or srv_param.get('active', False):
|
||||
item.title = typo(item.contentTitle.strip(), 'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title
|
||||
|
||||
quality = videoitem.quality if videoitem.quality else item.quality if item.quality else ''
|
||||
videoitem.title = (item.title if item.channel not in ['url'] else '') + (typo(videoitem.title, '_ color kod [] bold') if videoitem.title else "") + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "")
|
||||
@@ -1190,7 +1191,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
videoitem.channel = item.channel
|
||||
videoitem.fulltitle = item.fulltitle
|
||||
videoitem.show = item.show
|
||||
videoitem.thumbnail = item.thumbnail
|
||||
if not videoitem.video_urls: videoitem.thumbnail = item.thumbnail
|
||||
videoitem.contentType = item.contentType
|
||||
videoitem.infoLabels = item.infoLabels
|
||||
videoitem.quality = quality
|
||||
@@ -1202,13 +1203,13 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
|
||||
# non threaded for webpdb
|
||||
# dbg()
|
||||
# thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url]
|
||||
# thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
# for it in thL:
|
||||
# if it and not config.get_setting("black_list", server=it.server.lower()):
|
||||
# verifiedItemlist.append(it)
|
||||
#
|
||||
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url]
|
||||
thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
for it in futures.as_completed(thL):
|
||||
if it.result() and not config.get_setting("black_list", server=it.result().server.lower()):
|
||||
verifiedItemlist.append(it.result())
|
||||
|
||||
@@ -468,4 +468,4 @@ def verify_directories_created():
|
||||
|
||||
|
||||
def get_online_server_thumb(server):
|
||||
return "https://raw.github.com/kodiondemand/media/master/resources/servers/" + server.lower() + '.png'
|
||||
return "https://raw.github.com/kodiondemand/media/master/resources/servers/" + server.lower().replace('_server','') + '.png'
|
||||
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
# -*- 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
|
||||
Reference in New Issue
Block a user