def findvideos(item): from lib import vvvvid_decoder itemlist = [] if item.contentType == 'movie': json_file = current_session.get(item.url, headers=headers, params=payload).json() item.url = host + str(json_file['data'][0]['show_id']) + '/season/' + str(json_file['data'][0]['episodes'][0]['season_id']) + '/' item.video_id = json_file['data'][0]['episodes'][0]['video_id'] json_file = current_session.get(item.url, headers=headers, params=payload).json() for episode in json_file['data']: if episode['video_id'] == item.video_id: 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('https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/playlist.m3u').data url = url.split()[-1] itemlist.append( item.clone(action= 'play', title='direct', url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url, server= 'directo') ) else: key_url = 'https://www.vvvvid.it/kenc?action=kt&conn_id=' + conn_id + '&url=' + item.url.replace(':','%3A').replace('/','%2F') key = vvvvid_decoder.dec_ei(current_session.get(key_url, headers=headers, params=payload).json()['message']) itemlist.append( item.clone(action= 'play', title='direct', url= item.url + '?' + key, server= 'directo') ) return support.server(item, itemlist=itemlist, Download=False)
def get_video_url(page_url, premium=False, user="", password="", video_password=""): video_urls = [] page_url = page_url.replace("/show/", "/#!show/") # Getting info from given URL show_id = re.findall("#!show/([0-9]+)/", page_url)[0] name = re.findall(show_id + "/(.+?)/", page_url)[0] season_id = re.findall(name + "/(.+?)/", page_url)[0] video_id = re.findall(season_id + "/(.+?)/", page_url)[0] # Getting info from Site json_url = "https://www.vvvvid.it/vvvvid/ondemand/" + show_id + '/season/' + season_id + '/' json_file = current_session.get(json_url, headers=headers, params=payload).json() logger.info(json_file['data']) # Search for the correct episode for episode in json_file['data']: if episode['video_id'] == int(video_id): ep_title = '[B]' + episode['title'] + '[/B]' embed_info = vvvvid_decoder.dec_ei(episode['embed_info']) embed_info = embed_info.replace( 'manifest.f4m', 'master.m3u8').replace('http://', 'https://').replace('/z/', '/i/') video_urls.append([ep_title, str(embed_info)]) return video_urls
def findvideos(item): support.log(item) # try: # from urlparse import urljoin # except: # from urllib.parse import urljoin # support.dbg() 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 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( support.Item( 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 url = adfly.get_long_url(item.url) elif 'bit.ly' in item.url: url = support.httptools.downloadpage( item.url, only_headers=True, follow_redirects=False).headers.get("location") else: url = host for u in item.url.split('/'): # support.log(i) if u and 'animeforce' not in u and 'http' not in u: url += '/' + u if 'php?' in url: 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 else: url = support.match(url, patron=[ r'<source src=(?:")?([^" ]+)', r'name="_wp_http_referer" value="([^"]+)"' ]).match if url.startswith('//'): url = 'https:' + url elif url.startswith('/'): url = 'https:/' + url itemlist.append( support.Item(channel=item.channel, action="play", title='Diretto', url=url, server='directo')) return support.server(item, itemlist=itemlist)