Skip to content

Commit

Permalink
似乎修复「KeyError: courseId」
Browse files Browse the repository at this point in the history
  • Loading branch information
Mufanc committed Dec 15, 2021
1 parent d4bdc59 commit 0a569f8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions automaton/devtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ async def get_current(self):
pages = (await client.get(f'http://127.0.0.1:{self.port}/json')).json()
for page in pages:
params = dict(parser.parse_qsl(parser.urlsplit(page['url']).query))
if 'courseId' not in params:
continue
if 'bookId' in params:
return params['courseId'], params['bookId']
return params['courseId'], None
Expand Down

0 comments on commit 0a569f8

Please sign in to comment.