- Aggiornato Anavids
- Fix m3u8 non supportati da inputstream
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -992,7 +992,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.
|
||||
@@ -1012,7 +1012,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')
|
||||
@@ -1321,6 +1321,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):
|
||||
@@ -1340,6 +1341,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)
|
||||
@@ -1355,7 +1358,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):
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"ignore_urls": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "anavids.com/((?:embed-)?[0-9a-zA-Z]+)",
|
||||
"url": "https://anavids.com/\\1.html"
|
||||
"pattern": "((?:vidspeeds|liivideo|anavids|allviids)).com(?:\\:\\d+)?/((?:embed-)?[0-9a-zA-Z]+)",
|
||||
"url": "https://\\1.com/\\2.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user