UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

KeyError: 'author'

Open SomeBasicUser opened this issue 5 years ago • 11 comments

image

SomeBasicUser avatar Aug 23 '21 19:08 SomeBasicUser

mybad:

Change line 395 of apis/api_helper.py to: media_set = [x for x in list(chain(*media_set)) if not x.get('isReportedByMe')]

SomeBasicUser avatar Aug 23 '21 19:08 SomeBasicUser

possible duplicate of #1419

bigbluedeer avatar Aug 24 '21 09:08 bigbluedeer

mybad:

Change line 395 of apis/api_helper.py to: media_set = [x for x in list(chain(*media_set)) if not x.get('isReportedByMe')]

this does not work for me :/

howdothiswork avatar Aug 24 '21 15:08 howdothiswork

The author does know about this, but has lost access to his main account. You version is pretty old. Let's go ahead and install from this branch for now. Reinstall and report back.

americanseeder1865 avatar Aug 25 '21 11:08 americanseeder1865

Also getting the same error with the new branch

Scrape Processing
Type: Profile
Type: Stories
Scrape Attempt: 1/100
Processing Scraped Stories
100%|██████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 2667.71it/s]
Processing metadata.
Finished processing metadata.
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Renaming files.
100%|█████████████████████████████████████████████████████████████████████████████████| 30/30 [00:00<00:00, 310.88it/s]
Type: Posts
Scrape Attempt: 1/100
Type: Archived Posts
Scrape Attempt: 1/100
Traceback (most recent call last):
  File "O:\OnlyFans-master\start_ofd.py", line 60, in <module>
    loop.run_until_complete(main())
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "O:\OnlyFans-master\start_ofd.py", line 44, in main
    api = await main_datascraper.start_datascraper(
  File "O:\OnlyFans-master\datascraper\main_datascraper.py", line 93, in start_datascraper
    await main_helper.process_names(
  File "O:\OnlyFans-master\helpers\main_helper.py", line 939, in process_names
    result = await module.start_datascraper(authed, username, site_name)
  File "O:\OnlyFans-master\modules\onlyfans.py", line 160, in start_datascraper
    await prepare_scraper(authed, site_name, item)
  File "O:\OnlyFans-master\modules\onlyfans.py", line 793, in prepare_scraper
    master_set += await subscription.get_archived_posts()
  File "O:\OnlyFans-master\apis\onlyfans\classes\create_user.py", line 429, in get_archived_posts
    final_results = [create_post(x, self) for x in results if x]
  File "O:\OnlyFans-master\apis\onlyfans\classes\create_user.py", line 429, in <listcomp>
    final_results = [create_post(x, self) for x in results if x]
  File "O:\OnlyFans-master\apis\onlyfans\classes\create_post.py", line 13, in __init__
    self.author = create_user.create_user(option["author"])
KeyError: 'author'

Edit: seems to affect free accounts.

Gamma-Velorum avatar Aug 26 '21 11:08 Gamma-Velorum

Also getting the same error with the new branch

Scrape Processing
Type: Profile
Type: Stories
Scrape Attempt: 1/100
Processing Scraped Stories
100%|██████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 2667.71it/s]
Processing metadata.
Finished processing metadata.
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
Renaming files.
100%|█████████████████████████████████████████████████████████████████████████████████| 30/30 [00:00<00:00, 310.88it/s]
Type: Posts
Scrape Attempt: 1/100
Type: Archived Posts
Scrape Attempt: 1/100
Traceback (most recent call last):
  File "O:\OnlyFans-master\start_ofd.py", line 60, in <module>
    loop.run_until_complete(main())
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "O:\OnlyFans-master\start_ofd.py", line 44, in main
    api = await main_datascraper.start_datascraper(
  File "O:\OnlyFans-master\datascraper\main_datascraper.py", line 93, in start_datascraper
    await main_helper.process_names(
  File "O:\OnlyFans-master\helpers\main_helper.py", line 939, in process_names
    result = await module.start_datascraper(authed, username, site_name)
  File "O:\OnlyFans-master\modules\onlyfans.py", line 160, in start_datascraper
    await prepare_scraper(authed, site_name, item)
  File "O:\OnlyFans-master\modules\onlyfans.py", line 793, in prepare_scraper
    master_set += await subscription.get_archived_posts()
  File "O:\OnlyFans-master\apis\onlyfans\classes\create_user.py", line 429, in get_archived_posts
    final_results = [create_post(x, self) for x in results if x]
  File "O:\OnlyFans-master\apis\onlyfans\classes\create_user.py", line 429, in <listcomp>
    final_results = [create_post(x, self) for x in results if x]
  File "O:\OnlyFans-master\apis\onlyfans\classes\create_post.py", line 13, in __init__
    self.author = create_user.create_user(option["author"])
KeyError: 'author'

Edit: seems to affect free accounts.

I don't get this error on free or paid accounts.

My git source URL is https://github.com/DIGITALCRIMINALS/OnlyFans on the latest commit...

americanseeder1865 avatar Aug 26 '21 12:08 americanseeder1865

I don't get this error on free or paid accounts.

My git source URL is https://github.com/DIGITALCRIMINALS/OnlyFans on the latest commit...

Yep, using that commit. The model is araqueenbae that the error presented on. Before that, hopebeel,

Uninstalled and reinstalled requirements. Only thing I haven't done is downgrade tqdm per #1561

Gamma-Velorum avatar Aug 26 '21 13:08 Gamma-Velorum

Yeah do that and see what happens. The last thing to try is to containerize.

americanseeder1865 avatar Aug 27 '21 00:08 americanseeder1865

Yeah do that and see what happens.

Downgrading tqdm to 4.59.0 results in this error with your commit during the beginning of the script

Traceback (most recent call last):
  File "O:\OnlyFans-master\start_ofd.py", line 60, in <module>
    loop.run_until_complete(main())
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "O:\OnlyFans-master\start_ofd.py", line 44, in main
    api = await main_datascraper.start_datascraper(
  File "O:\OnlyFans-master\datascraper\main_datascraper.py", line 90, in start_datascraper
    await module.paid_content_scraper(api, identifiers)
  File "O:\OnlyFans-master\modules\onlyfans.py", line 401, in paid_content_scraper
    unrefined_set = await tqdm.gather(*tasks, **settings)
  File "C:\Users\Christopher\AppData\Local\Programs\Python\Python39\lib\site-packages\tqdm\asyncio.py", line 74, in gather
    ifs = [wrap_awaitable(i, f) for i, f in enumerate(fs)]
TypeError: 'coroutine' object is not iterable

sys:1: RuntimeWarning: coroutine 'media_scraper' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Is tqdm 4.59.0 compatible with your commit? Really don't want to have to move my setup to docker right now. 😓

Gamma-Velorum avatar Aug 27 '21 17:08 Gamma-Velorum

mybad:

Change line 395 of apis/api_helper.py to: media_set = [x for x in list(chain(*media_set)) if not x.get('isReportedByMe')]

This worked for me... Thanks

Nick05491 avatar Aug 27 '21 18:08 Nick05491

mybad:

Change line 395 of apis/api_helper.py to: media_set = [x for x in list(chain(*media_set)) if not x.get('isReportedByMe')]

This worked for me (I was having trouble on a Free account).

Reveren avatar Sep 24 '21 01:09 Reveren