Fix AnimeForce e VVVVID Server
This commit is contained in:
+41
-59
@@ -6,23 +6,35 @@
|
|||||||
from core import support
|
from core import support
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
anime = ['/lista-anime/',
|
anime = ['/lista-anime/',
|
||||||
('In Corso',['/category/anime/anime-in-corso/', 'peliculas', 'corso']),
|
('In Corso',['/anime/anime-status/in-corso/', 'peliculas', 'status']),
|
||||||
|
('Completi',['/anime/anime-status/completo/', 'peliculas', 'status']),
|
||||||
|
('Genere',['/anime', 'submenu', 'genre']),
|
||||||
|
('Anno',['/anime', 'submenu', 'anime-year']),
|
||||||
|
('Tipologia',['/anime', 'submenu', 'anime-type']),
|
||||||
|
('Stagione',['/anime', 'submenu', 'anime-season']),
|
||||||
('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last'])
|
('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last'])
|
||||||
]
|
]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
|
@support.scrape
|
||||||
|
def submenu(item):
|
||||||
|
action = 'peliculas'
|
||||||
|
patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select'
|
||||||
|
patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<t>[^&]+)[^\(]+\((?P<num>\d+)'
|
||||||
|
def itemHook(item):
|
||||||
|
item.url += host + '/anime/' + item.args + '/' + item.u
|
||||||
|
item.title = support.typo(item.t, 'bold')
|
||||||
|
return item
|
||||||
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(categoria):
|
||||||
support.log(categoria)
|
support.log(categoria)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -60,13 +72,14 @@ def search(item, texto):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
anime = True
|
anime = True
|
||||||
action = 'episodios'
|
if 'movie' in item.url:
|
||||||
|
action = 'findvideos'
|
||||||
|
else:
|
||||||
|
action = 'check'
|
||||||
|
|
||||||
if not item.args:
|
if not item.args:
|
||||||
pagination = ''
|
pagination = ''
|
||||||
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
|
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
|
||||||
# elif item.args == 'corso':
|
|
||||||
# pagination = ''
|
|
||||||
# patron = r'<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
|
|
||||||
else:
|
else:
|
||||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
||||||
|
|
||||||
@@ -81,10 +94,21 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
|
def check(item):
|
||||||
|
m = support.match(item, headers=headers, patron=r'Tipologia[^>]+><a href="([^"]+)"')
|
||||||
|
item.data = m.data
|
||||||
|
if 'movie' in m.match:
|
||||||
|
item.contentType = 'movie'
|
||||||
|
return findvideos(item)
|
||||||
|
else:
|
||||||
|
return episodios(item)
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
anime = True
|
anime = True
|
||||||
data = support.match(item, headers=headers).data
|
data = item.data
|
||||||
|
|
||||||
if '<h6>Streaming</h6>' in data:
|
if '<h6>Streaming</h6>' in data:
|
||||||
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<title>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
|
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<title>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
|
||||||
else:
|
else:
|
||||||
@@ -100,51 +124,9 @@ def episodios(item):
|
|||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.log(item)
|
support.log(item)
|
||||||
# try:
|
|
||||||
# from urlparse import urljoin
|
|
||||||
# except:
|
|
||||||
# from urllib.parse import urljoin
|
|
||||||
# support.dbg()
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
if 'vvvvid' in item.url:
|
|
||||||
import requests
|
|
||||||
from lib import vvvvid_decoder
|
|
||||||
|
|
||||||
if support.match(item.url, string=True, patron=r'(\d+/\d+)').match:
|
|
||||||
item.action = 'play'
|
|
||||||
itemlist.append(item)
|
|
||||||
else:
|
|
||||||
# VVVVID vars
|
|
||||||
vvvvid_host = 'https://www.vvvvid.it/vvvvid/ondemand/'
|
|
||||||
vvvvid_headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0'}
|
|
||||||
|
|
||||||
# VVVVID session
|
if 'adf.ly' in item.url:
|
||||||
current_session = requests.Session()
|
|
||||||
login_page = 'https://www.vvvvid.it/user/login'
|
|
||||||
conn_id = current_session.get(login_page, headers=vvvvid_headers).json()['data']['conn_id']
|
|
||||||
payload = {'conn_id': conn_id}
|
|
||||||
|
|
||||||
|
|
||||||
# collect parameters
|
|
||||||
show_id = support.match(item.url, string=True, patron=r'(\d+)').match
|
|
||||||
ep_number = support.match(item.title, patron=r'(\d+)').match
|
|
||||||
json_file = current_session.get(vvvvid_host + show_id + '/seasons/', headers=vvvvid_headers, params=payload).json()
|
|
||||||
season_id = str(json_file['data'][0]['season_id'])
|
|
||||||
json_file = current_session.get(vvvvid_host + show_id + '/season/' + season_id +'/', headers=vvvvid_headers, params=payload).json()
|
|
||||||
|
|
||||||
# select the correct episode
|
|
||||||
for episode in json_file['data']:
|
|
||||||
support.log('Number',int(episode['number']),int(ep_number))
|
|
||||||
if int(episode['number']) == int(ep_number):
|
|
||||||
url = vvvvid_decoder.dec_ei(episode['embed_info'] or episode['embed_info'])
|
|
||||||
if 'youtube' in url: item.url = url
|
|
||||||
item.url = url.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/')
|
|
||||||
if 'https' not in item.url:
|
|
||||||
url = support.match(item, url='https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u')[1]
|
|
||||||
url = url.split()[-1]
|
|
||||||
itemlist.append(item.clone(action= 'play', url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url, server= 'directo'))
|
|
||||||
|
|
||||||
elif 'adf.ly' in item.url:
|
|
||||||
from servers.decrypters import adfly
|
from servers.decrypters import adfly
|
||||||
url = adfly.get_long_url(item.url)
|
url = adfly.get_long_url(item.url)
|
||||||
|
|
||||||
@@ -154,7 +136,6 @@ def findvideos(item):
|
|||||||
else:
|
else:
|
||||||
url = host
|
url = host
|
||||||
for u in item.url.split('/'):
|
for u in item.url.split('/'):
|
||||||
# support.log(i)
|
|
||||||
if u and 'animeforce' not in u and 'http' not in u:
|
if u and 'animeforce' not in u and 'http' not in u:
|
||||||
url += '/' + u
|
url += '/' + u
|
||||||
|
|
||||||
@@ -162,11 +143,12 @@ def findvideos(item):
|
|||||||
url = support.httptools.downloadpage(url, only_headers=True, follow_redirects=False).headers.get("location")
|
url = support.httptools.downloadpage(url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||||
url = support.match(url, patron=r'class="button"><a href=(?:")?([^" ]+)', headers=headers).match
|
url = support.match(url, patron=r'class="button"><a href=(?:")?([^" ]+)', headers=headers).match
|
||||||
else:
|
else:
|
||||||
url = support.match(url, patron=[r'<source src=(?:")?([^" ]+)',r'name="_wp_http_referer" value="([^"]+)"']).match
|
if item.data: url = item.data
|
||||||
|
url = support.match(url, patron=r'data-href="([^"]+)" target').match
|
||||||
|
if not url: url = support.match(url, patron=[r'<source src=(?:")?([^" ]+)',r'name="_wp_http_referer" value="([^"]+)"']).match
|
||||||
if url.startswith('//'): url = 'https:' + url
|
if url.startswith('//'): url = 'https:' + url
|
||||||
elif url.startswith('/'): url = 'https:/' + url
|
elif url.startswith('/'): url = 'https:/' + url
|
||||||
|
if 'vvvvid' in url: itemlist.append(item.clone(action="play", title='VVVVID', url=url, server='vvvvid'))
|
||||||
|
else: itemlist.append(item.clone(action="play", title='Diretto', url=url, server='directo'))
|
||||||
itemlist.append(item.clone(action="play", title='Diretto', url=url, server='directo'))
|
|
||||||
|
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|||||||
+3
-1
@@ -53,7 +53,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
ep_title = '[B]' + episode['title'] + '[/B]'
|
ep_title = '[B]' + episode['title'] + '[/B]'
|
||||||
embed_info = vvvvid_decoder.dec_ei(episode['embed_info'])
|
embed_info = vvvvid_decoder.dec_ei(episode['embed_info'])
|
||||||
embed_info = embed_info.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/')
|
embed_info = embed_info.replace('manifest.f4m','master.m3u8').replace('http://','https://').replace('/z/','/i/')
|
||||||
|
key_url = 'https://www.vvvvid.it/kenc?action=kt&conn_id=' + conn_id + '&url=' + embed_info.replace(':','%3A').replace('/','%2F')
|
||||||
|
key = vvvvid_decoder.dec_ei(current_session.get(key_url, headers=headers, params=payload).json()['message'])
|
||||||
|
|
||||||
video_urls.append([ep_title, str(embed_info)])
|
video_urls.append([ep_title, str(embed_info) + '?' + key])
|
||||||
|
|
||||||
return video_urls
|
return video_urls
|
||||||
Reference in New Issue
Block a user