Skip to content

Commit cbf2d77

Browse files
committed
Version 1.9.0 - Major Improvements:
- Supports newer Python versions (up to 3.13) - No need for setuptools<59 restriction - Improved proxy handling - Better error handling - More stable driver management - Fixed Linux chromedriver permission issues (chmod 755) - Fixed time module imports for better compatibility - Updated ChromeDriver download mechanism for latest Chrome versions - Improved version detection and compatibility checks - Added better error messages for driver installation - Version updated to 1.8.3 with all fixes included - Reduced config creation wait time from 20s to 10s for better UX - Standardized log message formatting for better readability - Improved cleanup process for graceful program termination - Fixed connection retry errors during driver cleanup - Added proper sleep delays between cleanup operations - Enhanced driver shutdown sequence (close -> quit -> kill) - Improved ad detection and skipping mechanism - Added robust YouTube consent popup handling - Enhanced popup management for better automation reliability - Fixed video playback issues after ad/consent handling - Added Chrome version caching to avoid repeated manual input - Automated Chrome version detection and storage - Improved startup time by saving browser configuration
1 parent 77f51e0 commit cbf2d77

File tree

16 files changed

+2166
-917
lines changed

16 files changed

+2166
-917
lines changed

.pylintrc

-43.7 KB
Binary file not shown.

README.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@
2323
# YouTube Viewer
2424
Simple program to increase YouTube views written in Python. Works with live stream too.
2525

26-
# NOTICE
27-
**Not working anymore. If I can fix it there will be a new release. Until then don't use it.**
28-
2926
**Disclaimer:** This has been developed for educational purposes only. Any action you take using this script is strictly at your own risk. I will not be liable for any losses or damages you face using this script.
3027

31-
**Cons:** There will be some view drop always.
28+
**Cons:** There will ALWAYS be view drops.
3229

3330
# Support
3431
Consider a donation to keep this project alive and for the countless hours of works and testing :)
@@ -66,7 +63,7 @@ Simple program to increase YouTube views written in Python. Works with live stre
6663

6764

6865
# Requirements
69-
* **Python 3.7.x-3.11.x**
66+
* **Python 3.7.x-3.12.x**
7067
* High speed Internet Connection
7168
* Good proxy list (http, https, socks4, socks5)
7269
* Google Chrome installed on your OS (not Chromium)
@@ -75,29 +72,34 @@ Simple program to increase YouTube views written in Python. Works with live stre
7572
# Features
7673
* YouTube default, live streaming and YouTube Music support
7774
* Multithreaded and Dynamic thread support
78-
* Auto download updated chrome driver whenever user's Google Chrome version is updated
79-
* Patch chrome driver on the start of every thread by undetected-chromedriver
75+
* Auto download updated chrome driver using undetected-chromedriver
8076
* Proxy support
81-
* location : text file (must be on path) / proxy API (should work with most of the proxy providers)
77+
* location : text file (must be on path) / proxy API (works with most proxy providers)
8278
* type : http, https, socks4, socks5
8379
* format : `ip:port`, `user:pass@ip:port`, `ip:port:user:pass`
84-
* proxy refresh after a certain time specified by the user
80+
* proxy refresh after a specified time interval
8581
* rotating proxy support
86-
* chrome v80+ randomized user agent based on platform
87-
* canvas,audio,font,webgl fingerprint defender and IP leak prevent by webrtc control
88-
* geolocation, timezone, referer spoofing
89-
* can add extra extensions in the `extension/custom_extension/` folder
90-
* direct link or search *keyword* on YouTube then watch the video by matching exact video *title*
91-
* modify **urls.txt, search.txt and config.json** on the fly without restarting program
92-
* HTTP api on localhost and a database to store view count
93-
* config.json to save settings
94-
* bypass consent page and several other pop up
95-
* save bandwidth by reducing video quality
96-
* can set higher(100%) watch duration percentage to increase *Watch time*, change playback speed
82+
* Modern Chrome compatibility with randomized user agent
83+
* Basic browser fingerprint protection:
84+
* WebRTC leak prevention
85+
* Timezone and referer spoofing
86+
* Custom extension support via `extension/custom_extension/` folder
87+
* Flexible video targeting:
88+
* Direct video URLs
89+
* Search-based targeting with title matching
90+
* Real-time config updates without restart
91+
* Monitoring and Management:
92+
* HTTP API for status monitoring
93+
* SQLite database for view tracking
94+
* Configurable settings via config.json
95+
* YouTube Interaction Features:
96+
* Consent popup handling
97+
* Bandwidth optimization via quality control
98+
* Configurable watch duration and playback speed
9799
* #### Traffic Sources
98100
* YouTube Search
99101
* Suggested Videos
100-
* External (Google, Yahoo, DuckDuckGo, Bing, Twitter)
102+
* External Sources (Google, DuckDuckGo, Bing)
101103
* End Screens
102104
* Channel Pages
103105
* Direct or unknown
@@ -174,7 +176,7 @@ Simple program to increase YouTube views written in Python. Works with live stre
174176

175177
* ## Installation
176178

177-
First, make sure you have installed git and Python version between 3.7.x to 3.11.x
179+
First, make sure you have installed git and Python version between 3.7.x to 3.12.x
178180

179181
Open command prompt and type
180182
```
@@ -187,9 +189,6 @@ Simple program to increase YouTube views written in Python. Works with live stre
187189
python -m pip install --upgrade pip wheel
188190
```
189191
```
190-
pip install "setuptools<59"
191-
```
192-
```
193192
pip install -r requirements.txt
194193
```
195194

@@ -262,4 +261,10 @@ Simple program to increase YouTube views written in Python. Works with live stre
262261
263262
264263
# Credits
265-
I want to thank all of you who have opened an issue or shared your code snippets or ideas with me!
264+
I want to thank all of you who have opened an issue or shared your code snippets or ideas with me!
265+
266+
Currently maintained by:
267+
- Original author: MShawon
268+
- Current maintainer: Leaske
269+
270+
Feel free to contribute by opening issues or submitting pull requests!

proxy.txt

Whitespace-only changes.

proxy_check.py

Lines changed: 90 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
2323
"""
24+
2425
import os
2526
import shutil
2627
import sys
@@ -35,33 +36,41 @@
3536

3637

3738
class bcolors:
38-
HEADER = '\033[95m'
39-
OKBLUE = '\033[94m'
40-
OKCYAN = '\033[96m'
41-
OKGREEN = '\033[92m'
42-
WARNING = '\033[93m'
43-
FAIL = '\033[91m'
44-
ENDC = '\033[0m'
45-
BOLD = '\033[1m'
46-
UNDERLINE = '\033[4m'
47-
48-
49-
print(bcolors.OKGREEN + """
39+
HEADER = "\033[95m"
40+
OKBLUE = "\033[94m"
41+
OKCYAN = "\033[96m"
42+
OKGREEN = "\033[92m"
43+
WARNING = "\033[93m"
44+
FAIL = "\033[91m"
45+
ENDC = "\033[0m"
46+
BOLD = "\033[1m"
47+
UNDERLINE = "\033[4m"
48+
49+
50+
print(
51+
bcolors.OKGREEN
52+
+ r"""
5053
____
51-
| _ \ _ __ _____ ___ _
52-
| |_) | '__/ _ \ \/ / | | |
53-
| __/| | | (_) > <| |_| |
54-
|_| |_|_ \___/_/\_\\__, |_
55-
/ ___| |__ ___|___/| | _____ _ __
54+
| _ \ _ __ _____ ___ _
55+
| |_) | '__/ _ \ \/ / | | |
56+
| __/| | | (_) > <| |_| |
57+
|_| |_|_ \___/_/\_\\__, |_
58+
/ ___| |__ ___|___/| | _____ _ __
5659
| | | '_ \ / _ \/ __| |/ / _ \ '__|
5760
| |___| | | | __/ (__| < __/ |
5861
\____|_| |_|\___|\___|_|\_\___|_|
5962
60-
""" + bcolors.ENDC)
63+
"""
64+
+ bcolors.ENDC
65+
)
6166

62-
print(bcolors.OKCYAN + """
67+
print(
68+
bcolors.OKCYAN
69+
+ """
6370
[ GitHub : https://github.com/MShawon/YouTube-Viewer ]
64-
""" + bcolors.ENDC)
71+
"""
72+
+ bcolors.ENDC
73+
)
6574

6675

6776
checked = {}
@@ -70,47 +79,49 @@ class bcolors:
7079

7180
def backup():
7281
try:
73-
shutil.copy('GoodProxy.txt', 'ProxyBackup.txt')
74-
print(bcolors.WARNING +
75-
'GoodProxy.txt backed up in ProxyBackup.txt' + bcolors.ENDC)
82+
shutil.copy("GoodProxy.txt", "ProxyBackup.txt")
83+
print(
84+
bcolors.WARNING
85+
+ "GoodProxy.txt backed up in ProxyBackup.txt"
86+
+ bcolors.ENDC
87+
)
7688
except Exception:
7789
pass
7890

79-
print('', file=open('GoodProxy.txt', 'w'))
91+
print("", file=open("GoodProxy.txt", "w"))
8092

8193

8294
def clean_exe_temp(folder):
8395
try:
84-
temp_name = sys._MEIPASS.split('\\')[-1]
96+
temp_name = sys._MEIPASS.split("\\")[-1]
8597
except Exception:
8698
temp_name = None
8799

88-
for f in glob(os.path.join('temp', folder, '*')):
100+
for f in glob(os.path.join("temp", folder, "*")):
89101
if temp_name not in f:
90102
shutil.rmtree(f, ignore_errors=True)
91103

92104

93105
def load_proxy():
94106
proxies = []
95107

96-
filename = input(bcolors.OKBLUE +
97-
'Enter your proxy file name: ' + bcolors.ENDC)
108+
filename = input(bcolors.OKBLUE + "Enter your proxy file name: " + bcolors.ENDC)
98109

99-
if not os.path.isfile(filename) and filename[-4:] != '.txt':
100-
filename = f'{filename}.txt'
110+
if not os.path.isfile(filename) and filename[-4:] != ".txt":
111+
filename = f"{filename}.txt"
101112

102113
try:
103114
with open(filename, encoding="utf-8") as fh:
104-
loaded = [x.strip() for x in fh if x.strip() != '']
115+
loaded = [x.strip() for x in fh if x.strip() != ""]
105116
except Exception as e:
106117
print(bcolors.FAIL + str(e) + bcolors.ENDC)
107-
input('')
118+
input("")
108119
sys.exit()
109120

110121
for lines in loaded:
111-
if lines.count(':') == 3:
112-
split = lines.split(':')
113-
lines = f'{split[2]}:{split[-1]}@{split[0]}:{split[1]}'
122+
if lines.count(":") == 3:
123+
split = lines.split(":")
124+
lines = f"{split[2]}:{split[-1]}@{split[0]}:{split[1]}"
114125
proxies.append(lines)
115126

116127
return proxies
@@ -128,50 +139,59 @@ def main_checker(proxy_type, proxy, position):
128139
"https": f"{proxy_type}://{proxy}",
129140
}
130141

131-
header = Headers(
132-
headers=False
133-
).generate()
134-
agent = header['User-Agent']
142+
header = Headers(headers=False).generate()
143+
agent = header["User-Agent"]
135144

136145
headers = {
137-
'User-Agent': f'{agent}',
146+
"User-Agent": f"{agent}",
138147
}
139148

140149
response = requests.get(
141-
'https://www.youtube.com/', headers=headers, proxies=proxy_dict, timeout=30)
150+
"https://www.youtube.com/", headers=headers, proxies=proxy_dict, timeout=30
151+
)
142152
status = response.status_code
143153

144154
if status != 200:
145155
raise Exception(status)
146156

147-
print(bcolors.OKBLUE + f"Worker {position+1} | " + bcolors.OKGREEN +
148-
f'{proxy} | GOOD | Type : {proxy_type} | Response : {status}' + bcolors.ENDC)
157+
print(
158+
bcolors.OKBLUE
159+
+ f"Worker {position+1} | "
160+
+ bcolors.OKGREEN
161+
+ f"{proxy} | GOOD | Type : {proxy_type} | Response : {status}"
162+
+ bcolors.ENDC
163+
)
149164

150-
print(f'{proxy}|{proxy_type}', file=open('GoodProxy.txt', 'a'))
165+
print(f"{proxy}|{proxy_type}", file=open("GoodProxy.txt", "a"))
151166

152167
except Exception as e:
153168
try:
154169
e = int(e.args[0])
155170
except Exception:
156-
e = ''
157-
print(bcolors.OKBLUE + f"Worker {position+1} | " + bcolors.FAIL +
158-
f'{proxy} | {proxy_type} | BAD | {e}' + bcolors.ENDC)
171+
e = ""
172+
print(
173+
bcolors.OKBLUE
174+
+ f"Worker {position+1} | "
175+
+ bcolors.FAIL
176+
+ f"{proxy} | {proxy_type} | BAD | {e}"
177+
+ bcolors.ENDC
178+
)
159179
checked[position] = proxy_type
160180

161181

162182
def proxy_check(position):
163183
sleep(2)
164184
proxy = proxy_list[position]
165185

166-
if '|' in proxy:
167-
splitted = proxy.split('|')
186+
if "|" in proxy:
187+
splitted = proxy.split("|")
168188
main_checker(splitted[-1], splitted[0], position)
169189
else:
170-
main_checker('http', proxy, position)
171-
if checked[position] == 'http':
172-
main_checker('socks4', proxy, position)
173-
if checked[position] == 'socks4':
174-
main_checker('socks5', proxy, position)
190+
main_checker("http", proxy, position)
191+
if checked[position] == "http":
192+
main_checker("socks4", proxy, position)
193+
if checked[position] == "socks4":
194+
main_checker("socks5", proxy, position)
175195

176196

177197
def main():
@@ -181,33 +201,40 @@ def main():
181201
pool_number = [i for i in range(total_proxies)]
182202

183203
with ThreadPoolExecutor(max_workers=threads) as executor:
184-
futures = [executor.submit(proxy_check, position)
185-
for position in pool_number]
204+
futures = [executor.submit(proxy_check, position) for position in pool_number]
186205
done, not_done = wait(futures, timeout=0)
187206
try:
188207
while not_done:
189208
freshly_done, not_done = wait(not_done, timeout=5)
190209
done |= freshly_done
191210
except KeyboardInterrupt:
192-
print(bcolors.WARNING +
193-
'Hold on!!! Allow me a moment to finish the running threads' + bcolors.ENDC)
211+
print(
212+
bcolors.WARNING
213+
+ "Hold on!!! Allow me a moment to finish the running threads"
214+
+ bcolors.ENDC
215+
)
194216
cancel_all = True
195217
for future in not_done:
196218
_ = future.cancel()
197219
_ = wait(not_done, timeout=None)
198220
raise KeyboardInterrupt
199221
except IndexError:
200-
print(bcolors.WARNING + 'Number of proxies are less than threads. Provide more proxies or less threads. ' + bcolors.ENDC)
222+
print(
223+
bcolors.WARNING
224+
+ "Number of proxies are less than threads. Provide more proxies or less threads. "
225+
+ bcolors.ENDC
226+
)
201227

202228

203-
if __name__ == '__main__':
229+
if __name__ == "__main__":
204230

205-
clean_exe_temp(folder='proxy_check')
231+
clean_exe_temp(folder="proxy_check")
206232
backup()
207233

208234
try:
209235
threads = int(
210-
input(bcolors.OKBLUE+'Threads (recommended = 100): ' + bcolors.ENDC))
236+
input(bcolors.OKBLUE + "Threads (recommended = 100): " + bcolors.ENDC)
237+
)
211238
except Exception:
212239
threads = 100
213240

@@ -216,8 +243,7 @@ def main():
216243
proxy_list = list(set(filter(None, proxy_list)))
217244

218245
total_proxies = len(proxy_list)
219-
print(bcolors.OKCYAN +
220-
f'Total unique proxies : {total_proxies}' + bcolors.ENDC)
246+
print(bcolors.OKCYAN + f"Total unique proxies : {total_proxies}" + bcolors.ENDC)
221247

222248
try:
223249
main()

requirements.txt

1.96 KB
Binary file not shown.

search.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
keyword 1 :::: exact video title 1
2-
keyword 2 :::: exact video title 2
3-
keyword 3 :::: exact video title 2
4-
keyword 1 :::: video_id 1
5-
keyword 2 :::: video_id 2
6-
keyword 4 :::: exact video title 3
1+
Separate Ways :::: Daughtry - Separate Ways (Worlds Apart) (Official Music Video) ft. Lzzy Hale ft. Lzzy Hale

urls.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
https://youtu.be/xxxxxxxxxxxx
2-
https://www.youtube.com/watch?v=xxxxxxxxxxxx
3-
https://t.co/xxxxxxxxxx
1+
https://www.youtube.com/watch?v=I9iXHAgjXhA

0 commit comments

Comments
 (0)