Try to use browsercookie
This commit is contained in:
parent
8b96802dd9
commit
2563303896
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue
Block a user