Xonshiz / comic-dl

Comic-dl is a command line tool to download manga and comics from various comic and manga sites. Supported sites : readcomiconline.to, mangafox.me, comic naver and many more.
https://github.com/Xonshiz/comic-dl
MIT License
550 stars 68 forks source link

AttributeError: 'Namespace' object has no attribute 'search' #342

Closed ghost closed 1 year ago

ghost commented 1 year ago

First of all I'd like to thank Xonshiz for creating such a useful script! I've been trying to install it and I am unable to do so... I'm stuck at this step:

Linux/Debian users make sure that this script is executable. Just run this command, if you run into problem(s) :

chmod +x cli.py

and then, execute with this :

./cli.py

Ok so this doesn't work for me. Executing the command

./cli.py

returns the following:

greg@greg-OptiPlex-3060:~/build/comic-dl-master$ ./cli.py
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS' @ error/constitute.c/IsCoderAuthorized/413.
from: can't read /var/mail/comic_dl.__main__
./cli.py: line 6: syntax error: unexpected end of file

So I googled around a bit and found an answer on stackoverflow which says

The problem can be solved with just one of the following solutions.
- If you're using the Python interpreter, the one from the command line, then this shouldn't happen because you are simply importing the module.
- If you wrote the line of code in a Python file, suppose we call the file myfile.py, and you're trying to execute it on the command line like ./myfile.py then it's wrong because you have to write on the command line python myfile.py or python3 myfile.py, if you're using Python3
- You can simply specify the python interpreter on your file by adding at the first line of the file #!/bin/python or #!/usr/bin/python and then on the command line you can simply run your file like a bash file ./myfile.py

So I tried with python3 cli.py

greg@greg-OptiPlex-3060:~/build/comic-dl-master$ python3 cli.py
Traceback (most recent call last):
  File "cli.py", line 5, in <module>
    main()
  File "/home/greg/build/comic-dl-master/comic_dl/__main__.py", line 20, in main
    ComicDL(sys.argv[1:])
  File "/home/greg/build/comic-dl-master/comic_dl/comic_dl.py", line 168, in __init__
    if not str(args.search).strip():
AttributeError: 'Namespace' object has no attribute 'search'

What am I doing wrong? I think I correctly installed all the dependencies, I updated what needed to be updated... No issue (neither open or closed) mentions AttributeError: 'Namespace' object has no attribute 'search'.

BTW - I think the README contains some kind of typo or whatever you wanna call it: the instructions for the dependencies installation mention installing them from the requirements.txt file only in the Windows section, not in MacOS nor in Linux/Debian.

edit: forgot to mention. I'm on Linux Mint 20.3

darodi commented 1 year ago

@thecrazypozavnist

try

python3 cli.py --help

or

python3 cli.py -i URL_OF_COMIC

I create a fix for your case when there is no argument given.