Fix AnimeWorld, aggiunto server AnaVids
This commit is contained in:
+33
-37
@@ -145,48 +145,44 @@ def findvideos(item):
|
||||
import time
|
||||
support.log(item)
|
||||
itemlist = []
|
||||
matches = support.match(item, patron=r'class="tab.*?data-name="([0-9]+)">', headers=headers)
|
||||
matches = support.match(item, patron=r'data-name="([0-9]+)">', headers=headers)
|
||||
data = matches.data
|
||||
matches = matches.matches
|
||||
videoData = ''
|
||||
videoData = []
|
||||
|
||||
for serverid in matches:
|
||||
if not item.number: item.number = support.scrapertools.find_single_match(item.title, r'(\d+) -')
|
||||
block = support.scrapertools.find_multiple_matches(data, 'data-id="' + serverid + '">(.*?)<div class="server')
|
||||
ID = support.scrapertools.find_single_match(str(block), r'<a data-id="([^"]+)" data-base="' + (item.number if item.number else '1') + '"')
|
||||
support.log('ID= ',serverid)
|
||||
if id:
|
||||
if serverid == '26':
|
||||
matches = support.match('%s/ajax/episode/serverPlayer?id=%s' % (host, item.url.split('/')[-1]), patron=r'<a href="([^"]+)"', ).matches
|
||||
for url in matches:
|
||||
videoData += '\n' + url
|
||||
else:
|
||||
try:
|
||||
dataJson = support.httptools.downloadpage('%s/ajax/episode/info?id=%s&server=%s&ts=%s' % (host, ID, serverid, int(time.time())), headers=[['x-requested-with', 'XMLHttpRequest']]).data
|
||||
json = jsontools.load(dataJson)
|
||||
support.log(json)
|
||||
if 'keepsetsu' in json['grabber']:
|
||||
matches = support.match(json['grabber'], patron=r'<iframe\s*src="([^"]+)"'),matches
|
||||
for url in matches:
|
||||
videoData += '\n' + url
|
||||
else:
|
||||
videoData += '\n' + json['grabber']
|
||||
if not item.number: item.number = support.match(item.title, patron=r'(\d+) -').match
|
||||
block = support.match(data, patron=r'data-id="' + serverid + r'">(.*?)<div class="server').match
|
||||
ID = support.match(block, patron=r'<a data-id="([^"]+)" data-base="' + (item.number if item.number else '1') + '"').match
|
||||
|
||||
if serverid == '18':
|
||||
url = support.match('%s/ajax/episode/serverPlayer?id=%s' % (host, ID), patron=r'source src="([^"]+)"', debug=False).match
|
||||
itemlist.append(
|
||||
support.Item(
|
||||
channel=item.channel,
|
||||
action="play",
|
||||
title='diretto',
|
||||
quality='',
|
||||
url=url,
|
||||
server='directo',
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.show,
|
||||
contentType=item.contentType,
|
||||
folder=False))
|
||||
|
||||
elif serverid == '26':
|
||||
matches = support.match('%s/ajax/episode/serverPlayer?id=%s' % (host, item.url.split('/')[-1]), patron=r'<a href="([^"]+)"', ).matches
|
||||
for url in matches:
|
||||
videoData.append(url)
|
||||
else:
|
||||
try:
|
||||
dataJson = support.match('%s/ajax/episode/info?id=%s&server=%s&ts=%s' % (host, ID, serverid, int(time.time())), headers=[['x-requested-with', 'XMLHttpRequest']]).data
|
||||
json = jsontools.load(dataJson)
|
||||
support.log(json)
|
||||
videoData.append(json['grabber'])
|
||||
except:
|
||||
pass
|
||||
|
||||
if serverid == '28':
|
||||
itemlist.append(
|
||||
support.Item(
|
||||
channel=item.channel,
|
||||
action="play",
|
||||
title='diretto',
|
||||
quality='',
|
||||
url=json['grabber'],
|
||||
server='directo',
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.show,
|
||||
contentType=item.contentType,
|
||||
folder=False))
|
||||
except:
|
||||
pass
|
||||
|
||||
return support.server(item, videoData, itemlist)
|
||||
|
||||
|
||||
+4
-4
@@ -1132,7 +1132,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
|
||||
item.title = typo(item.contentTitle.strip(),'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title
|
||||
|
||||
videoitem.plot= typo(videoitem.title, 'bold') + typo(videoitem.quality, '_ [] bold')
|
||||
videoitem.plot= typo(videoitem.title, 'bold') + (typo(videoitem.quality, '_ [] bold') if item.quality else '')
|
||||
videoitem.title = (item.title if item.channel not in ['url'] else '') + (typo(videoitem.title, '_ color kod [] bold') if videoitem.title else "") + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "")
|
||||
videoitem.fulltitle = item.fulltitle
|
||||
videoitem.show = item.show
|
||||
@@ -1303,11 +1303,11 @@ def get_jwplayer_mediaurl(data, srvName):
|
||||
block = scrapertools.find_single_match(data, r'sources: \[([^\]]+)\]')
|
||||
sources = scrapertools.find_multiple_matches(block, r'file:\s*"([^"]+)"(?:,label:\s*"([^"]+)")?')
|
||||
if not sources:
|
||||
sources = scrapertools.find_multiple_matches(data,
|
||||
r'src:\s*"([^"]+)",\s*type:\s*"[^"]+",[^,]+,\s*label:\s*"([^"]+)"')
|
||||
sources = scrapertools.find_multiple_matches(data, r'src:\s*"([^"]+)",\s*type:\s*"[^"]+",[^,]+,\s*label:\s*"([^"]+)"')
|
||||
for url, quality in sources:
|
||||
quality = 'auto' if not quality else quality
|
||||
video_urls.append(['.' + url.split('.')[-1] + ' [' + quality + '] [' + srvName + ']', url])
|
||||
if url.split('.')[-1] != 'mpd':
|
||||
video_urls.append(['.' + url.split('.')[-1] + ' [' + quality + '] [' + srvName + ']', url])
|
||||
|
||||
video_urls.sort(key=lambda x: x[0].split()[1])
|
||||
return video_urls
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"active": true,
|
||||
"find_videos": {
|
||||
"ignore_urls": [],
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "anavids.com/((?:embed-)?[0-9a-zA-Z]+)",
|
||||
"url": "https://anavids.com/\\1.html"
|
||||
}
|
||||
]
|
||||
},
|
||||
"free": true,
|
||||
"id": "anavids",
|
||||
"name": "AnaVids",
|
||||
"settings": [
|
||||
{
|
||||
"default": false,
|
||||
"enabled": true,
|
||||
"id": "black_list",
|
||||
"label": "@60654",
|
||||
"type": "bool",
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"id": "favorites_servers_list",
|
||||
"label": "@60655",
|
||||
"lvalues": [
|
||||
"No",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
"5"
|
||||
],
|
||||
"type": "list",
|
||||
"visible": false
|
||||
}
|
||||
],
|
||||
"thumbnail": "https://supervideo.tv/images/logo-player.png"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from core import httptools, support
|
||||
from core import scrapertools
|
||||
from platformcode import config, logger
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
|
||||
data = httptools.downloadpage(page_url, cookies=False).data
|
||||
if 'File you are looking for is not found.' in data:
|
||||
return False, config.get_localized_string(70449) % "AvaVids"
|
||||
|
||||
return True, ""
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info("url=" + page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
video_urls = support.get_jwplayer_mediaurl(data, 'AvaVids')
|
||||
return video_urls
|
||||
@@ -1,8 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import urllib
|
||||
import sys
|
||||
if sys.version_info[0] >= 3:
|
||||
import urllib.parse as urllib
|
||||
else:
|
||||
import urllib
|
||||
|
||||
from core import httptools, jsontools
|
||||
from platformcode import logger
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
@@ -11,7 +15,7 @@ def test_video_exists(page_url):
|
||||
data_json = httptools.downloadpage(page_url.replace('/v/', '/api/source/'), headers=[['x-requested-with', 'XMLHttpRequest']], post=post).data
|
||||
json = jsontools.load(data_json)
|
||||
if not json['data']:
|
||||
return False, "Video not found"
|
||||
return False, config.get_localized_string(70449) % "AnimeWorld"
|
||||
|
||||
return True, ""
|
||||
|
||||
@@ -27,7 +31,7 @@ def get_video_url(page_url, user="", password="", video_password=""):
|
||||
media_url = file['file']
|
||||
label = file['label']
|
||||
extension = file['type']
|
||||
video_urls.append([label + " " + extension + ' [animeworld]', media_url])
|
||||
video_urls.append([label + " " + extension + ' [AnimeWorld]', media_url])
|
||||
|
||||
|
||||
return video_urls
|
||||
|
||||
Reference in New Issue
Block a user