Skip to content

directory_manager_users is failing when user_id == the account owner id #1

@eclipseo

Description

@eclipseo

I think it happens when you sent stuff to a creator, it tries to download it and can't get the directory for the account owner user id:

  File "/home/bob/.cache/pypoetry/virtualenvs/ultima-scraper-5mAAlBDv-py3.11/lib/python3.11/site-packages/tqdm/asyncio.py", line 79, in gather
    res = [await f for f in cls.as_completed(ifs, loop=loop, timeout=timeout,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bob/.cache/pypoetry/virtualenvs/ultima-scraper-5mAAlBDv-py3.11/lib/python3.11/site-packages/tqdm/asyncio.py", line 79, in <listcomp>
    res = [await f for f in cls.as_completed(ifs, loop=loop, timeout=timeout,
           ^^^^^^^
  File "/usr/lib64/python3.11/asyncio/tasks.py", line 605, in _wait_for_one
    return f.result()  # May raise f.exception().
           ^^^^^^^^^^
  File "/home/bob/.cache/pypoetry/virtualenvs/ultima-scraper-5mAAlBDv-py3.11/lib/python3.11/site-packages/tqdm/asyncio.py", line 76, in wrap_awaitable
    return i, await f
              ^^^^^^^
  File "/home/bob/.cache/pypoetry/virtualenvs/ultima-scraper-5mAAlBDv-py3.11/lib/python3.11/site-packages/ultima_scraper_collection/managers/datascraper_manager/datascrapers/onlyfans.py", line 61, in media_scraper
    reformat_item = reformat_manager.prepare_reformat(asset)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bob/.cache/pypoetry/virtualenvs/ultima-scraper-5mAAlBDv-py3.11/lib/python3.11/site-packages/ultima_scraper_renamer/reformat.py", line 372, in prepare_reformat
    download_path = self.filesystem_manager.get_directory_manager(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bob/.cache/pypoetry/virtualenvs/ultima-scraper-5mAAlBDv-py3.11/lib/python3.11/site-packages/ultima_scraper_collection/managers/filesystem_manager.py", line 55, in get_directory_manager
    return self.directory_manager_users[user_id]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError:  XXX

O think it would be best to avoid downloading such content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions