question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cloudflare package asking for money

See original GitHub issue

Bug report

Environment (please complete the following information):

Description Data
OS Windows 10
Python version 3.8.0
Pip version 20.1.1
Manga-py version 1.19.13
URL https://readcomiconline.to/Comic/The-New-52-Futures-End

To Reproduce:

Steps to reproduce the behavior:

  1. manga-py.exe "https://readcomiconline.to/Comic/The-New-52-Futures-End" The error is
"ERROR:\cloudscraper\__init__.py:776:2020-07-25 16:41:12,041:"https://readcomiconline.to/Comic/The-New-52-Futures-End" returned an error. Could not collect tokens."
"ERROR:\manga_py\base_classes\cf_protect.py:28:2020-07-25 16:41:12,043:Detected a Cloudflare version 2 challenge, Paid version required to solve."

Full error

Expand
"ERROR:\cloudscraper\__init__.py:776:2020-07-25 16:41:12,041:"https://readcomiconline.to/Comic/The-New-52-Futures-End" returned an error. Could not collect tokens."
"ERROR:\manga_py\base_classes\cf_protect.py:28:2020-07-25 16:41:12,043:Detected a Cloudflare version 2 challenge, Paid version required to solve."
Traceback (most recent call last):
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
         |     -> {'__name__': '__main__', '__doc__': None, '__package__': '', '__loader__': <zipimporter object "C:\Users\Rithvij\AppData\Local\P...
         -> <code object <module> at 0x000002568E3092F0, file "C:\Users\Rithvij\AppData\Local\Programs\Python\Python38\Scripts\manga-py.exe\...
  File "C:\Users\Rithvij\AppData\Local\Programs\Python\Python38\Scripts\manga-py.exe\__main__.py", line 7, in <module>
    sys.exit(main())
    |        -> <function main at 0x000002568F5D23A0>
    -> <module 'sys' (built-in)>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\util.py", line 111, in main
    exit(run_util(args))
    |    |        -> ArgumentParser(prog='manga-py', usage=None, description='%(prog)s is the universal manga downloader (for your offline reading).\...
    |    -> <function run_util at 0x000002568F5D20D0>
    -> <built-in function exit>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\util.py", line 83, in run_util
    _info = _run_util(args)
            |         -> ArgumentParser(prog='manga-py', usage=None, description='%(prog)s is the universal manga downloader (for your offline reading).\...
            -> <function _run_util at 0x000002568F5D0F70>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\util.py", line 41, in _run_util
    Cli(args, _info).start()
    |   |     -> <manga_py.info.Info object at 0x000002568F5CCEB0>
    |   -> ArgumentParser(prog='manga-py', usage=None, description='%(prog)s is the universal manga downloader (for your offline reading).\...
    -> <class 'manga_py.cli.Cli'>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\cli\__init__.py", line 47, in start

    self.parser.start()
    -> <manga_py.cli.Cli object at 0x000002568F5CCA00>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\parser.py", line 63, in start
    self.provider.process(self.params['url'], self.params)
    |                     |                   -> <manga_py.parser.Parser object at 0x000002568F5CCBE0>
    |                     -> <manga_py.parser.Parser object at 0x000002568F5CCBE0>
    -> <manga_py.parser.Parser object at 0x000002568F5CCBE0>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\provider.py", line 87, in process
    self.prepare_cookies()
    -> <manga_py.providers.readcomiconline_to.ReadComicOnlineTo object at 0x000002568E7DBEE0>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\providers\readcomiconline_to.py", line 23, in prepare_cookies
    self.cf_scrape(self.get_url())
    |              -> <manga_py.providers.readcomiconline_to.ReadComicOnlineTo object at 0x000002568E7DBEE0>
    -> <manga_py.providers.readcomiconline_to.ReadComicOnlineTo object at 0x000002568E7DBEE0>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\provider.py", line 267, in cf_scrape
    params = cf_scrape(url)
             |         -> 'https://readcomiconline.to/Comic/The-New-52-Futures-End'
             -> <function cf_scrape at 0x000002568F4E4040>
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\base_classes\cf_protect.py", line 29, in cf_scrape
    raise e
  File "c:\users\rithvij\appdata\local\programs\python\python38\lib\site-packages\manga_py\base_classes\cf_protect.py", line 22, in cf_scrape
    cookies, ua = scraper.get_tokens(url)
                  |                  -> 'https://readcomiconline.to/Comic/The-New-52-Futures-End'
                  -> <cloudscraper.CloudScraper object at 0x000002568F5CCCD0>

Additional context

Add any other context about the problem here.

I remember the Cloudflare package being https://github.com/Anorov/cloudflare-scrape/ but it was changed to this https://github.com/VeNoMouS/cloudscraper?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
1271commented, Jul 26, 2020

An alternative way to bypass cloudflare protection is to pass user-agent and cf_clearance cookies to manga-py.

Example:

manga-py https://bato.to/series/78510 --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0"  --cookies cf_clearance=9ced1dc4068fb9ecf00ef41836eec5e6ea4779b8-1595750924-0-1z876a9225zbb5514c6z30f2590-150 __cfduid=d70b43850ffa05c7a57b7856e15af43de1595750935
0reactions
1271commented, Jul 28, 2020

selenium bypasses these restrictions, that’s right. But this will not work on some devices + will add the obligation to install the browser. You can use selenium to receive cookies and pass them to manga-py It’s very easy to automate. You can also store cookies so that you don’t receive them every time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Free Plan Overview - Cloudflare
The Free Plan provides free SSL, CDN, DDoS protection and more. Cloudflare's Free plan gives you all the basics you need to protect...
Read more >
CloudFlare not removing scam websites from their DNS
CloudFlare not removing scam websites from their DNS - Hey there, Today I reported a Forex scam website on CF. The website owners,...
Read more >
Cloudflare takes aim at AWS with promise of $1.25 billion to ...
Cloudflare announced that it will help connect certain startups to venture firms that have collectively offered to invest up to $1.25B.
Read more >
Cloudflare Delivers In Turbulent Economy - Bizety
Cloudflare, the leading CDN, network, and security vendor posted ... Cloudflare draws companies to itself because it saves them money ...
Read more >
Cloudflare, Inc. (NET) Q2 2022 Earnings Call Transcript
What I'm watching closely is our free cash flow margin. It showed significant improvement quarter over quarter, and we continue to forecast it ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found