Funami580 / sdl

Download multiple episodes from streaming sites
MIT License
17 stars 3 forks source link

Failed to resolve #2

Closed pavankumar-dss closed 9 months ago

pavankumar-dss commented 9 months ago

error

Funami580 commented 9 months ago

Thanks! I pushed a commit which hopefully resolves this issue.

pavankumar-dss commented 9 months ago

The build completed successfully this time but these are some warnings I encountered at the end

warning: variants Airing, Completed, OnHiatus, and Cancelled are never constructed --> src\downloaders\mod.rs:96:5 95 pub enum SeriesStatus { ------------ variants in this enum 96 Airing, ^^^^^^ 97 Completed, ^^^^^^^^^ 98 OnHiatus, ^^^^^^^^ 99 Cancelled, ^^^^^^^^^

= note: SeriesStatus has derived impls for the traits Clone and Debug, but these are intentionally ignored during dead code analysis = note: #[warn(dead_code)] on by default

warning: function sleep_jitter is never used --> src\downloaders\mod.rs:357:18 | 357 | pub async fn sleep_jitter(ms_sleep: u64, ms_jitter: u64) { | ^^^^^^^^^^^^

warning: function caesar is never used --> src\extractors\mod.rs:294:12 | 294 | pub fn caesar(input: &str, alphabet: &str, shift: i32) -> String { | ^^^^^^

warning: function rot47 is never used --> src\extractors\mod.rs:311:12 | 311 | pub fn rot47(input: &str) -> String { | ^^^^^

warning: sdl (bin "sdl") generated 4 warnings Finished release [optimized] target(s) in 6m 37s

I went ahead and ran the program and this is the error I'm facing:

E:\Stuff\SDL\target\release>sdl.exe -e 251-500 https://aniwave.to/watch/naruto-shippuden.qv3
17:18:26.438 ERROR > Failed to create ChromeDriver: could not connect to ChromeDriver: error creating new session: webdriver server gave non-conformant response: Object {"error": String("unknown error"), "message": String("unknown error: cannot find Chrome binary"), "stacktrace": String("\tGetHandleVerifier [0x00007FF736132142+3514994]\n\t(No symbol) [0x00007FF735D50CE2]\n\t(No symbol) [0x00007FF735BF76AA]\n\t(No symbol) [0x00007FF735C29850]\n\t(No symbol) [0x00007FF735C27F52]\n\t(No symbol) [0x00007FF735C70AB4]\n\t(No symbol) [0x00007FF735C65D93]\n\t(No symbol) [0x00007FF735C34BDC]\n\t(No symbol) [0x00007FF735C35C64]\n\tGetHandleVerifier [0x00007FF73615E16B+3695259]\n\tGetHandleVerifier [0x00007FF7361B6737+4057191]\n\tGetHandleVerifier [0x00007FF7361AE4E3+4023827]\n\tGetHandleVerifier [0x00007FF735E804F9+689705]\n\t(No symbol) [0x00007FF735D5C048]\n\t(No symbol) [0x00007FF735D58044]\n\t(No symbol) [0x00007FF735D581C9]\n\t(No symbol) [0x00007FF735D488C4]\n\tBaseThreadInitThunk [0x00007FFEA61A7344+20]\n\tRtlUserThreadStart [0x00007FFEA65C26B1+33]\n"), "data": Null}: webdriver server gave non-conformant response: Object {"error": String("unknown error"), "message": String("unknown error: cannot find Chrome binary"), "stacktrace": String("\tGetHandleVerifier [0x00007FF736132142+3514994]\n\t(No symbol) [0x00007FF735D50CE2]\n\t(No symbol) [0x00007FF735BF76AA]\n\t(No symbol) [0x00007FF735C29850]\n\t(No symbol) [0x00007FF735C27F52]\n\t(No symbol) [0x00007FF735C70AB4]\n\t(No symbol) [0x00007FF735C65D93]\n\t(No symbol) [0x00007FF735C34BDC]\n\t(No symbol) [0x00007FF735C35C64]\n\tGetHandleVerifier [0x00007FF73615E16B+3695259]\n\tGetHandleVerifier [0x00007FF7361B6737+4057191]\n\tGetHandleVerifier [0x00007FF7361AE4E3+4023827]\n\tGetHandleVerifier [0x00007FF735E804F9+689705]\n\t(No symbol) [0x00007FF735D5C048]\n\t(No symbol) [0x00007FF735D58044]\n\t(No symbol) [0x00007FF735D581C9]\n\t(No symbol) [0x00007FF735D488C4]\n\tBaseThreadInitThunk [0x00007FFEA61A7344+20]\n\tRtlUserThreadStart [0x00007FFEA65C26B1+33]\n"), "data": Null}

Sorry I'm not a technical guy, so I don't know what to do in this case. Any guidance would be helpful, Thanks

Funami580 commented 9 months ago

The build completed successfully this time but these are some warnings I encountered at the end

Oh, yeah you can ignore these. I changed it so these warnings won't be shown anymore when you're doing a release build.

I went ahead and ran the program and this is the error I'm facing: unknown error: cannot find Chrome binary

Ok, I made some changes which hopefully resolve this issue. Hopefully. You can try it out by rebuilding the program.

Sorry I'm not a technical guy, so I don't know what to do in this case. Any guidance would be helpful, Thanks

Don't worry. All your issues so far were caused by incorrect code. Thanks for trying to run this program, even though it didn't work so far. Let me know if you run into another issue.

pavankumar-dss commented 9 months ago

Tried again and this is what I'm facing:

E:\Stuff\SDL\target\release>sdl -e 251-500 https://aniwave.to/watch/naruto-shippuden.qv3 [7268:13780:1223/163356.969:ERROR:policy_logger.cc(156)] :components\enterprise\browser\controller\chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the --enable-chrome-browser-cloud-management command line flag to enable it if you are not using the official Google Chrome build.

DevTools listening on ws://127.0.0.1:56088/devtools/browser/b28932c7-f848-4722-ad43-580c4a7d8f14 16:34:02.774 ERROR > Failed to get series info: failed to find title: an element could not be located on the page using the given search parameters: no such element: Unable to locate element: {"method":"css selector","selector":"h1.title"} (Session info: chrome=120.0.6099.109)

Funami580 commented 9 months ago

Hmmm. Could you try sdl --debug -e 251 https://aniwave.to/watch/naruto-shippuden.qv3?

[7268:13780:1223/163356.969:ERROR:policy_logger.cc(156)] :components\enterprise\browser\controller\chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the --enable-chrome-browser-cloud-management command line flag to enable it if you are not using the official Google Chrome build.

DevTools listening on ws://127.0.0.1:56088/devtools/browser/b28932c7-f848-4722-ad43-580c4a7d8f14

Weird, these logs should be hidden.

pavankumar-dss commented 9 months ago

Well it downloaded this time just fine, So should I just use --debug param for downloading then?

E:\Stuff\SDL\target\release>sdl --debug -e 251 https://aniwave.to/watch/naruto-shippuden.qv3 21:52:27.922 TRACE > Starting ChromeDriver on port 18117 Starting ChromeDriver 120.0.6099.109 (3419140ab665596f21b385ce136419fde0924272-refs/branch-heads/6099@{#1483}) on port 18117 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. 21:52:28.496 TRACE > uBlock Origin up-to-date [11064:13708:1223/215228.975:ERROR:policy_logger.cc(156)] :components\enterprise\browser\controller\chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the --enable-chrome-browser-cloud-management command line flag to enable it if you are not using the official Google Chrome build.

DevTools listening on ws://127.0.0.1:51181/devtools/browser/27a42563-7337-4089-9f5c-e07c8b37e5ce [00:04:35] Naruto - Shippuden 1.6 MiB/s 262.7 MiB/262.7 MiB [#######################################>] (0s) 99% [00:04:35] Total 0/1 1.6 MiB/s 262.7 MiB/262.7 MiB [#######################################>] (0s) 99%ffmpeg version 6.0-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 4. 10.100 / 4. 10.100 libpostproc 57. 1.100 / 57. 1.100 [mpegts @ 000002968456b240] start time for stream 2 is not set in estimate_timings_from_pts Input #0, mpegts, from 'E:\Stuff\SDL\target\release\Naruto - Shippuden - E251 - EngSub.ts': Duration: 00:23:09.79, start: 0.101000, bitrate: 1585 kb/s Program 1 Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 90k tbn Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 131 kb/s Stream #0:2[0x102]: Data: timed_id3 (ID3 / 0x20334449) Output #0, mp4, to 'E:\Stuff\SDL\target\release\Naruto - Shippuden - E251 - EngSub.mp4': Metadata: encoder : Lavf60.3.100 Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 24 tbr, 90k tbn Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 131 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) [00:04:35] Naruto - Shippuden 1.5 MiB/s 262.7 MiB/262.7 MiB [#######################################>] (0s) 99% [00:04:36] Naruto - Shippuden 1.5 MiB/s 262.7 MiB/262.7 MiB [#######################################>] (0s) 99% [00:04:36] Naruto - Shippuden 1.5 MiB/s 262.7 MiB/262.7 MiB [#######################################>] (0s) 99% [00:04:37] Naruto - Shippuden 1.5 MiB/s 262.7 MiB/262.7 MiB [#######################################>] (0s) 99% [00:04:37] Total 0/1 1.5 MiB/s 262.7 MiB/262.7 MiB [#######################################>] (0s) 99%frame=33353 fps=20759 q=-1.0 Lsize= 259055kB time=00:23:09.71 bitrate=1527.1kbits/s speed= 865x [00:04:37] Naruto - Shippuden 970.7 KiB/s 262.7 MiB/262.7 MiB [########################################] (0s) 100% [00:04:37] Total 1/1 970.7 KiB/s 262.7 MiB/262.7 MiB [########################################] (0s) 100%

Funami580 commented 9 months ago

Perhaps it needed to be run with a visible Chrome browser once. You could try it out without the --debug argument, it may work now, too.

Funami580 commented 9 months ago

I made some more changes. Could you try to rebuild the program?

pavankumar-dss commented 9 months ago

Hello, sorry I was busy with other things, tried out the initial release and this is the error I'm facing:

E:\Downloads\SDL>sdl --debug -e 251-300 https://aniwave.to/watch/naruto-shippuden.qv3 19:40:39.037 TRACE > Starting ChromeDriver on port 24401 Starting ChromeDriver 116.0.5845.96 (1a391816688002153ef791ffe60d9e899a71a037-refs/branch-heads/5845@{#1382}) on port 24401 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. 19:40:40.890 TRACE > uBlock Origin up-to-date [9848:18180:1229/194041.071:ERROR:chrome_browser_cloud_management_controller.cc(163)] Cloud management controller initialization aborted as CBCM is not enabled.

DevTools listening on ws://127.0.0.1:53283/devtools/browser/0bb72ca1-3d62-4f9b-91d5-afed78d0eb66 19:40:45.354 ERROR > Failed to get series info: failed to find title: an element could not be located on the page using the given search parameters: no such element: Unable to locate element: {"method":"css selector","selector":"h1.title"} (Session info: chrome=116.0.5845.96)

But I don't think it is problem with the css element as it shows. The thing is aniwave is blocked in my country, and I have to use VPN to access the site, but when I run the command, the chromium window pops up, and does the cloudflare/DDoS check says failed and the window closes automatically, thus failing the operation. I think it is a timeout issue but I can't say for sure, maybe try increasing the wait time for the initial steps.

Funami580 commented 9 months ago

Hello, sorry I was busy with other things

No problem

The thing is aniwave is blocked in my country, and I have to use VPN to access the site

Using VPNs for scraping is highly discouraged. I guess your country blocked the IPs so that changing the DNS won't help? Otherwise, you should disable your VPN and change the DNS.

but when I run the command, the chromium window pops up, and does the cloudflare/DDoS check says failed and the window closes automatically, thus failing the operation. I think it is a timeout issue but I can't say for sure, maybe try increasing the wait time for the initial steps.

Oh, I see. Yes, it is a timeout issue, then. The program as it is right now doesn't expect a DDoS check to pop up.

You could try to add sleep_random(7000..=9000).await; in line 40 https://github.com/Funami580/sdl/blob/9cdfbffa4312964c123ed30ff239d16332432b96/src/downloaders/aniwave.rs#L39-L41 to wait for 7-9 seconds after loading the site, and then compile the program from source.

But since you're using a VPN I would expect this DDoS check to pop up every now and then, and I wouldn't be surprised if this requires manual intervention as I expect that they are able to detect that this is an automated browser (or perhaps not if you use the --debug flag, I don't know).

Perhaps torrenting with a VPN is the better solution for you.

Funami580 commented 9 months ago

Is there a reason why you don't try to change your DNS to e.g. 8.8.8.8? There are a ton of YouTube tutorials, too.

pavankumar-dss commented 9 months ago

Welp sorry my bad, I tried Cloudflare and OpenDNS, which didn't work, but forgot that GoogleDNS existed, now that you mentioned it I tried it and, it works fine now, no more DDoS check YAY! Well I think that should be it for now. Thanks for helping out. Just 1 final question? are there any new features planned for future? Something like a GUI would be helpful

Funami580 commented 9 months ago

Nice to hear! I don't have any new features planned, and a GUI is not planned either.

pavankumar-dss commented 9 months ago

Aww i guess this should be fine then, Thanks