Ops
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import json, requests, sys
|
import json, requests, sys
|
||||||
from core import support
|
from core import support, channeltools
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
from concurrent import futures
|
from concurrent import futures
|
||||||
@@ -194,5 +194,18 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
itemlist = [item.clone(title = 'StreamingCommunity', server='streamingcommunity_server')]
|
video_urls = []
|
||||||
return support.server(item, item.url)
|
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 = channeltools.get_channel_parameters(item.channel)['title'], server='directo', video_urls=video_urls, thumbnail=channeltools.get_channel_parameters(item.channel)["thumbnail"], forcethumb=True)]
|
||||||
|
return support.server(item, itemlist=itemlist)
|
||||||
Reference in New Issue
Block a user