From abfdb3a4df2ebd9ca0bf691fb4b822885720de7f Mon Sep 17 00:00:00 2001 From: "Bruno D. Rodrigues" Date: Tue, 16 Jan 2024 12:03:17 +0000 Subject: [PATCH] Cope with session file format changes --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index deb0c1a..f6e9ebf 100755 --- a/main.py +++ b/main.py @@ -270,9 +270,10 @@ def handle_iTunes_provider(url): session_cache = os.path.join(args.session_dir, args.appleid) if args.session_dir else None if session_cache and os.path.exists(session_cache): needLogin = False - with open(session_cache, "r") as f: - content = f.read() try: + # inside try in case the file format changed + with open(session_cache, "r") as f: + content = f.read() Store.authenticate_load_session(content) except Exception as e: logger.warning(f"Error loading session {session_cache}")