ArmindoFlores / ao3_api

An unofficial archiveofourown.org (AO3) API for python
MIT License
166 stars 64 forks source link

User.get_bookmarks() raises a error because some bookmarks are Series and not Works #86

Open encars28 opened 1 year ago

encars28 commented 1 year ago

The function get_bookmarks() doesn't work correctly when some bookmarks are Series because it is supposed to return a list of Works.


File "main.py", line 38, in <module>
    print(user.get_bookmarks())
  File "/home/encarna/.local/lib/python3.8/site-packages/AO3/users.py", line 311, in get_bookmarks
    self._load_bookmarks(page=page+1)
  File "/home/encarna/.local/lib/python3.8/site-packages/AO3/threadable.py", line 13, in new
    return func(*args, **kwargs)
  File "/home/encarna/.local/lib/python3.8/site-packages/AO3/users.py", line 340, in _load_bookmarks
    self._bookmarks.append(get_work_from_banner(work))
  File "/home/encarna/.local/lib/python3.8/site-packages/AO3/common.py", line 40, in get_work_from_banner
    new = Work(workid, load=False)
UnboundLocalError: local variable 'workid' referenced before assignment```