NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

import requests
import warnings
import random
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from colorama import Fore
from pystyle import Center, Colors, Colorate
import os
import time

warnings.filterwarnings("ignore", category=DeprecationWarning)

def check_for_updates():
try:
r = requests.get("https://raw.githubusercontent.com/Kichi779/Twitch-Viewer-Bot/main/version.txt")
remote_version = r.content.decode('utf-8').strip()
local_version = open('version.txt', 'r').read().strip()
if remote_version != local_version:
print("A new version is available. Please download the latest version from GitHub.")
time.sleep(3)
return False
return True
except:
return True

def save_settings(twitch_username, set_160p):
with open('settings.txt', 'w') as file:
file.write(f"Twitch Username: {twitch_username}n")
file.write(f"Set 160p: {set_160p}n")

def load_settings():
try:
with open('settings.txt', 'r') as file:
lines = file.readlines()
if len(lines) >= 2:
twitch_username = lines[0].split(': ')[1].strip()
set_160p = lines[1].split(': ')[1].strip()
return twitch_username, set_160p
except:
pass
return None, None

def set_stream_quality(driver, quality):
if quality == "yes":
element_xpath = "//div[@data-a-target='player-overlay-click-handler']"
element = driver.find_element(By.XPATH, element_xpath)
actions = ActionChains(driver)
actions.move_to_element(element).perform()
settings_button = driver.find_element(By.XPATH, "//button[@aria-label='Settings']")
settings_button.click()
wait = WebDriverWait(driver, 10)
quality_option = wait.until(EC.element_to_be_clickable((By.XPATH, "//div[text()='Quality']")))
quality_option.click()
time.sleep(15)
quality_levels = wait.until(EC.presence_of_all_elements_located((By.XPATH, "//div[contains(@class, 'video-quality-option')]"))

target_quality = "160p"
for level in quality_levels:
if target_quality in level.text:
level.click()
break

def main():
if not check_for_updates():
return

twitch_username, set_160p = load_settings()

os.system(f"title Kichi779 - Twitch Viewer Bot @kichi#0779 ")

print(Colorate.Vertical(Colors.green_to_cyan, Center.XCenter("""
Your banner text goes here.
""")))
announcement = print_announcement()
print("")
print(Colors.red, Center.XCenter("ANNOUNCEMENT"))
print(Colors.yellow, Center.XCenter(f"{announcement}"))
print("")

proxy_servers = ['176.9.1.7:8888',
'50.171.32.225:80',
'181.209.78.78:999',
'50.228.141.99:80',
'50.171.32.224:80',
'50.168.49.108:80',
'50.238.154.98:80',
'50.173.140.147:80',
'50.223.38.2:80',
'50.168.34.138:80',
'110.238.109.146:3129',
'34.135.166.24:80',
'45.224.22.177:999',
'50.217.226.45:80',
'50.217.29.198:80',
'43.153.73.82:5522',
'50.206.111.91:80',
'50.168.72.115:80',
'50.168.49.107:80',
'47.243.239.165:8870',
'50.227.121.35:80',
'51.159.13.158:3128',
'50.168.163.182:80',
'8.219.97.248:80',
'177.200.239.43:999',
'50.168.72.119:80',
'50.206.25.111:80',
'107.1.93.219:80',
'50.169.115.51:80',
'50.221.166.2:80',
'50.173.140.138:80',
'62.141.11.68:80',
'95.217.195.45:8080',
'20.24.43.214:8123',
'50.174.7.155:80',
'50.202.75.26:80',
'107.1.93.209:80',
'194.44.208.62:80',
'203.19.38.114:1080',
'136.243.90.203:80',
'8.219.74.58:9002',
'119.148.1.41:9990',
'144.76.175.5:8888',
'213.133.102.3:8888',
'103.152.112.145:80',
'172.245.159.177:80',
'150.230.141.229:3128',
'49.0.252.39:82',
'50.239.72.16:80',
'34.82.224.175:33333',
'107.1.93.218:80',
'167.71.250.32:55993',
'136.243.242.30:8888',
'155.0.72.251:3128',
'50.206.25.110:80',
'50.206.25.106:80',
'94.100.26.202:80',
'190.58.248.86:80',
'50.174.145.12:80',
'107.1.93.210:80',
'123.30.154.171:7777',
'50.204.219.228:80',
'20.205.61.143:8123',
'50.239.72.17:80',
'32.223.6.94:80',
'198.98.60.66:80',
'8.219.43.134:8090',
'27.79.56.106:10004',
'50.222.245.40:80',
'51.91.106.213:40018',
'107.1.93.208:80',
'50.227.121.33:80',
'50.170.90.34:80',
'50.172.75.122:80',
'50.207.199.86:80',
'208.65.90.21:4145',
'50.217.226.43:80',
'50.222.245.43:80',
'50.169.115.53:80',
'200.105.215.22:33630',
'35.236.207.242:33333',
'185.160.26.114:80',
'45.181.123.97:999',
'50.168.49.109:80',
'50.169.23.170:80',
'50.207.199.85:80',
'50.168.72.122:80',
'50.222.245.42:80',
'82.119.96.254:80',
'107.1.93.214:80',
'50.200.12.82:80',
'50.174.7.158:80',
'50.204.219.226:80',
'121.147.3.117:54788',
'50.168.49.106:80',
'81.250.223.126:80',
'47.243.114.192:8180',
'107.1.93.220:80',
'50.168.49.104:80',
'20.24.43.214:80',
'50.171.32.226:80',
'50.204.219.227:80',
'8.217.180.106:15673',
'107.1.93.223:80',
'50.168.72.116:80',
]

def selectRandom(proxy_servers):
return random.choice(proxy_servers)

proxy_url = selectRandom(proxy_servers)

print(Colors.red, "Proxy servers are randomly selected every time")
if twitch_username is None or set_160p is None:
twitch_username = input(Colorate.Vertical(Colors.green_to_blue, "Enter your channel name (e.g Kichi779): "))
set_160p = input(Colorate.Vertical(Colors.purple_to_red,"Do you want to set the stream quality to 160p? (yes/no): "))

save_settings(twitch_username, set_160p)
else:
use_settings = input(Colorate.Vertical(Colors.green_to_blue, "Do you want to use your saved settings? (yes/no): "))
if use_settings.lower() == "no":
twitch_username = input(Colorate.Vertical(Colors.green_to_blue, "Enter your channel name (e.g Kichi779): "))
set_160p = input(Colorate.Vertical(Colors.purple_to_red,"Do you want to set the stream quality to 160p? (yes/no): "))

save_settings(twitch_username, set_160p)
proxy_count = int(input(Colorate.Vertical(Colors.cyan_to_blue, "How many proxy sites do you want to open? (Viewers to send)"))

os.system("cls")
print(Colorate.Vertical(Colors.green_to_cyan, Center.XCenter("""
Your banner text goes here.
""")))
print('')
print('')
print(Colors.red, Center.XCenter("Viewers Send. Please don't hurry. If the viewers does not arrive, turn it off and on and do the same operations"))

chrome_path = 'C:Program FilesGoogleChromeApplicationchrome.exe'
driver_path = 'chromedriver.exe'

chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
chrome_options.add_argument('--disable-logging')
chrome_options.add_argument("--lang=en")
chrome_options.add_argument('--headless')
chrome_options.add_argument('--log-level=3')
chrome_options.add_argument('--disable-extensions')
chrome_options.add_argument("--mute-audio")
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(options=chrome_options)

driver.get(proxy_url)

for i in range(proxy_count):
random_proxy_url = selectRandom(proxy_servers)
driver.execute_script("window.open('" + random_proxy_url + "')")
driver.switch_to.window(driver.window_handles[-1])
driver.get(random_proxy_url)
text_box = driver.find_element(By.ID, 'url')
text_box.send_keys(f'www.twitch.tv/{twitch_username}')
text_box.send_keys(Keys.RETURN)
time.sleep(10)

set_stream_quality(driver, set_160p)

input(Colorate.Vertical(Colors.red_to_blue, "Viewers have all been sent. You can press enter to withdraw the views and the program will close."))
driver.quit()

if __name__ == '__main__':
main()
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.