- 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

View File

@@ -203,7 +203,8 @@ def findvideos(item):
item.clone(action= 'play',
title=config.get_localized_string(30137),
url= item.url + '?' + key,
server= 'directo')
server= 'directo',
manifest='hls')
)
return support.server(item, itemlist=itemlist, Download=False)

View File

@@ -1440,7 +1440,7 @@ def addQualityTag(item, itemlist, data, patron):
else:
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
video_urls = []
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:
quality = 'auto' if not quality else quality
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])
return video_urls

View File

@@ -630,6 +630,7 @@ class UnshortenIt(object):
return uri, str(e)
def _unshorten_stayonline(self, uri):
# from core.support import dbg;dbg()
try:
id = uri.split('/')[-2]
reqUrl = 'https://stayonline.pro/ajax/linkView.php'
@@ -641,6 +642,7 @@ class UnshortenIt(object):
uri = json.loads(data)['data']['value']
except:
uri = scrapertools.find_single_match(data, r'"value"\s*:\s*"([^"]+)"')
uri = httptools.downloadpage(uri, only_headers=True).url
return uri, r.code
except Exception as e:
return uri, str(e)

View File

@@ -975,7 +975,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
return
# 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
# 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_key", item.license)
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():
return
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
wait_time = 0
mpd = False
hls = False
# You have chosen one of the videos
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]:
mpd = True
if 'hls' in video_urls[seleccion][0]:
hls = True
# If there is no mediaurl it is because the video is not there :)
logger.debug("mediaurl=" + mediaurl)
@@ -1338,7 +1341,7 @@ def get_video_seleccionado(item, seleccion, video_urls, autoplay=False):
if not continuar:
mediaurl = ""
return mediaurl, view, mpd
return mediaurl, view, mpd, hls
def set_player(item, xlistitem, mediaurl, view, strm):

View File

@@ -4,8 +4,8 @@
"ignore_urls": [],
"patterns": [
{
"pattern": "anavids.com/((?:embed-)?[0-9a-zA-Z]+)",
"url": "https://anavids.com/\\1.html"
"pattern": "((?:anavids|vidspeeds|liivideo|liiivideo|allviids|vidbm|vidroba|vidbom|anafasts)).com(?:\\:\\d+)?/((?:embed-)?[0-9a-zA-Z]+)",
"url": "https://\\1.com/\\2.html"
}
]
},

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from core import httptools, support
from core import scrapertools
from lib import jsunpack
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=""):
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')
return video_urls

View File

@@ -21,7 +21,7 @@ def test_video_exists(page_url):
global 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 True, ""
@@ -51,8 +51,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
# return []
packed = support.match(data, patron=r"(eval\(function\(p,a,c,k,e,d\).*?)\s*</script").match
unpack = jsunpack.unpack(packed)
url = scrapertools.find_single_match(unpack, 'src:\s*"([^"]+)')
if packed:
data = jsunpack.unpack(packed)
url = scrapertools.find_single_match(data, 'src:\s*"([^"]+)')
if url:
video_urls.append(['m3u8 [MaxStream]', url])
return video_urls

View File

@@ -30,6 +30,6 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
quality = quality.split('x')[0]
if quality not in qualities:
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))
return video_urls