- Aggiornato Anavids

- Fix m3u8 non supportati da inputstream
 - Stayonline
This commit is contained in:
Alhaziel01
2021-10-23 11:36:48 +02:00
parent 5a89b60ce8
commit 0976a8581b
8 changed files with 26 additions and 13 deletions
+2 -1
View File
@@ -203,7 +203,8 @@ def findvideos(item):
item.clone(action= 'play', item.clone(action= 'play',
title=config.get_localized_string(30137), title=config.get_localized_string(30137),
url= item.url + '?' + key, url= item.url + '?' + key,
server= 'directo') server= 'directo',
manifest='hls')
) )
return support.server(item, itemlist=itemlist, Download=False) return support.server(item, itemlist=itemlist, Download=False)
+5 -2
View File
@@ -1440,7 +1440,7 @@ def addQualityTag(item, itemlist, data, patron):
else: else:
info('nessun tag qualità trovato') info('nessun tag qualità trovato')
def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False): def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False, hls=False):
from core import jsontools from core import jsontools
video_urls = [] video_urls = []
block = scrapertools.find_single_match(data, r'sources"?\s*:\s*(.*?}?])') if not dataIsBlock else data block = scrapertools.find_single_match(data, r'sources"?\s*:\s*(.*?}?])') if not dataIsBlock else data
@@ -1467,7 +1467,10 @@ def get_jwplayer_mediaurl(data, srvName, onlyHttp=False, dataIsBlock=False):
for url, quality in sources: for url, quality in sources:
quality = 'auto' if not quality else quality quality = 'auto' if not quality else quality
if url.split('.')[-1] != 'mpd': if url.split('.')[-1] != 'mpd':
video_urls.append(['.' + url.split('.')[-1].split('?')[0] + ' [' + quality + '] [' + srvName + ']', url.replace(' ', '%20') if not onlyHttp else url.replace('https://', 'http://')]) _type = url.split('.')[-1].split('?')[0]
if _type == 'm3u8' and hls:
_type = 'hls'
video_urls.append([_type + ' [' + quality + '] [' + srvName + ']', url.replace(' ', '%20') if not onlyHttp else url.replace('https://', 'http://')])
video_urls.sort(key=lambda x: x[0].split()[1]) video_urls.sort(key=lambda x: x[0].split()[1])
return video_urls return video_urls
+2
View File
@@ -630,6 +630,7 @@ class UnshortenIt(object):
return uri, str(e) return uri, str(e)
def _unshorten_stayonline(self, uri): def _unshorten_stayonline(self, uri):
# from core.support import dbg;dbg()
try: try:
id = uri.split('/')[-2] id = uri.split('/')[-2]
reqUrl = 'https://stayonline.pro/ajax/linkView.php' reqUrl = 'https://stayonline.pro/ajax/linkView.php'
@@ -641,6 +642,7 @@ class UnshortenIt(object):
uri = json.loads(data)['data']['value'] uri = json.loads(data)['data']['value']
except: except:
uri = scrapertools.find_single_match(data, r'"value"\s*:\s*"([^"]+)"') uri = scrapertools.find_single_match(data, r'"value"\s*:\s*"([^"]+)"')
uri = httptools.downloadpage(uri, only_headers=True).url
return uri, r.code return uri, r.code
except Exception as e: except Exception as e:
return uri, str(e) return uri, str(e)
+6 -3
View File
@@ -975,7 +975,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
return return
# we get the selected video # we get the selected video
mediaurl, view, mpd = get_video_seleccionado(item, seleccion, video_urls, autoplay) mediaurl, view, mpd, hls = get_video_seleccionado(item, seleccion, video_urls, autoplay)
if not mediaurl: return if not mediaurl: return
# video information is obtained. # video information is obtained.
@@ -995,7 +995,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
xlistitem.setProperty("inputstream.adaptive.license_type", item.drm) xlistitem.setProperty("inputstream.adaptive.license_type", item.drm)
xlistitem.setProperty("inputstream.adaptive.license_key", item.license) xlistitem.setProperty("inputstream.adaptive.license_key", item.license)
xlistitem.setMimeType('application/dash+xml') xlistitem.setMimeType('application/dash+xml')
elif item.manifest == 'hls' or (mediaurl.split('|')[0].endswith('m3u8') and mediaurl.startswith('http')): elif hls or item.manifest == 'hls':# or (mediaurl.split('|')[0].endswith('m3u8') and mediaurl.startswith('http')):
if not install_inputstream(): if not install_inputstream():
return return
xlistitem.setProperty('inputstream' if PY3 else 'inputstreamaddon', 'inputstream.adaptive') xlistitem.setProperty('inputstream' if PY3 else 'inputstreamaddon', 'inputstream.adaptive')
@@ -1304,6 +1304,7 @@ def get_video_seleccionado(item, seleccion, video_urls, autoplay=False):
view = False view = False
wait_time = 0 wait_time = 0
mpd = False mpd = False
hls = False
# You have chosen one of the videos # You have chosen one of the videos
if seleccion < len(video_urls): if seleccion < len(video_urls):
@@ -1323,6 +1324,8 @@ def get_video_seleccionado(item, seleccion, video_urls, autoplay=False):
if 'mpd' in video_urls[seleccion][0]: if 'mpd' in video_urls[seleccion][0]:
mpd = True mpd = True
if 'hls' in video_urls[seleccion][0]:
hls = True
# If there is no mediaurl it is because the video is not there :) # If there is no mediaurl it is because the video is not there :)
logger.debug("mediaurl=" + mediaurl) logger.debug("mediaurl=" + mediaurl)
@@ -1338,7 +1341,7 @@ def get_video_seleccionado(item, seleccion, video_urls, autoplay=False):
if not continuar: if not continuar:
mediaurl = "" mediaurl = ""
return mediaurl, view, mpd return mediaurl, view, mpd, hls
def set_player(item, xlistitem, mediaurl, view, strm): def set_player(item, xlistitem, mediaurl, view, strm):
+2 -2
View File
@@ -4,8 +4,8 @@
"ignore_urls": [], "ignore_urls": [],
"patterns": [ "patterns": [
{ {
"pattern": "anavids.com/((?:embed-)?[0-9a-zA-Z]+)", "pattern": "((?:anavids|vidspeeds|liivideo|liiivideo|allviids|vidbm|vidroba|vidbom|anafasts)).com(?:\\:\\d+)?/((?:embed-)?[0-9a-zA-Z]+)",
"url": "https://anavids.com/\\1.html" "url": "https://\\1.com/\\2.html"
} }
] ]
}, },
+4 -1
View File
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from core import httptools, support from core import httptools, support
from core import scrapertools from lib import jsunpack
from platformcode import config, logger from platformcode import config, logger
@@ -17,5 +17,8 @@ def test_video_exists(page_url):
def get_video_url(page_url, premium=False, user="", password="", video_password=""): def get_video_url(page_url, premium=False, user="", password="", video_password=""):
global data global data
packed = support.match(data, patron=r'(eval\(function\(p.*?)</').match
if packed:
data = jsunpack.unpack(packed).replace("\\", "")
video_urls = support.get_jwplayer_mediaurl(data, 'AvaVids') video_urls = support.get_jwplayer_mediaurl(data, 'AvaVids')
return video_urls return video_urls
+4 -3
View File
@@ -21,7 +21,7 @@ def test_video_exists(page_url):
global data global data
data = httptools.downloadpage(page_url).data data = httptools.downloadpage(page_url).data
if "file was deleted" in data: if scrapertools.find_single_match(data, '(?<!none);[^>]*>file was deleted'):
return False, config.get_localized_string(70449) % "MaxStream" return False, config.get_localized_string(70449) % "MaxStream"
return True, "" return True, ""
@@ -51,8 +51,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
# return [] # return []
packed = support.match(data, patron=r"(eval\(function\(p,a,c,k,e,d\).*?)\s*</script").match packed = support.match(data, patron=r"(eval\(function\(p,a,c,k,e,d\).*?)\s*</script").match
unpack = jsunpack.unpack(packed) if packed:
url = scrapertools.find_single_match(unpack, 'src:\s*"([^"]+)') data = jsunpack.unpack(packed)
url = scrapertools.find_single_match(data, 'src:\s*"([^"]+)')
if url: if url:
video_urls.append(['m3u8 [MaxStream]', url]) video_urls.append(['m3u8 [MaxStream]', url])
return video_urls return video_urls
+1 -1
View File
@@ -30,6 +30,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
quality = quality.split('x')[0] quality = quality.split('x')[0]
if quality not in qualities: if quality not in qualities:
qualities.append(quality) qualities.append(quality)
video_urls.append(["m3u8 {}p [Paramount]".format(quality), url]) video_urls.append(["hls {}p [Paramount]".format(quality), url])
video_urls.sort(key=lambda url: int(support.match(url[0], patron=r'(\d+)p').match)) video_urls.sort(key=lambda url: int(support.match(url[0], patron=r'(\d+)p').match))
return video_urls return video_urls