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 3eab387f..46e86077 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/lib/unshortenit.py b/lib/unshortenit.py index 7ff3f624..9eb924e0 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -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) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index a01fafcc..461ec591 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -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): diff --git a/servers/anavids.json b/servers/anavids.json index 00ee9fb2..2debc652 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": "((?:anavids|vidspeeds|liivideo|liiivideo|allviids|vidbm|vidroba|vidbom|anafasts)).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.*?)]*>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*