MShawon / YouTube-Viewer

A multithreaded view bot for YouTube
MIT License
1.49k stars 757 forks source link

urllib.error.HTTPError: HTTP Error 404: Not Found [17648] Failed to execute script 'youtube_viewer_exe' due to unhandled exception! #589

Open techkick opened 1 year ago

techkick commented 1 year ago

Is there an existing issue for this?

I'm submitting a ...

Description

Traceback (most recent call last): File "youtube_viewer_exe.py", line 1279, in File "youtube_viewer_exe.py", line 267, in download_driver File "undetected_chromedriverinit.py", line 265, in install File "undetected_chromedriverinit.py", line 195, in install File "undetected_chromedriverinit.py", line 224, in fetch_chromedriver File "undetected_chromedriverinit.py", line 214, in get_release_version_number File "urllib\request.py", line 214, in urlopen File "urllib\request.py", line 523, in open File "urllib\request.py", line 632, in http_response File "urllib\request.py", line 561, in error File "urllib\request.py", line 494, in _call_chain File "urllib\request.py", line 641, in http_error_default urllib.error.HTTPError: HTTP Error 404: Not Found [17648] Failed to execute script 'youtube_viewer_exe' due to unhandled exception!

Environment

- OS : windows 11
- Python : 
- Script version :

config.json

:(
Percy1082 commented 1 year ago

You need to use old chrome version to deal with

techkick commented 1 year ago

which version?

Percy1082 commented 1 year ago

which version?

<100.x.x.x

techkick commented 1 year ago

but why @MShawon is not adding Firefox instead of Chrome?

JijaProGamer commented 1 year ago

Firefox is not as widely supported by automation frameworks (puppeteer, selenium, etc), as Chromium

techkick commented 1 year ago

any other browser which can support this automation

JijaProGamer commented 1 year ago

Nope they cannot. Its called Chrome Web Driver for a reason.

kattstof commented 1 year ago

Both selenium and puppeteer both support Firefox,selenium actually supports firefox more than chrome in my experience. The more likely answer is the fact that it'll require a complete overhall to port to firefox.

JijaProGamer commented 1 year ago

There is no way anything supports Firefox more than chromium. Chromium created Chrome DevTools Protocol, and Firefox tries to mimic it. It's not perfect and outdated, but it works. And it clearly is not even close as Chromium.

kattstof commented 1 year ago

Most of my job is using Selenium for different code bases, it does indeed support Firefox loads more in my experience. But what do i know? i just have 10 years of working experience in the field. LOL

JijaProGamer commented 1 year ago

I too have years of working experience in this field. And how can you say that something that is a copy of something else is better than the actual product? They miss half of the CDP endpoints and execute slowly another half.

kattstof commented 1 year ago

both of them are using the WebDriver protocol, so it's a fairly even playing field when starting out. BUT firefox gets the extra points for many reasons including 1) WAYYY less RAM usage 2) ability to monitor pages your scraping 3) firefox is actually faster using webdriver (RAM usage is one reason for this) 4) an adon to 3) firefox loads faster this is fact, not debatable 5)Firefox allows for more customization via about:config and offers application level proxy support. Chrome doesn't 6) stability -- one problem chromedriver has over geckodriver (firefox) is the fact that chrome driver doesn't always close itself it's been an issue for YEARS now where phantom chrome drivers don't exit properly which can cause a system crash. 7) open /src and more widely used atleast in the linux space

the only thing chrome has for it is if your are on winblows it has more market share -- but i'd argue if you're on windows you have worse things to worry about than which webdriver implementation is better. '

kattstof commented 1 year ago

Furthermore selenium is using the W3C protocol so the talk of CDP is null and void. Your speaking from a user of puppeteer which indeed does seem to support CDP better, but this script uses webdriver NOT puppeteer

techkick commented 1 year ago

both of you have great knowledge so I am assuming that you should also have a solution @kattstof @JijaProGamer

JijaProGamer commented 1 year ago

both of you have great knowledge so I am assuming that you should also have a solution @kattstof @JijaProGamer

Considering Google made Chromium, it makes sense that they seem to detect it easily, and chrome has a feature dedicated for websites to detect that its a bot, which is very hard to disable entirely without making a chromium fork.

So firefox would be a better candidate considering it also has good selenium support, but I don't know what @kattstof is talking about performance, since in my tests with 1 youtube page open and all the optimizations flags used, chrome used 0.2% of the CPU and 275MB Ram, while firefox used 2.5% of the CPU and 500MB RAM

techkick commented 1 year ago

can you make changes to the script or provide code for firefox

JijaProGamer commented 1 year ago

can you make changes to the script or provide code for firefox

You would have to contact @MShawon for this. I work in a completely different environment and programming language, and I maintain my own bot, so I don't have time or python knowledge for this.

JijaProGamer commented 1 year ago

Furthermore selenium is using the W3C protocol so the talk of CDP is null and void. Your speaking from a user of puppeteer which indeed does seem to support CDP better, but this script uses webdriver NOT puppeteer

https://firefox-source-docs.mozilla.org/remote/index.html

Firefox does indeed use CDP.

W3C is not an protocol, it's just the World Wide Web Consortium standard that browsers may or may not follow.

CDP (which again, is being used by selenium) is only half-made in Firefox, missing a lot of features like request interjection, missing headers, etc. The second decent protocol in Firefox is BiDi, but thats not supported by selenium AFAIK.

kattstof commented 1 year ago

In python atleast -- firefox uses less RAM than chrome in all circumstances, you can read more about it on reddit, stack overflow etc with countless use cases. Furthermore: w3c was a typo made in haste -- the protocol i was refering to was the Selenium webdriver protocol as i referred to it before.

gecko driver also uses marionette to implement webdriver -- i wasn't saying CDP isn't supported -- just that in my experience firefox works better for the vast amount of use cases i've come across as far as python + selenium is concerned.

i'm not saying CDP is terrible just that there are many upsides to using firefox and that chrome isn't the best browser to use in this instance.
in an ideal world i'd prefer requests over selenium but that will never work.

techkick commented 1 year ago

can you make changes to the script or provide code for firefox

You would have to contact @MShawon for this. I work in a completely different environment and programming language, and I maintain my own bot, so I don't have time or python knowledge for this.

which type of bot do you have ?

JijaProGamer commented 1 year ago

can you make changes to the script or provide code for firefox

You would have to contact @MShawon for this. I work in a completely different environment and programming language, and I maintain my own bot, so I don't have time or python knowledge for this.

which type of bot do you have ?

Its discontinued, but it was similar to MSHawon's one, but with improved random fingerprints, account support, and a GUI.

techkick commented 1 year ago

when will you update @MShawon?

mercuryin commented 1 year ago

can you make changes to the script or provide code for firefox

You would have to contact @MShawon for this. I work in a completely different environment and programming language, and I maintain my own bot, so I don't have time or python knowledge for this.

which type of bot do you have ?

Its discontinued, but it was similar to MSHawon's one, but with improved random fingerprints, account support, and a GUI.

I have yours installed and I really like it, are you saying you are not going to work on it anymore ? We just need to found a solution to the views drop but your interface is great mate. I know you are doing it for free btw.

JijaProGamer commented 1 year ago

can you make changes to the script or provide code for firefox

You would have to contact @MShawon for this. I work in a completely different environment and programming language, and I maintain my own bot, so I don't have time or python knowledge for this.

which type of bot do you have ?

Its discontinued, but it was similar to MSHawon's one, but with improved random fingerprints, account support, and a GUI.

I have yours installed and I really like it, are you saying you are not going to work on it anymore ? We just need to found a solution to the views drop but your interface is great mate. I know you are doing it for free btw.

It currently has some missing features (Started modifying the settings tab and never finished it, didn't finish plugins feature). And most views will drop, since I need to update the API inside (youtube-selfbot-api).

I found it impossible to use chromium for YouTube view botting, so the only solution is a custom browser implementation or firefox.

Puppeteer doesn't include important features the API needs (request interception, profiles, caching, etc), and playwright (made by the same group of developers, and they moved from Google to Microsoft), but its hard to work with and seems to perform slower.

I'm currently working on a custom headless automation browser (AXYUM on my profile) hat will replicate Firefox, but completely hidden with less than 50MB ram usage, but I still have lots of work on it and it might take multiple months to finish.

JijaProGamer commented 1 year ago

And I am working on the underlying APIs instead of directly working on it, since they need more work. The only stuff I need to finish on the bot interface are the plugins feature, improve the GUI and make better use of sveltekit.

techkick commented 1 year ago

can you convert your bot to exe file so we can run easily ? @JijaProGamer

JijaProGamer commented 1 year ago

I'll do that once I update it. It'll take a few months

mercuryin commented 1 year ago

I'll do that once I update it. It'll take a few months

One question if you don't mind. Someone here has suggested to install an extension on chrome, a switcher user/agent. I am trying to modify your app to load this extension in every instance but I don't know where in Puppeteer do I have to do it. In theory we just need to load the extension explicitly in each instance. Puppeteer allows you to do this by using the 'args' option when launching Chromium and the 'addScriptTag' option to load the extension on each page you open. If you can let me know where is the file where I can set this, I would appreciate it. I would love to test it, thanks

JijaProGamer commented 1 year ago

My bot already randomises the user agent, and the entire fingerprint.

And puppeteer loads plugins via the args array