UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

KeyError: 'hasMore'

Open kayser26 opened this issue 1 year ago • 11 comments

hi, i recently updated the scraper and since then i am having the following error:

Traceback (most recent call last): File "C:\Users\K-Rig-3\Documents\GitHub\UltimaScraper\start_us.py", line 62, in asyncio.run(main()) File "C:\Users\K-Rig-3\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\K-Rig-3\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "C:\Users\K-Rig-3\Documents\GitHub\UltimaScraper\start_us.py", line 44, in main _api = await USR.start( File "C:\Users\K-Rig-3\Documents\GitHub\UltimaScraper\ultima_scraper\ultima_scraper.py", line 50, in start await self.start_datascraper(datascraper) File "C:\Users\K-Rig-3\Documents\GitHub\UltimaScraper\ultima_scraper\ultima_scraper.py", line 135, in start_datascraper final_job_user_list = await datascraper.configure_datascraper_jobs() File "C:\Users\K-Rig-3\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-0mhZ01bQ-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\K-Rig-3\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-0mhZ01bQ-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\K-Rig-3\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-0mhZ01bQ-py3.10\lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 255, in get_chats has_more = results[-1]["hasMore"] KeyError: 'hasMore'

any suggestions? thank you!

kayser26 avatar Jul 28 '24 08:07 kayser26

...anyone have a fix?...

tedy02 avatar Aug 20 '24 12:08 tedy02

I don't have a fix but I am getting this error and doing a little debugging I can see that all the requests are returning with 400 errors {'error': {'code': 400, 'message': 'Bad Request'}} for requests https://onlyfans.com/api2/v2/chats?limit=100&offset=0&order=desc Anyone have any insight as to what would be causing this?

nilejturn22 avatar Sep 15 '24 00:09 nilejturn22

I've been unable to use it for over 2 months

tedy02 avatar Sep 15 '24 19:09 tedy02

I also have the same problem, any update?

KYTON06 avatar Sep 16 '24 14:09 KYTON06

I also encountered this problem, and it was the first time I used the script. Does anyone know how to fix it?

KingwithQueen avatar Sep 24 '24 06:09 KingwithQueen

I found the only fix I could do... OFSCRAPER... there is little to no support here... :(

tedy02 avatar Sep 25 '24 02:09 tedy02

I don't have a fix but I am getting this error and doing a little debugging I can see that all the requests are returning with 400 errors {'error': {'code': 400, 'message': 'Bad Request'}} for requests https://onlyfans.com/api2/v2/chats?limit=100&offset=0&order=desc Anyone have any insight as to what would be causing this?

You may be able to bypass the issue by modifying line 109 in .venv/lib/python3.11/site-packages/ultima_scraper_collection/modules/module_streamliner.py: change chat_users = await self.get_chat_users() to chat_users = [] However, I'm not sure if this change will cause you to miss anything important that needs to be downloaded. It works for me so far.

Additionally, after making this change, you may need to update .venv/lib/python3.11/site-packages/ultima_scraper_api/apis/onlyfans/__init__.py to accommodate changes in the media_item structure from the website.

qwer288 avatar Oct 25 '24 21:10 qwer288

You may be able to bypass the issue by modifying line 109 in .venv/lib/python3.11/site-packages/ultima_scraper_collection/modules/module_streamliner.py: change chat_users = await self.get_chat_users() to chat_users = [] However, I'm not sure if this change will cause you to miss anything important that needs to be downloaded. It works for me so far.

Additionally, after making this change, you may need to update .venv/lib/python3.11/site-packages/ultima_scraper_api/apis/onlyfans/__init__.py to accommodate changes in the media_item structure from the website.

Hi, could you please explain how to do the last step and update the python3.11/site-packages/ultima_scraper_api/apis/onlyfans/init.py file? I'm using Windows and currently facing the same issue as this guy https://github.com/UltimaHoarder/UltimaScraper/issues/2121#issuecomment-2439621365. Thx!

RandomDude66613 avatar Oct 31 '24 06:10 RandomDude66613

Sure, here is my modified __init__.py file. You can backup your old file and try this one. init.txt

qwer288 avatar Nov 01 '24 15:11 qwer288

change chat_users = await self.get_chat_users() to chat_users = []

this will probably just scrape nothing as you set all chats to an empty array lol.

to generally fix "KeyError: 'hasmore'" you can disable "messages" (set it to false) in config.json

passeee avatar Dec 28 '24 15:12 passeee

requests are returning with 400 errors {'error': {'code': 400, 'message': 'Bad Request'}} for requests https://onlyfans.com/api2/v2/chats?limit=100&offset=0&order=desc

@nilejturn22 u got an idea in what file this request is sent?

passeee avatar Dec 28 '24 16:12 passeee