ArchivedUltimaScraper
ArchivedUltimaScraper copied to clipboard
TypeError: 'NoneType' object is not subscriptable
Running on Windows 11 under Python 3.11.4. Similar to #996, but removing the "id": id line did not resolve the issue. Running the scraper just re-adds that line to auth.json. Setting supported.onlyfans.settings.jobs.scrape.messages to false in the config.json as suggested in #1000 worked but halfway through running it again, it would result in a keyerror. Messages are one of the things I want to back up so disabling it isn't a great workaround.
Traceback (most recent call last):
File "F:\UltimaScraper-7.9.0\start_us.py", line 62, in
Traceback (most recent call last): File "D:\- GITHUB repo\UltimaScraper-master\start_us.py", line 62, in <module> asyncio.run(main()) File "C:\Users\VKP\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\VKP\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete return future.result() File "D:\- GITHUB repo\UltimaScraper-master\start_us.py", line 44, in main _api = await USR.start( File "D:\- GITHUB repo\UltimaScraper-master\ultima_scraper\ultima_scraper.py", line 50, in start await self.start_datascraper(datascraper) File "D:\- GITHUB repo\UltimaScraper-master\ultima_scraper\ultima_scraper.py", line 135, in start_datascraper final_job_user_list = await datascraper.configure_datascraper_jobs() File "C:\Users\VKP\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-C9JxXxb6-py3.10\lib\site-packages\ultima_scraper_collection\modules\module_streamliner.py", line 109, in configure_datascraper_jobs chat_users = await self.get_chat_users() File "C:\Users\VKP\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-C9JxXxb6-py3.10\lib\site-packages\ultima_scraper_collection\modules\module_streamliner.py", line 427, in get_chat_users chats = await authed.get_chats() File "C:\Users\VKP\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-C9JxXxb6-py3.10\lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 260, in get_chats result["lastMessage"] = create_message( File "C:\Users\VKP\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-C9JxXxb6-py3.10\lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\message_model.py", line 14, in __init__ author = user.get_authed().find_user_by_identifier(option["fromUser"]["id"]) TypeError: 'NoneType' object is not subscriptable
i have this problem.
I ran into the same problem. It looks like the problem with this is that suddenly OF started showing "Message not available" when a model deletes their message. If you want to fix this you just have to go to the message and click on it then refresh the page to make sure that deleted message isn't cached anymore. It's hard to find which message is doing it sometimes so I just added a print statement in that message_modal.py file and printing the user when the option parameter is null.
@22none Can you share what you added? Tried and it doesn't work,
@Tecpulit I actually don't recommend adding the code anymore. This was really unreliable especially with more models. I think the best solution for now is to set messages and paid_contents to false in the settings. This makes it so you only have to worry about the one model you're trying to scrape at a time. And not all the models. But if you still want to know what code I added to see which model message was erroring out it was this:
starting at line 15 in AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-ZNou5aO8-py3.11\Lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\message_model.py
I added: # print("USER__") # json.dump(option, sys.stdout) # print("\n Message \n") # print(user.get_username()) # print("\n") This is my first time writing in python though. and you still have to run it then it will error out but it will output the last model which should be the problem model. Then you can fix it like I said above.
*Note you also have to add the json import and sys import at the top of the message_model.py file
I also experienced the same problem. As mentioned by other users, my problem was related to messages: I deleted them all and everything worked great again!