Skip to content

Commit

Permalink
Fix regex to match user_id from js (fix Nandaka#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
fireattack committed Jan 31, 2025
1 parent 16eed42 commit 9803af8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PixivBrowserFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def getMyId(self, parsed):
PixivHelper.print_and_log('info', f'My User Id: {self._myId}.')
else:
# var dataLayer = [{ login: 'yes', gender: "male", user_id: "3145410", lang: "en", illustup_flg: 'not_uploaded', premium: 'no', }];
temp = re.findall(r"var dataLayer = .*user_id: \"(\d+)\"", parsed)
temp = re.findall(r"var dataLayer = .*user_id: *['\"](\d+)['\"]", parsed)
if self._myId == 0 and temp is not None and len(temp) > 0:
self._myId = int(temp[0])
PixivHelper.print_and_log('info', f'My User Id: {self._myId}.')
Expand Down

0 comments on commit 9803af8

Please sign in to comment.