ltsdw / gofile-downloader

Download files from https://gofile.io
GNU General Public License v3.0
154 stars 38 forks source link

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' #19

Closed Sonic3R closed 10 months ago

Sonic3R commented 10 months ago

Hi,

I run script in linux with python Python 3.9.2:

python3 gofile-downloader.py https://gofile.io/d/aBcDeF

or

./gofile-downloader.py https://gofile.io/d/aBcDeF

and I get

Traceback (most recent call last): File "/home/myuser/tools/gofile-downloader/gofile-downloader.py", line 48, in class Main: File "/home/myuser/tools/gofile-downloader/gofile-downloader.py", line 49, in Main def init(self, url: str, password: str | None = None, max_workers: int = 5) -> None: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

ltsdw commented 10 months ago

Hello, could you please check this https://github.com/ltsdw/gofile-downloader/issues/4#issuecomment-1223643143?

Basically you need at least python 3.10.

Sonic3R commented 10 months ago

I upgraded python 3.12.1 and reinstalled packages with pip:

’‘’

pip install -r requirements.txt --force-reinstall Collecting certifi==2022.6.15 Using cached certifi-2022.6.15-py3-none-any.whl (160 kB) Collecting charset-normalizer==2.1.0 Using cached charset_normalizer-2.1.0-py3-none-any.whl (39 kB) Collecting idna==3.3 Using cached idna-3.3-py3-none-any.whl (61 kB) Collecting requests==2.28.1 Using cached requests-2.28.1-py3-none-any.whl (62 kB) Collecting urllib3==1.26.9 Using cached urllib3-1.26.9-py2.py3-none-any.whl (138 kB) Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests Attempting uninstall: urllib3 Found existing installation: urllib3 1.26.9 Uninstalling urllib3-1.26.9: Successfully uninstalled urllib3-1.26.9 Attempting uninstall: idna Found existing installation: idna 3.3 Uninstalling idna-3.3: Successfully uninstalled idna-3.3 Attempting uninstall: charset-normalizer Found existing installation: charset-normalizer 2.1.0 Uninstalling charset-normalizer-2.1.0: Successfully uninstalled charset-normalizer-2.1.0 Attempting uninstall: certifi Found existing installation: certifi 2022.6.15 Uninstalling certifi-2022.6.15: Successfully uninstalled certifi-2022.6.15 Attempting uninstall: requests Found existing installation: requests 2.28.1 Uninstalling requests-2.28.1: Successfully uninstalled requests-2.28.1 Successfully installed certifi-2022.6.15 charset-normalizer-2.1.0 idna-3.3 request... ’’’

but

Traceback (most recent call last): File "/home/myuser/tools/gofile-downloader/gofile-downloader.py", line 7, in from requests import get ModuleNotFoundError: No module named 'requests'

ltsdw commented 10 months ago

It means that python can't find the modules pip installed, can you check which pip version you have? Maybe it's using python2 insteand of python3.

Try running pip3 install -r requirements.txt and see if that changes something.

Sonic3R commented 10 months ago

Oh, my second fault, I had to use pip3 for installing

it works now