diff --git a/channels/vvvvid.py b/channels/vvvvid.py index c7e17122..8c630057 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -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) diff --git a/core/support.py b/core/support.py index 9bef843d..18fe0f0e 100755 --- a/core/support.py +++ b/core/support.py @@ -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 diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 4a24345f..298e9926 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -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): diff --git a/servers/anavids.json b/servers/anavids.json index 00ee9fb2..1cdafb27 100644 --- a/servers/anavids.json +++ b/servers/anavids.json @@ -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" } ] }, diff --git a/servers/anavids.py b/servers/anavids.py index dd506dd3..98e3597a 100644 --- a/servers/anavids.py +++ b/servers/anavids.py @@ -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.*?)