nem4 / viewerbot Goto Github PK
View Code? Open in Web Editor NEWTwitch Viewer Bot (Python + proxies)
Twitch Viewer Bot (Python + proxies)
I still get a connection error with good IP's. why?
I got this problem when tried to install it : https://prnt.sc/sv8h6x . Can someone help me?
So I managed to get Python 3.7 but after some examine and reading other issues or other info. I cannot find how to start the system up.
Like what file do I need to press, what do I need to edit. What I need installed?
(I also tried to open the threads_viewer folder but nothing opens so...)
We
Any working fixes for the Wasnt able to get url error?
Have all the requirements, where does it say "RANDOM CHANNEL".
I have my url put in all the "url" inside the scrip, do I need to put it somewhere else.
Hello, I read then twitch close that backdoor,innit?
Hi, I'm a beginner in python but I would like to set this bot for my channel I need views for reach the partner, any can help me setting up this from the beginning? Thanks a lot
Can this also be used on mixer?
After I type in "~\viewerbot>python threads_viewer.py RANDOMCHANNEL 1000" but with my real details I get this error
Traceback (most recent call last):
File "threads_viewer.py", line 2, in
from livestreamer import Livestreamer
ModuleNotFoundError: No module named 'livestreamer'
Traceback (most recent call last):
File "main.py", line 98, in
channel_url = "https://www.twitch.tv/" + sys.argv[1]
IndexError: list index out of range
File "threads_viewer.py", line 85
print(f"Sent HEAD request with {current_proxy['http']} | {response.status_code} | {response.request} | {response}")
SyntaxError: invalid syntax
got this error every time
EXCEPTION IN (threads_viewer.py, LINE 114 "threaded = Thread(target=open_url, args=(all_proxies[random.randint(0, len(all_proxies))],))"): list index out of range
and this (a few thousand working proxy)
Wasnt able to get url
An idea to fix this ? :)
Hey!
I`m getting this error:
EXCEPTION IN (threads_viewer.py, LINE 114 "threaded = Thread(target=open_url, args=(all_proxies[random.randint(0, len(all_proxies))],))"): list index out of range
Whats the problem?
Thanks.
Hi,
your repo here,
Has been stolen & re-uploaded by the GitHub user: https://github.com/5R33CH4
Here is their repo in which they've stolen your work, and attributed it to themselves: https://github.com/5R33CH4/Python-Twitch-Viewbot
They also have a GitHub org, where they likely also have some stolen work: https://github.com/tesseract-org.
Checkout their all their personal repos...
I'm sorry to bring you this bad news, this user has stolen >50 repos so you should consider reporting them to GitHub.
Galen
Set the entire bot correctly as remembered, since at the time I managed to make it work but this time it just constantly tells me "Wasnt able to get url" ..
Has anyone managed to make it work?
Twitch changed something that causes the bot not to work?
thanks
can someone help me with this
File "threads_viewer.py", line 84 SyntaxError: Non-ASCII character '\xc3' in file threads_viewer.py on line 84, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
am getting this error
IndexError: list index out of range
An error has occurred while trying to read the list of proxies: No such file or directory
As you noticed many people are posting issues with proxies or other stuff saying it's not working, this is because this code doesn't work since maybe years. Twitch changed too much for this system to work so don't buy premium proxies thinking that can solve it.
not working more?
error #1:
Users-MacBook-Pro-2:viewerbot user$ python threads_viewer.py RANDOMCHANNEL 1000
File "threads_viewer.py", line 85
print(f"Sent HEAD request with {current_proxy['http']} | {response.status_code} | {response.request} | {response}")
^
SyntaxError: invalid syntax
error when commenting out: the print above
import requests
ImportError: No module named requests
Hi, how do i solve this?
`Error occurred during loading data. Trying to use cache server https://fake-useragent.herokuapp.com/browsers/0.1.11
Traceback (most recent call last):
File "/usr/lib/python3.6/urllib/request.py", line 1325, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/usr/lib/python3.6/http/client.py", line 1264, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1310, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1259, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1038, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 976, in send
self.connect()
File "/usr/lib/python3.6/http/client.py", line 1425, in connect
server_hostname=server_hostname)
File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/usr/lib/python3.6/ssl.py", line 817, in init
self.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/fake_useragent/utils.py", line 67, in get
context=context,
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 1368, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/lib/python3.6/urllib/request.py", line 1327, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>
`
"""
Update from NjProVk
"""
import requests
from streamlink import Streamlink
import sys
import time
import random
from random import shuffle
from fake_useragent import UserAgent
import linecache
from threading import Thread
channel_urls = f"https://www.twitch.tv/{sys.argv[1]}"
proxies_file = "Proxies_txt/good_proxy.txt"
processes = []
max_nb_of_threads = int(sys.argv[2])
all_proxies = []
nb_of_proxies = 0
# Session creating for request
ua = UserAgent()
session = Streamlink()
session.set_option("http-headers", {'User-Agent': ua.random, "Client-ID": "ewvlchtxgqq88ru9gmfp1gmyt6h2b93"})
class ViewerBot:
def print_exception(self):
exc_type, exc_obj, tb = sys.exc_info()
f = tb.tb_frame
lineno = tb.tb_lineno
filename = f.f_code.co_filename
linecache.checkcache(filename)
line = linecache.getline(filename, lineno, f.f_globals)
print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
def get_proxies(self):
# Reading the list of proxies
global nb_of_proxies
try:
lines = [line.rstrip("\n") for line in open(proxies_file)]
except IOError as e:
print("An error has occurred while trying to read the list of proxies: %s" % e.strerror)
sys.exit(1)
nb_of_proxies = len(lines)
return lines
def get_url(self):
url = ""
try:
streams = session.streams(self.channel_url)
try:
url = streams['audio_only'].url
print(f"URL : {url[:30]}...\n")
except:
url = streams['worst'].url
print(f"URL : {url[:30]}...\n")
except:
pass
return url
def open_url(self,proxy_data):
try:
global all_proxies
headers = {'User-Agent': ua.random}
current_index = all_proxies.index(proxy_data)
if proxy_data['url'] == "":
proxy_data['url'] = self.get_url()
current_url = proxy_data['url']
try:
if time.time() - proxy_data['time'] >= random.randint(1, 5):
current_proxy = {"http": f"https://{proxy_data['proxy']}", "https": f"http://{proxy_data['proxy']}"}
with requests.Session() as s:
response = s.head(current_url, proxies=current_proxy, headers=headers)
print(f"Sent HEAD request with {current_proxy['http']} | {response.status_code} | {response.request} | {response}")
proxy_data['time'] = time.time()
all_proxies[current_index] = proxy_data
except:
print("Connection Error!")
except (KeyboardInterrupt, SystemExit):
sys.exit()
def mainmain(self):
self.channel_url = channel_urls
proxies = self.get_proxies()
for p in proxies:
all_proxies.append({'proxy': p, 'time': time.time(), 'url': ""})
shuffle(all_proxies)
list_of_all_proxies = all_proxies
current_proxy_index = 0
while True:
try:
for i in range(0, max_nb_of_threads):
threaded = Thread(target=self.open_url, args=(all_proxies[random.randint(0, len(all_proxies))],))
threaded.daemon = True # This thread dies when main thread (only non-daemon thread) exits.
threaded.start()
except:
self.print_exception()
shuffle(all_proxies)
time.sleep(5)
ViewerBot = ViewerBot()
ViewerBot.mainmain()
who makes a video please my head hurts I already did everything it doesn't work for me please
SOCKS4, SOCKS5 or HTTP ?
Hy.
I tried to get everything correct and installed all modules. script is sending Head requests to a active channel but livestreamer never get startet.
livestreamer is working when i execute livestreamer without script.
I also tried to use streamlink. (changed livestreamer arguments to streamlink),
but I never get any viewers or a livestreamer/streamlink session with the script.
I also read all instructions of the modules, but I cant find any relevant information about this.
Am I missing something?
how I execute:
/usr/bin/python3 /opt/bot/threads_viewer.py channelname 15
python2.7 gives me syntax error:
File "/opt/bot/threads_viewer.py", line 85 print(f"Sent HEAD request with {current_proxy['http']} | {response.status_code} | {response.request} | {response}") ^ SyntaxError: invalid syntax
Im trying with fresh private proxies but doesnt work
I tryed but not working. Maybe i did mistake. Anyone did try ?
https://prnt.sc/rvml0n always have this error
Hello,
When I put "pip install -r requirements.txt" it's working
But when I want to write "~\viewerbot>python threads_viewer.py your_channel_name max_nb_of_threads" with the good name of the channel with the threads the cmd said "The specified path was not found."
Can you help me or It doesn't work anymore
Hello. How can I use this bot without client id?
Thanks for replying.
so iv tried editing it to go to a different file for the proxies and its just not working
Can someone explain to me what do I have to type in the CMD?
I mean, ~\viewerbot>python threads_viewer.py RANDOMCHANNEL 1000 but how
like C:\WINDOWS\system32>threads_viewer.py UserXX AmountXX
or how? I don't get it.
error: No playable streams found on this URL
I think this project is great but was wondering if its possible to switch it over to a better App-Twitch interface that cuts out unnecessary parts to save on performance. As you can expect it would be pretty costly to run 100 of these bots at once. Basically, can Twitch viewing be simulated using http/https requests to save on performance. I do have a feeling it can be done but is very hard with the measures Twitch puts in to counter these bots.
which part of the code need modify if i want to use on another platform?
I always get this error, when i want to start the programm..
What Do I wrong?
I am running the below command and getting a syntax error. I was able to download all the requirements without issue. Can you assist?
python3 threads_viewer.py username 15
File "threads_viewer.py", line 85
print(f"Sent HEAD request with {current_proxy['http']} | {response.status_code} | {response.request} | {response}")
^
SyntaxError: invalid syntax
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.