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.chrome.service import Service
from selenium.webdriver.common.service import Service as Service_
from selenium.webdriver.chrome.service import Service as Service__
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()

def print_announcement():
try:
r = requests.get("https://raw.githubusercontent.com/Kichi779/Twitch-Viewer-Bot/main/announcement.txt", headers={"Cache-Control": "no-cache"})
announcement = r.content.decode('utf-8').strip()
return announcement
except:
print("Could not retrieve announcement from GitHub.n")

if not check_for_updates():
return

print_announcement()

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("""

▄█ ▄█▄ ▄█ ▄████████ ▄█ █▄ ▄█
███ ▄███▀ ███ ███ ███ ███ ███ ███
███▐██▀ ███▌ ███ █▀ ███ ███ ███▌
▄█████▀ ███▌ ███ ▄███▄▄▄▄███▄▄ ███▌
▀▀█████▄ ███▌ ███ ▀▀███▀▀▀▀███▀ ███▌
███▐██▄ ███ ███ █▄ ███ ███ ███
███ ▀███▄ ███ ███ ███ ███ ███ ███
███ ▀█▀ █▀ ████████▀ ███ █▀ █▀

Github github.com/kichi779 """)))

announcement = print_announcement()

print("")
print(Colors.red, Center.XCenter("ANNOUNCEMENT"))
print(Colors.yellow, Center.XCenter(f"{announcement}"))
print("")
print("")

# Burada kendi proxy sunucu adresinizi ve portunuzu eklemelisiniz
proxy_host = "proxy_sunucu_adresi"
proxy_port = "proxy_portu"
# Eğer kullanıcı adı ve şifre gerekiyorsa bu satırları kullanabilirsiniz:
# proxy_username = "kullanici_adi"
# proxy_password = "sifre"

proxy_servers = [
'179.108.158.204',
'87.250.63.172',
'159.138.255.141',
'180.183.108.19',
'69.164.197.29',
'67.43.227.227',
'122.252.182.99',
'139.255.94.123',
'66.29.128.242',
'8.219.43.134',
'159.138.252.45',
'64.225.8.132',
'110.238.111.229',
'115.124.66.114',
'47.91.45.235',
'176.9.1.7',
'144.217.237.182',
'117.160.250.130',
'59.124.71.14',
'182.53.50.2',
'50.171.32.225',
'85.115.112.178',
'72.167.222.102',
'220.247.167.61',
'189.84.97.174',
'103.123.168.165',
'154.65.39.8',
'190.104.173.62',
'85.132.29.134',
'91.121.163.199',
'198.11.175.192',
'45.171.108.253',
'83.171.90.83',
'109.238.189.104',
'222.127.50.56',
'185.123.143.247',
'181.209.78.78',
'110.39.172.234',
'5.180.19.178',
'181.78.19.242',
'203.89.8.107',
'138.197.10.76',
'103.168.53.157',
'141.147.93.160',
'198.211.33.78',
'202.137.134.160',
'58.20.21.247',
'103.4.76.51',
'8.219.169.172',
'50.228.141.99',
]

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

# Şu andan itibaren her proxy tabi için ayarları ekleyin
for i in range(proxy_count):
random_proxy_url = selectRandom(proxy_servers) # Rastgele bir proxy sunucusu seçin

# Proxy ayarları
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')

# Proxy ayarlarını ekleyin
chrome_options.add_argument(f'--proxy-server=http://{proxy_host}:{proxy_port}')
# Eğer kullanıcı adı ve şifre gerekiyorsa:
# chrome_options.add_argument(f'--proxy-bypass-list=<-loopback>')
# chrome_options.add_argument(f'--proxy-auth={proxy_username}:{proxy_password}')

driver = webdriver.Chrome(service_log_path="NUL", options=chrome_options)
driver.get(random_proxy_url)

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

Notes.io is a web-based application for 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 12 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.