DIGITALCRIMINAL / ArchivedUltimaScraper

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

Traceback error: RuntimeError: Event loop is closed #664

Closed prockerxoxo closed 1 year ago

prockerxoxo commented 2 years ago

Not sure what's going on but this is the issue I've been having

Traceback (most recent call last):
  File "F:\OnlyFans-7.6.1\start_ofd.py", line 66, in <module>
    asyncio.run(main())
  File "C:\Users\brand\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\brand\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "F:\OnlyFans-7.6.1\start_ofd.py", line 52, in main
    api = await main_datascraper.start_datascraper(config, site_name)
  File "F:\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 131, in start_datascraper
    await default(datascraper)
  File "F:\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 74, in default
    setup, subscriptions = await account_setup(
  File "F:\OnlyFans-7.6.1\helpers\main_helper.py", line 991, in account_setup
    imported = import_json(metadata_filepath)
  File "F:\OnlyFans-7.6.1\helpers\main_helper.py", line 761, in import_json
    json_file = orjson.loads(json_path.open(encoding="utf-8").read())
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001ED8D276170>
Traceback (most recent call last):
  File "C:\Users\brand\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Users\brand\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Users\brand\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "C:\Users\brand\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
winimalism commented 2 years ago

Same error for me, at a slightly different location, but probably for the same reason:

Traceback (most recent call last):
  File "V:\OnlyFans\start_ofd.py", line 66, in <module>
    asyncio.run(main())
  File "C:\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "V:\OnlyFans\start_ofd.py", line 52, in main
    api = await main_datascraper.start_datascraper(config, site_name)
  File "V:\OnlyFans\datascraper\main_datascraper.py", line 131, in start_datascraper
    await default(datascraper)
  File "V:\OnlyFans\datascraper\main_datascraper.py", line 101, in default
    await main_helper.process_jobs(datascraper, subscription_list, site_settings)
  File "V:\OnlyFans\helpers\main_helper.py", line 1026, in process_jobs
    await datascraper.start_datascraper(authed, subscription.username)
  File "V:\OnlyFans\modules\module_streamliner.py", line 84, in start_datascraper
    await self.prepare_scraper(subscription, content_type)
  File "V:\OnlyFans\modules\module_streamliner.py", line 232, in prepare_scraper
    master_set.extend(await self.datascraper.get_all_stories(subscription))
  File "V:\OnlyFans\modules\onlyfans.py", line 388, in get_all_stories
    highlights = await subscription.get_highlights()
  File "V:\OnlyFans\apis\onlyfans\classes\user_model.py", line 283, in get_highlights
    results = [create_highlight(x) for x in results["data"]]
KeyError: 'data'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000019787159F30>
Traceback (most recent call last):
  File "C:\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
CannotTouch commented 2 years ago

for me when scraping when it start download it go in error and close the window so i cannot copy the error neither :(

prockerxoxo commented 2 years ago

Same error for me, at a slightly different location, but probably for the same reason:

Traceback (most recent call last):
  File "V:\OnlyFans\start_ofd.py", line 66, in <module>
    asyncio.run(main())
  File "C:\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "V:\OnlyFans\start_ofd.py", line 52, in main
    api = await main_datascraper.start_datascraper(config, site_name)
  File "V:\OnlyFans\datascraper\main_datascraper.py", line 131, in start_datascraper
    await default(datascraper)
  File "V:\OnlyFans\datascraper\main_datascraper.py", line 101, in default
    await main_helper.process_jobs(datascraper, subscription_list, site_settings)
  File "V:\OnlyFans\helpers\main_helper.py", line 1026, in process_jobs
    await datascraper.start_datascraper(authed, subscription.username)
  File "V:\OnlyFans\modules\module_streamliner.py", line 84, in start_datascraper
    await self.prepare_scraper(subscription, content_type)
  File "V:\OnlyFans\modules\module_streamliner.py", line 232, in prepare_scraper
    master_set.extend(await self.datascraper.get_all_stories(subscription))
  File "V:\OnlyFans\modules\onlyfans.py", line 388, in get_all_stories
    highlights = await subscription.get_highlights()
  File "V:\OnlyFans\apis\onlyfans\classes\user_model.py", line 283, in get_highlights
    results = [create_highlight(x) for x in results["data"]]
KeyError: 'data'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000019787159F30>
Traceback (most recent call last):
  File "C:\Python310\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "C:\Python310\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Python310\lib\asyncio\base_events.py", line 750, in call_soon
    self._check_closed()
  File "C:\Python310\lib\asyncio\base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

They fixed your issue by editing user_model.py line 283 from: results = [create_highlight(x) for x in results["data"]] to either results = [create_highlight(x) for x in results.get("list")] or results = [create_highlight(x) for x in results.get("data")]

Both options seemed to work for people. I had that issue and now it is this issue

winimalism commented 2 years ago

They fixed your issue by editing user_model.py line 283 from: results = [create_highlight(x) for x in results["data"]] to either results = [create_highlight(x) for x in results.get("list")] or results = [create_highlight(x) for x in results.get("data")]

Both options seemed to work for people. I had that issue and now it is this issue

Changing line 283 to the following did work for my issue. (Thank you for the suggestion!) results = [create_highlight(x) for x in results.get("list")]

jadedgnome commented 1 year ago

I changed line 276 in user_model.py from:

results = [create_highlight(x) for x in results["list"]]

to

results = [create_highlight(x) for x in results.get["list"]]

it didn't give me the error anymore but it did not download any files. it just created a folder tree and saved the user avatar.