forked from rDrama/rDrama
1
0
Fork 0
master
Aevann 2024-02-01 22:07:37 +02:00
parent b0801d6bfa
commit 9955fc8f11
1 changed files with 5 additions and 4 deletions

View File

@ -438,8 +438,9 @@ if SITE == 'watchpeopledie.tv':
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
def geoblock():
print('wtf', flush=True)
print(request.headers.get("Cf-Ipcountry"), flush=True)
if request.headers.get("Cf-Ipcountry") == 'AU':
abort(403)
ip = request.headers.get("X-Forwarded-For")
req = requests.get(f'http://ipinfo.io/{ip}/json')
country = json.loads(req.text)['country']
if country == 'AU':
abort(403, "This video is blocked in Australia")
return send_file('/videos/1706708037797343.mp4')