KeyError: 'author'
Running on latest Master copy...
Scrape Processing
Name: paxclusive
Type: Profile
Type: Stories
No Stories Found.
Type: Posts
Scrape Attempt: 1/100
Type: Archived Posts
Scrape Attempt: 1/100
Traceback (most recent call last):
File "G:\OF2\OnlyFans-master\start_ofd.py", line 62, in
Does this happen every time?
With this model, yep.
Not sure if this is related to the same error? I'm getting a similar one which is "KeyError: 'created_at'"
Name: lysaretta
Type: Profile
Type: Stories
No Stories Found.
Type: Posts
Scrape Attempt: 1/100
Type: Archived Posts
Processing Scraped Posts
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:00<00:00, 1689.59it/s]
Processing metadata.
Merging new metadata with legacy 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.
Traceback (most recent call last):
File "G:\Scripts\OnlyFans\start_ofd.py", line 60, in <module>
loop.run_until_complete(main())
File "C:\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "G:\Scripts\OnlyFans\start_ofd.py", line 44, in main
api = await main_datascraper.start_datascraper(
File "G:\Scripts\OnlyFans\datascraper\main_datascraper.py", line 93, in start_datascraper
await main_helper.process_names(
File "G:\Scripts\OnlyFans\helpers\main_helper.py", line 921, in process_names
result = await module.start_datascraper(authed, username, site_name)
File "G:\Scripts\OnlyFans\modules\onlyfans.py", line 159, in start_datascraper
await prepare_scraper(authed, site_name, item)
File "G:\Scripts\OnlyFans\modules\onlyfans.py", line 833, in prepare_scraper
await process_metadata(
File "G:\Scripts\OnlyFans\modules\onlyfans.py", line 657, in process_metadata
result = main_helper.export_sqlite(archive_path, api_type, new_metadata_object)
File "G:\Scripts\OnlyFans\helpers\main_helper.py", line 564, in export_sqlite
created_at = media["created_at"]
KeyError: 'created_at'
Also getting the error with rhoneeandkhoa
Any updates on this? It's happening for more models
Are you blocking them????
No, I'm subscribed to both and can see the contents in a browser.
I'm able to get around this by putting a try/except block around the lines where it fetches the posts (master_set = await subscription.get_posts()) , but this is obviously a bandaid solution. Is there anything I can do to help diagnose the cause of this problem?
I found an older commit in my files from june 19 and that one worked for me. Dont know what the difference is between those tho
@DIGITALCRIMINAL - anything I can do to help diagnose/debug this issue? It's causing real problems with a few profiles I'm trying to scrape
You would need to print out the options variable so I can see what's missing
Sure...where do you want me to put the print statement?
Above line 13 in create_post
{'responseType': 'post', 'id': 24256657, 'postedAt': '2020-05-19T13:13:43+00:00', 'postedAtPrecise': '1589894023.000000', 'isReportedByMe': True}
I think we had a similar issue before where it was a post I'd reported once upon a time...
I'm getting the same issue with model lovegiavanna. Below is the options printout
{'responseType': 'post', 'id': 46583386, 'postedAt': '2020-09-15T13:51:24+00:00', 'postedAtPrecise': '1600177884.000000', 'isReportedByMe': True}```
Having the same issue with rileyreidx3. But I actually don't know what to add the get the options printout for further debugging.
Quick and dirty fix/workaround:
Change line 395 of apis/api_helper.py to:
media_set = [x for x in list(chain(*media_set)) if not x.get('isReportedByMe')]
Quick and dirty fix/workaround: Change line 395 of apis/api_helper.py to:
media_set = [x for x in list(chain(*media_set)) if not x.get('isReportedByMe')]
Thank you for this workaround!
I had the same problem with a model that I subbed to for the first time. The fix/workaround from @Charmoq worked for me.
@DIGITALCRIMINAL
Could the fix from @Charmoq be used in the master or would something speak against it?
@Charmoq thank you for workaround, it was only happening on only a few subs, but this seemed to fix it for those. Thanks again to everyone for your work!