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
555 stars 68 forks source link

Not working in Python 2.7.17 #265

Closed d3vr closed 3 years ago

d3vr commented 4 years ago

The script is not working with Python 2.7.17. The img2pdf dependency is using a nonlocal statement which doesn't work on Python 2.7.x

Command executed: comicdl --verbose -dd . --chapter-id 4e70ea01c092255ef7004674

Stacktrace:

Traceback (most recent call last):
  File "~/comic-dl/comic_dl/__main__.py", line 4, in <module>
    from comic_dl import ComicDL
  File "~/comic-dl/comic_dl/comic_dl.py", line 11, in <module>
    import honcho
  File "~/comic-dl/comic_dl/honcho.py", line 9, in <module>
    from sites import foolSlide
  File "~/comic-dl/comic_dl/sites/foolSlide.py", line 4, in <module>
    import globalFunctions
  File "~/comic-dl/comic_dl/globalFunctions.py", line 14, in <module>
    import img2pdf
  File "~/.local/lib/python2.7/site-packages/img2pdf.py", line 2360
    nonlocal infiles

The latest img2pdf version is installed: 0.3.6 (as of the time of this writing). Link to line of code breaking the script

You should probably update the Python support section of the README.md to drop support for Python 2.7.x

Thanks.

Joshuawaaw commented 4 years ago

I'm getting the same error as well. It worked fine but then I tried using Python 3 to run the script then reverted back to Python 2 because I cant seem to make it work. Please help I dont really know python I just followed the instructions on how to install it

Here is the error that is showing up C:\Users\DELL\Downloads\comic-dl-master\comic_dl>main.py -i "http://readcomiconline.to/Comic/The-Avengers-1963" -rn "2-2" --quality "low" DEPRECATION: The OpenSSL being used by this python install (OpenSSL 1.0.2t 10 Sep 2019) does not meet the minimum supported version (>= OpenSSL 1.1.1) in order to support TLS 1.3 required by Cloudflare, You may encounter an unexpected reCaptcha or cloudflare 1020 blocks. Traceback (most recent call last): File "C:\Users\DELL\Downloads\comic-dl-master\comic_dl__main__.py", line 4, in from comic_dl import ComicDL File "C:\Users\DELL\Downloads\comic-dl-master\comic_dl\comic_dl.py", line 11, in import honcho File "C:\Users\DELL\Downloads\comic-dl-master\comic_dl\honcho.py", line 9, in from sites import foolSlide File "C:\Users\DELL\Downloads\comic-dl-master\comic_dl\sites\foolSlide.py", line 4, in import globalFunctions File "C:\Users\DELL\Downloads\comic-dl-master\comic_dl\globalFunctions.py", line 14, in import img2pdf File "C:\Python27\lib\site-packages\img2pdf.py", line 2360 nonlocal infiles ^ SyntaxError: invalid syntax

Xonshiz commented 3 years ago

I'll be porting this to support Python 3 in next update. Python 2 is obsolete and providing a support for it is just not worth the effort.