diff --git a/vvvvget.py b/vvvvget.py index 54d3fe2..0a1de4a 100644 --- a/vvvvget.py +++ b/vvvvget.py @@ -3,6 +3,8 @@ import json import requests import sqlite3 +ua = "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4.2) Gecko/20020502 CS 2000 7.0/7.0" + def ds(h): g = "MNOPIJKL89+/4567UVWXQRSTEFGHABCDcdefYZabstuvopqr0123wxyzklmnghij" @@ -57,17 +59,17 @@ def ds(h): return d def get_settings(): - settings = requests.get('https://www.vvvvid.it/vvvvid/settings') + settings = requests.get('https://www.vvvvid.it/vvvvid/settings', headers={'User-Agent': ua}) if settings.status_code != 200: return None return settings.json()['data']['defaultStreamingServer'] def login(): - login = requests.get('https://www.vvvvid.it/user/login') + login = requests.get('https://www.vvvvid.it/user/login', headers={'User-Agent': ua}) return login.json()['data']['conn_id'] def get_info(show_id, conn_id): - info = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/info/?conn_id=' + conn_id) + info = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/info/?conn_id=' + conn_id, headers={'User-Agent': ua}) info.encoding = 'utf-8' if info.json()['result'] == 'ok': return info.json()['data'] @@ -75,14 +77,14 @@ def get_info(show_id, conn_id): return False def get_seasons(show_id, conn_id): - seasons = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/seasons/?conn_id=' + conn_id) + seasons = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/seasons/?conn_id=' + conn_id, headers={'User-Agent': ua}) if seasons.json()['result'] == 'ok' and seasons.json()['data'] and seasons.json()['data'][0]['episodes']: return seasons.json()['data'] else: return False def get_episodes(season_id, show_id, conn_id): - episodes = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/season/' +str(season_id) + '?conn_id=' + conn_id) + episodes = requests.get('https://www.vvvvid.it/vvvvid/ondemand/' + str(show_id) + '/season/' +str(season_id) + '?conn_id=' + conn_id, headers={'User-Agent': ua}) if episodes.json()['result'] == 'ok' and episodes.json()['data'] and episodes.json()['data'][0]['embed_info']: return episodes.json()['data'] else: