Skip to content

Commit

Permalink
feat: ignore encoding error in cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
rmb122 committed Oct 29, 2024
1 parent 82ebd57 commit f1db42b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
__pycache__/
.vscode/
cookie.txt
.idea/
.idea/
venv/
4 changes: 2 additions & 2 deletions DeleteMyHistory.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def main():
config: GlobalConfig = toml.load(f)

cookie_file = config.get('cookie_file', './cookie.txt')
with open(cookie_file, 'r') as f:
raw_cookie = f.read()
with open(cookie_file, 'rb') as f:
raw_cookie = f.read().decode(errors='ignore')

session = requests.session()
session = load_cookie(session, raw_cookie)
Expand Down

0 comments on commit f1db42b

Please sign in to comment.