Skip to content

Commit

Permalink
fix: parse fc2 id as int
Browse files Browse the repository at this point in the history
  • Loading branch information
hizkifw committed Apr 4, 2023
1 parent fe1099f commit 2389c50
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fc2_live_dl/fc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,13 @@ async def get_websocket_url(self):
control_token = json.loads(
base64.b64decode(jwt_body + "==").decode("utf-8")
)
fc2id = control_token["fc2_id"]
if len(fc2id) > 0:
self._logger.debug("Logged in with ID", fc2id)
else:
try:
fc2id = control_token["fc2_id"]
if int(fc2id) > 0:
self._logger.debug("Logged in with ID", fc2id)
else:
self._logger.debug("Using anonymous account")
except:
self._logger.debug("Using anonymous account")

return "%(url)s?control_token=%(control_token)s" % info
Expand Down

0 comments on commit 2389c50

Please sign in to comment.