Fix EU consent bug (#320)

* Update request.py

* Use current date to format EU consent cookie

Co-authored-by: Ben Busby <benbusby@protonmail.com>
main
bruvv 2021-05-18 16:52:24 +02:00 committed by GitHub
parent 4466bbc8f4
commit 27b6d05b6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
from app.models.config import Config from app.models.config import Config
from datetime import datetime
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import random import random
import requests import requests
@ -216,8 +217,11 @@ class Request:
# FIXME: Should investigate this further to ensure the consent # FIXME: Should investigate this further to ensure the consent
# view is suppressed correctly # view is suppressed correctly
now = datetime.now()
cookies = { cookies = {
'CONSENT': 'PENDING+999' 'CONSENT': 'YES+cb.{:d}{:02d}{:02d}-17-p0.de+F+678'.format(
now.year, now.month, now.day
)
} }
# Validate Tor conn and request new identity if the last one failed # Validate Tor conn and request new identity if the last one failed