m-haisham/novelsave

[Bug] Wrong data type comparison?

addicted-ai opened this issue · 3 comments

[-] Retrieving novel info...
[-] https://www.wuxiaworld.co/Mages-Are-Too-OP/
[✓] Found 415 chapters
[-] Pending 0 chapters
Traceback (most recent call last):
File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/novelsave/main.py", line 93, in
main()
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/novelsave/main.py", line 86, in main
novelsave.download(thread_count=args.threads, limit=args.limit)
File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/novelsave/sourcesave.py", line 51, in download
if limit <= 0:
TypeError: '<=' not supported between instances of 'NoneType' and 'int'

Line 51 sourcesave.py should be
if limit is not None and limit<= 0: ??

Also userwarning about duplicate chapter name should be suppressed?

Fixed the wrong type limit in 9dd9a2a

As for the userwarning, I cant find any instructions on how to suppress it.

So userwarnings are gonna stay for now