forked from rDrama/rDrama
try smth
parent
e4a000ab21
commit
b438c25790
|
@ -434,16 +434,21 @@ def orgy(v):
|
||||||
return redirect("/chat")
|
return redirect("/chat")
|
||||||
|
|
||||||
if SITE == 'watchpeopledie.tv':
|
if SITE == 'watchpeopledie.tv':
|
||||||
|
import ipinfo
|
||||||
|
access_token = environ.get("IPINFO_TOKEN").strip()
|
||||||
|
handler = ipinfo.getHandler(access_token)
|
||||||
|
|
||||||
@app.get("/1706708037797343.mp4")
|
@app.get("/1706708037797343.mp4")
|
||||||
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
|
@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)
|
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
|
||||||
def geoblock():
|
def geoblock():
|
||||||
ip = request.headers.get("X-Forwarded-For")
|
ip = request.headers.get("X-Forwarded-For")
|
||||||
req = requests.get(f'http://ipinfo.io/{ip}/json')
|
|
||||||
try:
|
try:
|
||||||
country = json.loads(req.text)['country']
|
country = handler.getDetails(ip).country
|
||||||
if country == 'AU':
|
if country == 'AU':
|
||||||
abort(403, "This video is blocked in Australia.")
|
abort(403, "This video is blocked in Australia.")
|
||||||
except:
|
except Exception as e:
|
||||||
print(req.text, flush=True)
|
print(e, flush=True)
|
||||||
|
|
||||||
return send_file('/videos/1706708037797343.mp4')
|
return send_file('/videos/1706708037797343.mp4')
|
||||||
|
|
Loading…
Reference in New Issue