diff --git a/files/__main__.py b/files/__main__.py index d13cbbe8f..9022cc65d 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -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') diff --git a/files/assets/js/submit.js b/files/assets/js/submit.js index 387bb7e26..f113a4abb 100644 --- a/files/assets/js/submit.js +++ b/files/assets/js/submit.js @@ -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); diff --git a/files/routes/allroutes.py b/files/routes/allroutes.py index d004c9a05..5fa27a07f 100644 --- a/files/routes/allroutes.py +++ b/files/routes/allroutes.py @@ -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') + 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': - cookie_name = app.config["SESSION_COOKIE_NAME"] 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) diff --git a/files/templates/submit.html b/files/templates/submit.html index 0a037e1ca..b5e9f2c61 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -12,7 +12,7 @@ {% block content %} {% block form %}
-
+