pkejval / uld-docker

8 stars 3 forks source link

`Error: Error solving the challenge` and then 500 #9

Open VasekPurchart opened 11 months ago

VasekPurchart commented 11 months ago

Hello, I arrived here from https://github.com/setnicka/ulozto-downloader/pull/173 trying to test the new changes, but it does not work for me. I don't know if I should report here or there, but since I will be showing logs from this image, I figured better here.

Full log ``` vasek@home-ubuntu:/data$ docker run --rm -it -e DEBUG=1 -e ENFORCE_TOR=1 -v /data/downloads:/downloads pkejval/uld-docker:main https://ulozto.cz/file/TKvQVDFBEhtL/debian-9-6-0-amd64-netinst-iso Debug enabled! Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr flush_l1d arch_capabilities Starting FlareSolverr and waiting to its startup Flaresolverr still not ready! Waiting 1 second more. 60 tries remaining before exit. 2023-11-12 10:41:00 INFO FlareSolverr 3.3.7 2023-11-12 10:41:00 INFO Testing web browser installation... 2023-11-12 10:41:00 INFO Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.35 2023-11-12 10:41:00 INFO Chrome / Chromium path: /app/flaresolverr/chrome/chrome 2023-11-12 10:41:00 INFO Chrome / Chromium major version: 115 2023-11-12 10:41:00 INFO Launching web browser... Flaresolverr still not ready! Waiting 1 second more. 59 tries remaining before exit. 2023-11-12 10:41:01 INFO FlareSolverr User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 2023-11-12 10:41:01 INFO Test successful! 2023-11-12 10:41:01 INFO Serving on http://0.0.0.0:8191 Starting ulozto-downloader for https://ulozto.cz/file/TKvQVDFBEhtL/debian-9-6-0-amd64-netinst-iso 2023-11-12 10:41:02.171296: I tensorflow/core/util/port.cc:111] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-11-12 10:41:02.172537: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-11-12 10:41:02.191330: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2023-11-12 10:41:02.191351: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2023-11-12 10:41:02.191374: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2023-11-12 10:41:02.195394: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-11-12 10:41:02.195526: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-11-12 10:41:02.687357: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT 2023-11-12 10:41:02 INFO Incoming request => POST /v1 body: {'cmd': 'sessions.list'} 2023-11-12 10:41:02 INFO Response in 0.001 s 2023-11-12 10:41:02 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK 2023-11-12 10:41:10 INFO Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'proxy': {'url': 'socks5://127.0.0.1:9050'}} 2023-11-12 10:41:10 INFO Response in 0.571 s 2023-11-12 10:41:10 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK 2023-11-12 10:41:10 INFO Incoming request => POST /v1 body: {'maxTimeout': 90000, 'proxy': {'url': 'socks5://127.0.0.1:9050'}, 'session': 'fe3b0972-8147-11ee-889e-0242ac110003', 'url': 'https://ulozto.cz/file/TKvQVDFBEhtL/debian-9-6-0-amd64-netinst-iso', 'cmd': 'request.get'} 2023-11-12 10:41:13 ERROR Error: Error solving the challenge. Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser. 2023-11-12 10:41:13 INFO Response in 2.867 s 2023-11-12 10:41:13 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error {"status": "initializing"} 2023-11-12 10:41:13 INFO Incoming request => POST /v1 body: {'cmd': 'sessions.destroy', 'session': 'fe3b0972-8147-11ee-889e-0242ac110003'} ulozto-downloader is initializing... {"tor": "TOR started"} Tor: TOR started 2023-11-12 10:41:13 INFO Response in 0.107 s 2023-11-12 10:41:13 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK 11/12/23 10:41:14 - Done downloading ```

What threw me off first was the Done downloading + 200 even though nothing was downloaded. It was already mentioned in #7 and would be probably a nice improvement :)

2023-11-12 10:41:10 INFO     Incoming request => POST /v1 body: {'maxTimeout': 90000, 'proxy': {'url': 'socks5://127.0.0.1:9050'}, 'session': 'fe3b0972-8147-11ee-889e-0242ac110003', 'url': 'https://ulozto.cz/file/TKvQVDFBEhtL/debian-9-6-0-amd64-netinst-iso', 'cmd': 'request.get'}
2023-11-12 10:41:13 ERROR    Error: Error solving the challenge. Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser.
2023-11-12 10:41:13 INFO     Response in 2.867 s
2023-11-12 10:41:13 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error
{"status": "initializing"}

This seems weird to me, I do not think I am banned:

vasek@home-ubuntu:/data$ curl -I https://ulozto.cz/file/TKvQVDFBEhtL/debian-9-6-0-amd64-netinst-iso
HTTP/2 200 
date: Sun, 12 Nov 2023 11:01:47 GMT
content-type: text/html; charset=utf-8
x-frame-options: SAMEORIGIN
set-cookie: _nss=1; path=/; secure; HttpOnly; SameSite=Strict
set-cookie: ULOSESSID=n72aeh8679q6tp775um289hhvm; expires=Sun, 26-Nov-2023 11:01:47 GMT; Max-Age=1209600; path=/; domain=.ulozto.cz; secure; HttpOnly; SameSite=Lax
set-cookie: uloztoid=349169278; expires=Mon, 11-Nov-2024 11:01:47 GMT; Max-Age=31536000; path=/; domain=ulozto.cz; secure; SameSite=None
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
vary: X-Requested-With
x-node-name: ulozto9
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=jg%2BTz49M7QlM2rWj5UHeJWUjtA9SHGuSy%2Bg7UMxKJguuGK3Tr5UzSczhP7KwDSxtNipXrIHBFYL6nPmVsQ36sJp1KkxPhwpqi4gkTPxYEwMU596bSv1p8%2FM7BpY%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 824e476cf9a24113-PRG
alt-svc: h3=":443"; ma=86400

But if the request goes through Tor I guess this is not relevant, because it would be speaking about the Tor exit IP? Or is this not going through Tor?

Then I tried also without ENFORCE_TOR=1 and there is perhaps slightly more information about why there is an error:

Full log ``` vasek@home-ubuntu:/data$ docker run --rm -it -e DEBUG=1 -v /data/downloads:/downloads pkejval/uld-docker:main https://ulozto.cz/file/TKvQVDFBEhtL/debian-9-6-0-amd64-netinst-iso Debug enabled! Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced t pr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_r eq umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr flush_l1d arch_capabilities Starting FlareSolverr and waiting to its startup Flaresolverr still not ready! Waiting 1 second more. 60 tries remaining before exit. 2023-11-12 10:59:58 INFO FlareSolverr 3.3.7 2023-11-12 10:59:58 INFO Testing web browser installation... 2023-11-12 10:59:58 INFO Platform: Linux-5.15.0-75-generic-x86_64-with-glibc2.35 2023-11-12 10:59:58 INFO Chrome / Chromium path: /app/flaresolverr/chrome/chrome 2023-11-12 10:59:58 INFO Chrome / Chromium major version: 115 2023-11-12 10:59:58 INFO Launching web browser... Flaresolverr still not ready! Waiting 1 second more. 59 tries remaining before exit. 2023-11-12 11:00:00 INFO FlareSolverr User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 2023-11-12 11:00:00 INFO Test successful! 2023-11-12 11:00:00 INFO Serving on http://0.0.0.0:8191 Starting ulozto-downloader for https://ulozto.cz/file/TKvQVDFBEhtL/debian-9-6-0-amd64-netinst-iso 2023-11-12 11:00:00.884373: I tensorflow/core/util/port.cc:111] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENA BLE_ONEDNN_OPTS=0`. 2023-11-12 11:00:00.885678: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-11-12 11:00:00.904824: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered 2023-11-12 11:00:00.904840: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered 2023-11-12 11:00:00.904860: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered 2023-11-12 11:00:00.908948: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-11-12 11:00:00.909104: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-11-12 11:00:01.400646: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT 2023-11-12 11:00:01 INFO Incoming request => POST /v1 body: {'cmd': 'sessions.list'} 2023-11-12 11:00:01 INFO Response in 0.0 s 2023-11-12 11:00:01 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK 2023-11-12 11:00:10 INFO Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'proxy': {'url': 'socks5://127.0.0.1:9050'}} 2023-11-12 11:00:11 INFO Response in 0.555 s 2023-11-12 11:00:11 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK 2023-11-12 11:00:11 INFO Incoming request => POST /v1 body: {'maxTimeout': 90000, 'proxy': {'url': 'socks5://127.0.0.1:9050'}, 'session': 'a5e108a0-814a-11ee-8610-0242ac110003', 'url': 'https://ulozto.cz/download-dialog/free/download?fileSlug=TKvQVDFBEhtL', 'cmd': 'request.get'} 2023-11-12 11:00:13 ERROR Error: Error solving the challenge. Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser. 2023-11-12 11:00:13 INFO Response in 2.408 s 2023-11-12 11:00:13 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error Traceback (most recent call last): File "/app/ulozto-downloader/ulozto-downloader.py", line 7, in {"status": "initializing"} cmd.run() File "/app/ulozto-downloader/uldlib/cmd.py", line 157, in run d.download(url, args.parts, args.password, args.output, args.temp, args.yes, args.conn_timeout, args.enforce_tor) File "/app/ulozto-downloader/uldlib/downloader.py", line 282, in download download_url = next(self.captcha_download_links_generator) File "/app/ulozto-downloader/uldlib/page.py", line 335, in captcha_download_links_generator r = self.cfsolver.get(self.captchaURL) File "/app/ulozto-downloader/uldlib/cfsolver.py", line 177, in get return self.request(target, timeout, 'request.get') File "/app/ulozto-downloader/uldlib/cfsolver.py", line 172, in request raise RuntimeError(f"Cloudflare solver error: {result.get('message')}") RuntimeError: Cloudflare solver error: Error: Error solving the challenge. Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser. ulozto-downloader is initializing... {"tor": "TOR started"} 2023-11-12 11:00:13 INFO Incoming request => POST /v1 body: {'cmd': 'sessions.destroy', 'session': 'a5e108a0-814a-11ee-8610-0242ac110003'} Tor: TOR started {"captcha": "TOR get new CAPTCHA (timeout 30 sec)"} Captcha: TOR get new CAPTCHA (timeout 30 sec) {"captcha": "TOR get new CAPTCHA (timeout 30 sec)"} Captcha: TOR get new CAPTCHA (timeout 30 sec) {"captcha": "Solving Cloudflare WAF challenge (timeout 90 sec)..."} Captcha: Solving Cloudflare WAF challenge (timeout 90 sec)... 2023-11-12 11:00:13 INFO Response in 0.104 s 2023-11-12 11:00:13 INFO 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK 11/12/23 11:00:13 - Done downloading ```
2023-11-12 11:00:11 INFO     Incoming request => POST /v1 body: {'maxTimeout': 90000, 'proxy': {'url': 'socks5://127.0.0.1:9050'}, 'session': 'a5e108a0-814a-11ee-8610-0242ac110003', 'url': 'https://ulozto.cz/download-dialog/free/download?fileSlug=TKvQVDFBEhtL', 'cmd': 'request.get'}
2023-11-12 11:00:13 ERROR    Error: Error solving the challenge. Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser.
2023-11-12 11:00:13 INFO     Response in 2.408 s
2023-11-12 11:00:13 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error
Traceback (most recent call last):
  File "/app/ulozto-downloader/ulozto-downloader.py", line 7, in <module>
{"status": "initializing"}
    cmd.run()
  File "/app/ulozto-downloader/uldlib/cmd.py", line 157, in run
    d.download(url, args.parts, args.password, args.output, args.temp, args.yes, args.conn_timeout, args.enforce_tor)
  File "/app/ulozto-downloader/uldlib/downloader.py", line 282, in download
    download_url = next(self.captcha_download_links_generator)
  File "/app/ulozto-downloader/uldlib/page.py", line 335, in captcha_download_links_generator
    r = self.cfsolver.get(self.captchaURL)
  File "/app/ulozto-downloader/uldlib/cfsolver.py", line 177, in get
    return self.request(target, timeout, 'request.get')
  File "/app/ulozto-downloader/uldlib/cfsolver.py", line 172, in request
    raise RuntimeError(f"Cloudflare solver error: {result.get('message')}")
RuntimeError: Cloudflare solver error: Error: Error solving the challenge. Cloudflare has blocked this request. Probably your IP is banned for this site, check in your web browser.

But also this time it is (probably) for a different URL: https://ulozto.cz/download-dialog/free/download?fileSlug=TKvQVDFBEhtL.

Has anyone encountered such behavior or do you please have any tips what to try?

pkejval commented 11 months ago

Hello, I just downloaded cough cough 4 Arch Linux ISOs and it worked for me. But I think there is problem with cfsupport itself because I got multiple captcha errors while downloading.

Captcha: ERROR: Cannot parse CAPTCHA image URL from the page. Changing Tor circuit.
Captcha: TOR get new CAPTCHA (timeout 30 sec)
Captcha: Solving Cloudflare WAF challenge (timeout 90 sec)...

Download is very slow because cfsolver is still timeouting.... I'm sorry I can't help in this repo.

About "Done downloading". It's only message after ulozto-downloader exits - regardless its exit code. https://github.com/pkejval/uld-docker/blob/c597c5f3cfa119653aec0e857e68d83765695b31/run.sh#L80

Mikkauser commented 10 months ago

Hello, I just downloaded cough cough 4 Arch Linux ISOs and it worked for me. But I think there is problem with cfsupport itself because I got multiple captcha errors while downloading.

Captcha: ERROR: Cannot parse CAPTCHA image URL from the page. Changing Tor circuit.
Captcha: TOR get new CAPTCHA (timeout 30 sec)
Captcha: Solving Cloudflare WAF challenge (timeout 90 sec)...

Download is very slow because cfsolver is still timeouting.... I'm sorry I can't help in this repo.

About "Done downloading". It's only message after ulozto-downloader exits - regardless its exit code.

https://github.com/pkejval/uld-docker/blob/c597c5f3cfa119653aec0e857e68d83765695b31/run.sh#L80

Pekny den, prosim ktory fork momentalne funguje s rychlejsim stahovanim? Niekto v starych vlaknach doporucil pouzit nizsiu verziu, ale tych vlakien je uz tolko, ze naozaj netusim co funguje. je tu velmi vela vlakien :( Diky za pomoc ! Hello, please which fork or version is currently working ? I am kinda confused which one to choose or how to install eventually after the choice :(