Skip to content

Commit

Permalink
update cookie value name check, resolves #25 and related to #25
Browse files Browse the repository at this point in the history
  • Loading branch information
meeb committed Jan 22, 2025
1 parent fbcea55 commit 6ea6269
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bandcampsync/bandcamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ def __init__(self, cookies=''):
self.cookies.load(cookies)
except Exception as e:
raise BandcampError(f'Failed to parse cookies string: {e}') from e
session = self.cookies.get('session')
if not session:
raise BandcampError(f'Cookie data does not contain a session value, make sure your '
identity = self.cookies.get('identity')
if not identity:
raise BandcampError(f'Cookie data does not contain an identity value, make sure your '
f'cookies.txt file is valid and you copied it from an '
f'authenticated browser')
session_snip = session.value[:20]
log.info(f'Located Bandcamp session in cookies: {session_snip}...')
identity_snip = identity.value[:20]
log.info(f'Located Bandcamp identity in cookies: {identity_snip}...')
# Create a requests session and map our SimpleCookie to it
self.session = requests.Session()
for cookie_name, morsel in self.cookies.items():
Expand Down

0 comments on commit 6ea6269

Please sign in to comment.