|
@@ -67,27 +67,28 @@ class Api():
|
|
|
return self.stream_url
|
|
|
|
|
|
def login(self):
|
|
|
- login = requests.get('https://www.vvvvid.it/user/login', headers={'User-Agent': Api.ua})
|
|
|
- self.conn_id = login.json()['data']['conn_id']
|
|
|
+ login = requests.get('https://www.vvvvid.it/user/login', headers={'User-Agent': Api.ua}).json()
|
|
|
+ self.conn_id = login['data']['conn_id']
|
|
|
|
|
|
def get_info(self, show_id):
|
|
|
info = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/info/?conn_id=' + self.conn_id, headers={'User-Agent': Api.ua})
|
|
|
info.encoding = 'utf-8'
|
|
|
- if info.json()['result'] == 'ok':
|
|
|
- return info.json()['data']
|
|
|
+ info = info.json()
|
|
|
+ if info['result'] == 'ok':
|
|
|
+ return info['data']
|
|
|
else:
|
|
|
return False
|
|
|
|
|
|
def get_seasons(self, show_id):
|
|
|
- seasons = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/seasons/?conn_id=' + self.conn_id, headers={'User-Agent': Api.ua})
|
|
|
- if seasons.json()['result'] == 'ok' and seasons.json()['data'] and seasons.json()['data'][0]['episodes']:
|
|
|
- return seasons.json()['data']
|
|
|
+ seasons = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/seasons/?conn_id=' + self.conn_id, headers={'User-Agent': Api.ua}).json()
|
|
|
+ if seasons['result'] == 'ok' and seasons['data']: # and seasons['data'][0]['episodes']:
|
|
|
+ return seasons['data']
|
|
|
else:
|
|
|
return []
|
|
|
|
|
|
def get_episodes(self, season_id, show_id):
|
|
|
episodes = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/season/' + str(season_id) + '?conn_id=' + self.conn_id, headers={'User-Agent': Api.ua}).json()
|
|
|
- if episodes['result'] == 'ok' and episodes['data'] and episodes['data'][0]['embed_info']:
|
|
|
+ if episodes['result'] == 'ok' and episodes['data']: # and episodes['data'][0]['embed_info']:
|
|
|
return episodes['data']
|
|
|
else:
|
|
|
return []
|
|
@@ -97,7 +98,7 @@ class Api():
|
|
|
count = 0
|
|
|
for k in episodes:
|
|
|
count += 1
|
|
|
- if k['embed_info']:
|
|
|
+ if k.get('embed_info'):
|
|
|
if k['video_type'] == 'video/rcs':
|
|
|
embed_info = self.ds(k['embed_info'])
|
|
|
embed_info = 'https' + embed_info[4:30] + 'i' + embed_info[31:-12] + 'master.m3u8'
|
|
@@ -109,5 +110,7 @@ class Api():
|
|
|
embed_info = self.ds(k['embed_info'])
|
|
|
else:
|
|
|
embed_info = self.ds(k['embed_info'])
|
|
|
+ else:
|
|
|
+ embed_info = ""
|
|
|
eps.append((count, show_id, season_id, k['video_type'], embed_info))
|
|
|
return eps
|