UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

TypeError: gather() takes 2 positional arguments but 427 were given

Open JbManny opened this issue 5 years ago • 14 comments

Getting the following error about gather:

I note that the "427 given" is the number of posts the creator has plus 1(426+1). I'm getting this error for every page now.

No Stories Found.
Type: Posts
Scrape Attempt: 1/100
Type: Archived Posts
Processing Scraped Posts
Traceback (most recent call last):
  File "D:\OnlyFans2\start_ofd.py", line 60, in <module>
    loop.run_until_complete(main())
  File "C:\Users\[HOSTNAME]\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "D:\OnlyFans\start_ofd.py", line 44, in main
    api = await main_datascraper.start_datascraper(
  File "D:\OnlyFans\datascraper\main_datascraper.py", line 93, in start_datascraper
    await main_helper.process_names(
  File "D:\OnlyFans\helpers\main_helper.py", line 939, in process_names
    result = await module.start_datascraper(authed, username, site_name)
  File "D:\OnlyFans\modules\onlyfans.py", line 160, in start_datascraper
    await prepare_scraper(authed, site_name, item)
  File "D:\OnlyFans\modules\onlyfans.py", line 823, in prepare_scraper
    unrefined_set = await tqdm.gather(*tasks, **settings)
TypeError: gather() takes 2 positional arguments but 427 were given

JbManny avatar Aug 13 '21 19:08 JbManny

This only occurs when I select all. I also had to remove the initial scrape it does of all the profiles or it threw another gather() error at like 420 or so.

JbManny avatar Aug 13 '21 20:08 JbManny

I keep getting something similar

Traceback (most recent call last):
  File "P:\OnlyFans-7.4.1\start_ofd.py", line 60, in 
    loop.run_until_complete(main())
  File "C:\Users\[name]\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "P:\OnlyFans-7.4.1\start_ofd.py", line 44, in main
    api = await main_datascraper.start_datascraper(
  File "P:\OnlyFans-7.4.1\datascraper\main_datascraper.py", line 90, in start_datascraper
    await module.paid_content_scraper(api, identifiers)
  File "P:\OnlyFans-7.4.1\modules\onlyfans.py", line 401, in paid_content_scraper
    unrefined_set = await tqdm.gather(*tasks, **settings)
TypeError: gather() takes 2 positional arguments but 6 were given 

Dered118 avatar Aug 14 '21 22:08 Dered118

@Poddi That's not the same issue. Your issue is "TypeError: object list can't be used in 'await' expression".

JbManny avatar Aug 16 '21 22:08 JbManny

@JbManny @Dered118 Seems to be an issue with the update made 16 days ago bumping up the version of tdqm to 4.62.

I fixed it by undoing the changes of this commit: https://github.com/DIGITALCRIMINAL/OnlyFans/commit/9917a3578f7dc9770cb9c2c4592a591b028e5fb3

Then I updated the modules using pip install --upgrade --user -r requirements.txt

That worked, there seems to be an issue with the version of tdqm being used and how the scripts call it.

myunprofessionalaccount avatar Aug 18 '21 02:08 myunprofessionalaccount

AFAIK @JbManny & @Dered118's issues are due to pulling the latest version of this repo without installing its dependencies. Reverting 9917a35 will cause @Poddi's issue (and all future users).

casperdcl avatar Aug 18 '21 09:08 casperdcl

Updating it using the requirements text was the first thing I did. Didn't help one thing.

JbManny avatar Aug 18 '21 19:08 JbManny

AFAIK @JbManny & @Dered118's issues are due to pulling the latest version of this repo without installing its dependencies. Reverting 9917a35 will cause @Poddi's issue (and all future users).

Makes a lot of sense, should have checked that first.

@JbManny did you delete the currently installed version of tdqm and then run the requirments again?

myunprofessionalaccount avatar Aug 18 '21 21:08 myunprofessionalaccount

Nope, completely removed all the required modules, then cloned a fresh copy of the repo and installed requirements.txt again, only to be greeted by the same error. I don't think that this is a case of missing dependencies after pulling changes to the repo @casperdcl

Is anyone else experiencing this?

Steps to reproduce for me:

  1. From the old repository with different dependencies, remove all dependencies from previous versions of the repo: pip uninstall -r requirements.txt -y
  2. Clone newest version of repo, install dependencies.
  3. Run the program.

myunprofessionalaccount avatar Aug 18 '21 23:08 myunprofessionalaccount

There is a fix for this, and it should lie with one of the requirements. First I need to know what platform you are using. Windows, Linux or Docker?

americanseeder1865 avatar Aug 20 '21 08:08 americanseeder1865

WARNING: The script tqdm.exe is installed in 'C:\Users\XXXX\AppData\Roaming\Python\Python39\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script alembic.exe is installed in 'C:\Users\XXXX\AppData\Roaming\Python\Python39\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

I run the script from any directory with the env variable. Anyone know how to fix this?

Gamma-Velorum avatar Aug 20 '21 18:08 Gamma-Velorum

TypeError: gather() takes 2 positional arguments but 144 were given

anything? im running 4.7.1. Tried downgrading tdqm, but nothing helps

EDIT: got it to work on tdqm version 4.62.1

pdrgrl avatar Aug 22 '21 17:08 pdrgrl

Awesome! would you mind closing this?

americanseeder1865 avatar Aug 25 '21 11:08 americanseeder1865

should work with tqdm>=4.62.0

casperdcl avatar Aug 25 '21 17:08 casperdcl

should work with tqdm>=4.62.0

Lets build from this for now. https://github.com/DIGITALCRIMINALS/OnlyFans

americanseeder1865 avatar Aug 26 '21 07:08 americanseeder1865