allow session cookie to work on videos.watchpeopledie.tv

master
Aevann 2023-07-14 18:45:49 +03:00
parent 3c5f757ecf
commit 79d8bb7d2c
4 changed files with 14 additions and 2 deletions

View File

@ -52,6 +52,10 @@ app.config["CACHE_TYPE"] = "RedisCache"
app.config["CACHE_REDIS_URL"] = environ.get("REDIS_URL").strip()
app.config["CACHE_DEFAULT_TIMEOUT"] = 86400
#to allow session cookie to work on videos.watchpeopledie.tv
if SITE == 'watchpeopledie.tv':
app.config["SESSION_COOKIE_DOMAIN"] = SITE
def get_CF():
with app.app_context():
x = request.headers.get('CF-Connecting-IP')

View File

@ -162,6 +162,7 @@ function submit(form) {
const xhr = new XMLHttpRequest();
//needed for uploading to videos.watchpeopledie.tv
xhr.withCredentials=true;
formData = new FormData(form);

View File

@ -68,8 +68,15 @@ def after_request(response:Response):
if user_id:
redis_instance.delete(f'LIMITER/{SITE}-{user_id}/{request.endpoint}:{request.path}/1/1/second')
if SITE == 'rdrama.net':
cookie_name = app.config["SESSION_COOKIE_NAME"]
if SITE == 'watchpeopledie.tv' and request.path == '/':
value = request.cookies.get(cookie_name)
if value:
response.set_cookie(cookie_name, 'test', max_age=0)
response.set_cookie(cookie_name, value, max_age=1723908553, domain=f".{SITE}")
if SITE == 'rdrama.net':
if len(request.cookies.getlist(cookie_name)) > 1:
response.set_cookie(cookie_name, 'test', max_age=0, domain=f".{SITE}")
response.set_cookie(cookie_name, 'test', max_age=0)

View File

@ -12,7 +12,7 @@
{% block content %}
{% block form %}
<div class="submit-grid-view">
<form id="submitform" action="{% if False and SITE == 'watchpeopledie.tv' and not SITE_SETTINGS['under_attack'] %}https://videos.watchpeopledie.tv{% elif sub %}/h/{{sub}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2" data-nonce="{{g.nonce}}" data-onsubmit="submit(this)">
<form id="submitform" action="{% if SITE == 'watchpeopledie.tv' and not SITE_SETTINGS['under_attack'] %}https://videos.watchpeopledie.tv{% elif sub %}/h/{{sub}}{% endif %}/submit" method="post" enctype="multipart/form-data" style="grid-column: 2" data-nonce="{{g.nonce}}" data-onsubmit="submit(this)">
<div class="container pb-0">
<div class="row justify-content-center">
<div class="col px-3 py-0">