DIGITALCRIMINAL / ArchivedUltimaScraper

Scrape content from OnlyFans and Fansly
GNU General Public License v3.0
943 stars 39 forks source link

aiohttp.client_exceptions.ClientConnectionError: Connection closed #953

Open CannotTouch opened 1 year ago

CannotTouch commented 1 year ago

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

Aer3x commented 1 year ago

Same error here, also new install.

spiderzero3 commented 1 year ago

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.

ilovescraperz commented 1 year ago

Same error on fresh install

randomhappysack commented 1 year ago

_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\\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\\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\\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\\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\\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\\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\\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\\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\\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\\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\\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\\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

MinaroShikuchi commented 1 year ago

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 {}
CannotTouch commented 1 year ago

i don't have this directory

randomhappysack commented 1 year ago

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_

CannotTouch commented 1 year ago

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 :(

dudebroguy45 commented 1 year ago

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

CannotTouch commented 1 year ago

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

johnwig commented 1 year ago

How do I find that in docker?