ArchivedUltimaScraper icon indicating copy to clipboard operation
ArchivedUltimaScraper copied to clipboard

aiohttp.client_exceptions.ClientConnectionError: Connection closed

Open CannotTouch opened this issue 1 year ago • 11 comments

Thanks for the fix at the other error, but with the latest commit, after the update i receive this new error (always fresh install with only auth and config imported)

E:\UltimaScraper-master>poetry run python start_us.py Traceback (most recent call last): File "E:\UltimaScraper-master\start_us.py", line 62, in asyncio.run(main()) File "C:\Users*\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "E:\UltimaScraper-master\start_us.py", line 44, in main _api = await USR.start( ^^^^^^^^^^^^^^^^ File "E:\UltimaScraper-master\ultima_scraper\ultima_scraper.py", line 50, in start await self.start_datascraper(datascraper) File "E:\UltimaScraper-master\ultima_scraper\ultima_scraper.py", line 88, in start_datascraper setup, subscriptions = await datascraper.account_setup( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_collection\modules\module_streamliner.py", line 398, in account_setup await datascraper.manage_subscriptions( File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_collection\modules\module_streamliner.py", line 348, in manage_subscriptions results = await self.datascraper.get_all_subscriptions( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_collection\managers\datascraper_manager\datascrapers\onlyfans.py", line 157, in get_all_subscriptions results = await authed.get_subscriptions( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 360, in get_subscriptions results2 = await asyncio.gather(tasks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 331, in multi results2 = await asyncio.gather(tasks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 245, in get_user response = await self.session_manager.json_request(link) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_api\managers\session_manager.py", line 230, in json_request json_resp = await response.json() ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\aiohttp\client_reqrep.py", line 1099, in json await self.read() File "C:\Users*\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\aiohttp\client_reqrep.py", line 1037, in read self._body = await self.content.read() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users***\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\aiohttp\streams.py", line 349, in read raise self._exception aiohttp.client_exceptions.ClientConnectionError: Connection closed

CannotTouch avatar Apr 21 '23 15:04 CannotTouch

Same error here, also new install.

Aer3x avatar Apr 21 '23 19:04 Aer3x

Getting the exact same error on dfcace3813aac3a0580d651574bc1e6a179641ff

If you've got subscriptions expiring and need to find a commit that works, I've downgraded back to b7dfad5507d437a9d3f63d05b3c6e68be774cdd2 and it's going again after applying this fix.

spiderzero3 avatar Apr 21 '23 23:04 spiderzero3

Same error on fresh install

ilovescraperz avatar Apr 22 '23 22:04 ilovescraperz

Same problem... have run python updater.py so that everything is up to date. Doesn't load anything just spits out this error straight away after running poetry run python start_us.py! Versions: Poetry (version 1.3.2) Python 3.10.10 Error:

Traceback (most recent call last): File "F:\Setups\Downloaders\DIGITALCRIMINALS\start_us.py", line 62, in asyncio.run(main()) File "C:\Users<USER>\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users<USER>\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "F:\Setups\Downloaders\DIGITALCRIMINALS\start_us.py", line 44, in main _api = await USR.start( File "F:\Setups\Downloaders\DIGITALCRIMINALS\ultima_scraper\ultima_scraper.py", line 50, in start await self.start_datascraper(datascraper) File "F:\Setups\Downloaders\DIGITALCRIMINALS\ultima_scraper\ultima_scraper.py", line 88, in start_datascraper setup, subscriptions = await datascraper.account_setup( File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\ultima_scraper_collection\modules\module_streamliner.py", line 402, in account_setup await datascraper.manage_subscriptions( File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\ultima_scraper_collection\modules\module_streamliner.py", line 352, in manage_subscriptions results = await self.datascraper.get_all_subscriptions( File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\ultima_scraper_collection\managers\datascraper_manager\datascrapers\onlyfans.py", line 157, in get_all_subscriptions results = await authed.get_subscriptions( File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 360, in get_subscriptions results2 = await asyncio.gather(*tasks) File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 331, in multi results2 = await asyncio.gather(*tasks) File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\ultima_scraper_api\apis\onlyfans\classes\auth_model.py", line 245, in get_user response = await self.session_manager.json_request(link) File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\ultima_scraper_api\managers\session_manager.py", line 230, in json_request json_resp = await response.json() File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\aiohttp\client_reqrep.py", line 1099, in json await self.read() File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\aiohttp\client_reqrep.py", line 1037, in read self._body = await self.content.read() File "C:\Users<USER>\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\lib\site-packages\aiohttp\streams.py", line 349, in read raise self._exception aiohttp.client_exceptions.ClientConnectionError: Connection closed

randomhappysack avatar Apr 23 '23 08:04 randomhappysack

In ultima_scraper_api/managers/session_manager.py line ~228 relpace the function with the code above, some model profile are broken.

    async def json_request(self, url: str):
        try:
            response = await self.request(url)
            json_resp = await response.json()
            return json_resp
        except Exception as _e:
            print(url)
            return {}

MinaroShikuchi avatar Apr 24 '23 19:04 MinaroShikuchi

i don't have this directory

CannotTouch avatar Apr 25 '23 06:04 CannotTouch

i don't have this directory

i found the file in C:\Users\%USER%\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\Lib\site-packages\ultima_scraper_api\managers if that helps

randomhappysack avatar Apr 25 '23 11:04 randomhappysack

i don't have this directory

i found the file in C:\Users\%USER%\AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-eLkPGXfx-py3.10\Lib\site-packages\ultima_scraper_api\managers if that helps

thanks but the fix didn't works for me :(

CannotTouch avatar Apr 25 '23 13:04 CannotTouch

In ultima_scraper_api/managers/session_manager.py line ~228 relpace the function with the code above, some model profile are broken.

    async def json_request(self, url: str):
        try:
            response = await self.request(url)
            json_resp = await response.json()
            return json_resp
        except Exception as _e:
            print(url)
            return {}

Bro this fixed my issue, thank you!! I made a GitHub account just to tell you lol

dudebroguy45 avatar Apr 28 '23 19:04 dudebroguy45

Today it fixed that for me too. Just double check that is the latest directory under the virtualenvs one For example for me is: AppData\Local\pypoetry\Cache\virtualenvs\ultima-scraper-IdHmQS-O-py3.11\Lib\site-packages\ultima_scraper_api\managers

Thanks for the fix

CannotTouch avatar Apr 29 '23 07:04 CannotTouch

How do I find that in docker?

johnwig avatar May 03 '23 17:05 johnwig