1
0

Try to use browsercookie

This commit is contained in:
Jon Michael Aanes 2023-12-11 00:42:51 +01:00
parent 8b96802dd9
commit 2563303896
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import requests_cache
import csv
import datetime
import io
import browsercookie
from frozendict import frozendict
import playstation
@ -42,7 +43,9 @@ def extend_csv_file(filename, new_dicts , deduplicate = False):
del csvfile
def main():
session = requests_cache.CachedSession('web_cache')
cookiejar = browsercookie.firefox()
exit(1)
session = requests_cache.CachedSession('web_cache', cookies = cookiejar)
for scraper in determine_scrapers():
result_rows = list(scraper.scraper(session))
extend_csv_file('output/'+scraper.dataset_name, result_rows,

View File

@ -19,7 +19,7 @@ def scrape_played_last(session):
"Sec-Fetch-Site": "same-site",
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"Cookie": secrets.PLAYSTATION_COM_COOKIES,
#"Cookie": secrets.PLAYSTATION_COM_COOKIES,
'Accept-Encoding': 'gzip, deflate, br',
'Referer': 'https://library.playstation.com/',
'Origin': 'https://library.playstation.com',