DIGITALCRIMINAL / ArchivedUltimaScraper

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

Unclosed client session #248

Closed Troll180 closed 2 years ago

Troll180 commented 2 years ago

Hi, since ~2 days, I'm getting this error when I try to scrap Fansly, everything work well for OF. Running python 3.10.1, auth is updated, also ran the "updater.py". Here's what I get when I run "python start_ofd.py -v" , hope that help.

Auth (V1) Attempt 1/10
Welcome None | XXXXX
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C4AB50D840>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C4AB683490>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C4AB683580>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C4AB50DA20>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C4AB683520>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C4AB50C820>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001C4AB683550>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 77, in <module>
    asyncio.run(main())
  File "D:\Program Files (x86)\Python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 62, in main
    api = await main_datascraper.start_datascraper(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 135, in start_datascraper
    setup, subscriptions = await module.account_setup(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 106, in account_setup
    subscriptions += await manage_subscriptions(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 1266, in manage_subscriptions
    results2 = await authed.get_subscriptions(identifiers=identifiers, refresh=refresh)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\apis\fansly\classes\auth_model.py", line 315, in get_subscriptions
    results += await asyncio.gather(*tasks)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\apis\fansly\classes\auth_model.py", line 304, in multi
    valid_subscriptions.following
AttributeError: 'ErrorDetails' object has no attribute 'following'

Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001C4A7A3EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001C4A7A3EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001C4A7A3EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001C4A7A3EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001C4A7A3EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001C4A7A3EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
DIGITALCRIMINAL commented 2 years ago

Try latest commit

Troll180 commented 2 years ago

I ran the updater.py (don't mind my file name) and still get :

Auth (V1) Attempt 1/10
Welcome XXXXX
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x00000281475C7610>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000002814749B340>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x00000281475C4490>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000002814749B250>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 74, in <module>
    asyncio.run(main())
  File "D:\Program Files (x86)\Python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 61, in main
    api = await main_datascraper.start_datascraper(json_config, site_name_lower)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 128, in start_datascraper
    await default(datascraper)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 68, in default
    setup, subscriptions = await account_setup(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\helpers\main_helper.py", line 1013, in account_setup
    await datascraper.manage_subscriptions(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 50, in manage_subscriptions
    results2 = await authed.get_subscriptions(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\apis\fansly\classes\auth_model.py", line 334, in get_subscriptions
    results += await asyncio.gather(*tasks)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\apis\fansly\classes\auth_model.py", line 323, in multi
    valid_subscriptions.following
AttributeError: 'ErrorDetails' object has no attribute 'following'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002814380EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002814380EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002814380EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002814380EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002814380EB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
DIGITALCRIMINAL commented 2 years ago

Update script, it should work now

Troll180 commented 2 years ago

No more "Unclosed session client" but still this error: (ran updater.py and installed the new requirements)

Auth (V1) Attempt 1/10
Welcome XXXXX
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 74, in <module>
    asyncio.run(main())
  File "D:\Program Files (x86)\Python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 61, in main
    api = await main_datascraper.start_datascraper(json_config, site_name_lower)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 128, in start_datascraper
    await default(datascraper)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 68, in default
    setup, subscriptions = await account_setup(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\helpers\main_helper.py", line 1002, in account_setup
    await datascraper.manage_subscriptions(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 54, in manage_subscriptions
    for found in [x for x in results if x.username == result2.username]:
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 54, in <listcomp>
    for found in [x for x in results if x.username == result2.username]:
AttributeError: 'ErrorDetails' object has no attribute 'username'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002E96FEEEB00>
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 116, in __del__
    self.close()
  File "D:\Program Files (x86)\Python\lib\asyncio\proactor_events.py", line 108, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 745, in call_soon
    self._check_closed()
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 510, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
DIGITALCRIMINAL commented 2 years ago

Try latest commit

Troll180 commented 2 years ago

Now I see profiles, I can select one but when I put "0" "1" "2" whatever, to download, I get this :

I also can add that it doesnt ignore my "free" subs anymore, only on Fansly still.

Scrape: 0 = All | 1 = Images | 2 = Videos | 3 = Audios | 4 = Texts
0
Type: Profile
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 74, in <module>
    asyncio.run(main())
  File "D:\Program Files (x86)\Python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 61, in main
    api = await main_datascraper.start_datascraper(json_config, site_name_lower)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 128, in start_datascraper
    await default(datascraper)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 96, in default
    await main_helper.process_jobs(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\helpers\main_helper.py", line 1034, in process_jobs
    await datascraper.start_datascraper(authed, subscription.username)  # type: ignore
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 140, in start_datascraper
    await prepare_scraper(authed, item)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 693, in prepare_scraper
    await profile_scraper(subscription, api_type)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 300, in profile_scraper
    media_options = subscription.header["locations"]
TypeError: 'NoneType' object is not subscriptable
DIGITALCRIMINAL commented 2 years ago

Use latest commit

Troll180 commented 2 years ago

With the most recent commit, it does this with every profile, free or paid :

Scrape: 0 = All | 1 = Images | 2 = Videos | 3 = Audios | 4 = Texts
0
Type: Profile
Type: Stories
No Stories Found.
Type: Posts
Type: Archived Posts
Processing Scraped Posts
100%|██████████████████████████████████████████████████████████████████████████████| 512/512 [00:00<00:00, 8822.79it/s]
Processing metadata.
Traceback (most recent call last):
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 74, in <module>
    asyncio.run(main())
  File "D:\Program Files (x86)\Python\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "D:\Program Files (x86)\Python\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\start_ofd.py", line 61, in main
    api = await main_datascraper.start_datascraper(json_config, site_name_lower)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 119, in start_datascraper
    await default(datascraper)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\datascraper\main_datascraper.py", line 90, in default
    await main_helper.process_jobs(datascraper, subscription_list, site_settings)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\helpers\main_helper.py", line 1039, in process_jobs
    await datascraper.start_datascraper(authed, subscription.username)  # type: ignore
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 140, in start_datascraper
    await prepare_scraper(authed, item)
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 746, in prepare_scraper
    old_metadata, delete_metadatas = await process_legacy_metadata(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 621, in process_legacy_metadata
    legacy_metadata_object, delete_legacy_metadatas = await legacy_metadata_fixer(
  File "D:\Program Files (x86)\Python\OnlyFans-7.6.1\modules\fansly.py", line 771, in legacy_metadata_fixer
    new_metadata_set = main_helper.import_archive(new_metadata_filepath)
AttributeError: module 'helpers.main_helper' has no attribute 'import_archive'
DIGITALCRIMINAL commented 2 years ago

Try latest commit

Troll180 commented 2 years ago

Woohoo, it work this time:) Thanks for your work.