KeyError: 'filename'
This appears to be happening after #830 fix for some accounts
Type: Messages
Scraping [photo]. Should take less than a minute.
Traceback (most recent call last):
File "Z:\OF\OnlyFans-master\start_ofd.py", line 43, in
I need the model's name
Here's my error after latest update
Scrape Processing
Name: emblack
Type: Profile
0.00B [00:00, ?B/s]
Type: Stories
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Scraping [video | stream | gif]. Should take less than a minute.
Scraping [video | stream | gif]. Should take less than a minute.
Scraping [video | stream | gif]. Should take less than a minute.
Traceback (most recent call last):
File "/OnlyFans-master 6/start_ofd.py", line 43, in <module>
apis = main_datascraper.start_datascraper(json_config, site_name_lower)
File "/OnlyFans-master 6/datascraper/main_datascraper.py", line 98, in start_datascraper
names = main_helper.process_names(
File "/OnlyFans-master 6/helpers/main_helper.py", line 625, in process_names
result = module.start_datascraper(
File "/OnlyFans-master 6/modules/onlyfans.py", line 147, in start_datascraper
results = prepare_scraper(
File "/OnlyFans-master 6/modules/onlyfans.py", line 705, in prepare_scraper
unrefined_set = pool.starmap(media_scraper, product(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "/OnlyFans-master 6/modules/onlyfans.py", line 1075, in media_scraper
found_medias = [x for x in medias
File "/OnlyFans-master 6/modules/onlyfans.py", line 1076, in <listcomp>
if x["filename"] == new_media["filename"]]
KeyError: 'filename'
also getting this error on the latest commit with scrape_paid_content sent to true, scrape completes without errors when it's set to false.
Same issue as described here. The model it fails on is the same model that caused 'medias' key error described in issue #823 . Error output here (with model name):
Scrape Processing
Name: pixei
Type: Profile
0.00B [00:00, ?B/s]
Type: Stories
No Stories Found.
Type: Posts
Scrape Attempt: 1/100
Found: Posts
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Scraping [photo]. Should take less than a minute.
Traceback (most recent call last):
File "/.../OnlyFans/start_ofd.py", line 43, in <module>
apis = main_datascraper.start_datascraper(json_config, site_name_lower)
File "/.../OnlyFans/datascraper/main_datascraper.py", line 98, in start_datascraper
names = main_helper.process_names(
File "/.../OnlyFans/helpers/main_helper.py", line 625, in process_names
result = module.start_datascraper(
File "/.../OnlyFans/modules/onlyfans.py", line 147, in start_datascraper
results = prepare_scraper(
File "/.../OnlyFans/modules/onlyfans.py", line 705, in prepare_scraper
unrefined_set = pool.starmap(media_scraper, product(
File "/.../.pyenv/versions/3.9.1/lib/python3.9/multiprocessing/pool.py", line 372, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "/.../.pyenv/versions/3.9.1/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
File "/.../.pyenv/versions/3.9.1/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/.../.pyenv/versions/3.9.1/lib/python3.9/multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "/.../OnlyFans/modules/onlyfans.py", line 1075, in media_scraper
found_medias = [x for x in medias
File "/.../OnlyFans/modules/onlyfans.py", line 1076, in <listcomp>
if x["filename"] == new_media["filename"]]
KeyError: 'filename'
also getting this error on the latest commit with
scrape_paid_contentsent totrue, scrape completes without errors when it's set tofalse.
Can confirm this works too.
I still get the error, has this been fixed?
Just chiming in with my experience of the same error. Crashing on paid content from "roselle888", before I even get the choice of scraping profile feeds. Her profile is free, but doesn't seem like that matters?
Scraping - roselle888 | 30 / 46
Scraping [photo]. Should take less than a minute.
Scraping [video | stream | gif]. Should take less than a minute.
Traceback (most recent call last):
File "/home/user/projects/OF/OnlyFans/start_ofd.py", line 43, in <module>
apis = main_datascraper.start_datascraper(json_config, site_name_lower)
File "/home/user/projects/OF/OnlyFans/datascraper/main_datascraper.py", line 95, in start_datascraper
paid_content = module.paid_content_scraper(apis, identifiers)
File "/home/user/projects/OF/OnlyFans/modules/onlyfans.py", line 353, in paid_content_scraper
unrefined_set = media_scraper(paid_content, api, subscription,
File "/home/user/projects/OF/OnlyFans/modules/onlyfans.py", line 1075, in media_scraper
found_medias = [x for x in medias
File "/home/user/projects/OF/OnlyFans/modules/onlyfans.py", line 1076, in <listcomp>
if x["filename"] == new_media["filename"]]
KeyError: 'filename'
I tested on my alt account and purchased something recent from that creator as well and I am getting the same error.
I encountered this problem too.
Turns out chances are the x doesn't have a key called "filename".
So I made some tweak myself and it worked.
found_medias = [x for x in medias
if "filename" in x
if x["filename"] == new_media["filename"]]
@alextuan1024
found_medias = [x for x in "medias" if "filename" in x if x["filename"] == new_media["filename"]]
medias should be in quotes. This works.
@alextuan1024
found_medias = [x for x in "medias"
if "filename" in x if x["filename"] == new_media["filename"]]medias should be in quotes. This works.
@IT6uru I'm not sure, man. I'm not a python programmer, but isn't it iterating the string "media"?
I get an error without the quotes. Weird.
I need the model's name
Try iambianka
Has this fix been corrected, or am I missing out on something?
Has this fix been corrected, or am I missing out on something?
There hasn't been a fix released yet, but you can manually patch the modules/onlyfans.py file as described by @alextuan1024 in this comment.
Has this been fixed, or do we still need to resort to the temporary workaround noted above?
Don't use the workaround with quotes. All it does is just assign an empty list to found_medias, because it's iterating over the characters in the string "medias" (literally "m", "e", "d", "i", "a", "s"). Then it's checking to see if "filename" is in each of those characters, which it isn't, so it doesn't end up actually doing anything.
That "fix" is the same as just doing: found_medias = []
I encountered this problem too. Turns out chances are the
xdoesn't have a key called "filename". So I made some tweak myself and it worked.found_medias = [x for x in medias if "filename" in x if x["filename"] == new_media["filename"]]
You can try the latest commit. It's basically the same as what alextuan suggested.
I encountered this problem too. Turns out chances are the
xdoesn't have a key called "filename". So I made some tweak myself and it worked.found_medias = [x for x in medias if "filename" in x if x["filename"] == new_media["filename"]]You can try the latest commit. It's basically the same as what alextuan suggested.
I have 6.4.1. and still getting the "medias" keyerror. I also tried to manually do this alextuan fix, but it doesn't work.
I encountered this problem too. Turns out chances are the
xdoesn't have a key called "filename". So I made some tweak myself and it worked.found_medias = [x for x in medias if "filename" in x if x["filename"] == new_media["filename"]]You can try the latest commit. It's basically the same as what alextuan suggested.
I have 6.4.1. and still getting the "medias" keyerror. I also tried to manually do this alextuan fix, but it doesn't work.
A release version isn't the same as the latest commit, you can download it from here
https://github.com/DIGITALCRIMINAL/OnlyFans/archive/master.zip
I encountered this problem too. Turns out chances are the
xdoesn't have a key called "filename". So I made some tweak myself and it worked.found_medias = [x for x in medias if "filename" in x if x["filename"] == new_media["filename"]]You can try the latest commit. It's basically the same as what alextuan suggested.
I have 6.4.1. and still getting the "medias" keyerror. I also tried to manually do this alextuan fix, but it doesn't work.
A release version isn't the same as the latest commit, you can download it from here
https://github.com/DIGITALCRIMINAL/OnlyFans/archive/master.zip
thanks man, I'm a noob on github..
This works for me