Giter Club home page Giter Club logo

twitch-farmer's Introduction

Twitch Follower Bot Farmer (Twitch-Farmer)

Twitch Farmer is a bot that helps you to get more followers. Often when new twitch streamers start, they come to realize that their content does not get the quality it deserves. Due to the nature of Twitch, to sort the channels based on the follower count, new streamers do not get a chance at all to present their content. Twitch Farmer presents the solution, by offering all the needed features, to boost your channel in the ranks, while maintaining a natural look to other real viewers.

WRITTEN BY: Andrei Zgirvaci

CONTRIBUTE: Contributions are always welcome!

If you can, please take a minute to star this repo and follow me, It will be much appreciated!!!


Requirements

  • python version >= 3.7.0 installed

Installation

git clone https://github.com/MD3XTER/Twitch-Farmer.git

cd Twitch-Farmer

pip3 install selenium pandas

python3 twitch_farmer.py

Usage

In order for the bot to run, you need to add at least one account to the accounts.csv file located in the data folder.

You only need to specify the username and password, the following_channel and used_proxy columns are filled by the bot for log purposes.

username password following_channel used_proxy
root toor

Besides accounts.csv file you also need too specify the proxies in the proxies.csv file located in the data folder.

You only need to specify the proxy. The status column is filled by the bot for log purposes.

proxy status
192.168.0.1:3000

Maintaining this project

Now and then Twich changes it's elements ids, classes, etc. In order for the bot to work even after this changes, you need to change the value of a specific object in the page_elements.json file.

Example:

"username_input": {
  "type": "xPath",
  "value": "//div[contains(@data-a-target,'login-username-input')]/input"
},

If you wan`t to help the project grow, you can create a PR request if any xPath changes in the future.

twitch-farmer's People

Contributors

andrei-zgirvaci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitch-farmer's Issues

problem...help?

when i run the bot it is only a strokes of errors
image how can i fix it?

Too bad its not working anymore...

I like the concept of this program but since twitch changed their website HTML code, the driver cant detect old element names. Also, the higher security when trying to log in is difficult to bypass since it is asking me to input code that is sent to email. If it tries to log in right away again it will make you play a short game to detect you're not a bot. RIP

wrong chromedriver name and wrong chrome version [solved]

chromium really doesnt tell you whats wrong. first i used the default name for chromedriver.exe which needs to be chromedriver_win32.exe. Then I didnt check my chrome version before downloading. Error code was way at the bottom.

Hope his saves someone's time

now to figure out how to avoid twitch trying to verify my computer as a new machine

Chrome failed to start: exited abnormally

When executing

python3 twitch_farmer.py

I get

What channel should I follow? :
Using proxy: [****************:*****]

After inputing a channel I get the following exception:

Traceback (most recent call last):
File "twitch_farmer.py", line 254, in
main()
File "twitch_farmer.py", line 134, in main
run_driver(True)
File "twitch_farmer.py", line 231, in run_driver
executable_path=chrome_driver_path)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.15.0-58-generic x86_64)

Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in
import apt
File "/usr/lib/python3/dist-packages/apt/init.py", line 23, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
File "twitch_farmer.py", line 254, in
main()
File "twitch_farmer.py", line 134, in main
run_driver(True)
File "twitch_farmer.py", line 231, in run_driver
executable_path=chrome_driver_path)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in init
desired_capabilities=desired_capabilities)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.15.0-58-generic x86_64)

Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@value='Log In']"}

umm ...

I got the error after execute python3 Twitch-Farmer.py command.

my chrome browser has been opened, but get this error.

output:

Traceback (most recent call last):
  File "Twitch-Farmer.py", line 159, in <module>
    SetUp(proxies[proxy_count], username, password)
  File "Twitch-Farmer.py", line 21, in SetUp
    Login(username, password)
  File "Twitch-Farmer.py", line 69, in Login
    loginButtonElement = driver.find_element_by_xpath(loginButtonXpath)
  File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 293, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 752, in find_element
    'value': value})['value']
  File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@value='Log In']"}
  (Session info: chrome=55.0.2883.95)
  (Driver info: chromedriver=2.26.436421 (6c1a3ab469ad86fd49c8d97ede4a6b96a49ca5f6),platform=Mac OS X 10.12.1 x86_64)

Error with windowspath

Can anyone help me with this problem please?

Using proxy: [109.190.171.107:4145]
Traceback (most recent call last):
File "twitch_farmer.py", line 244, in
main()
File "twitch_farmer.py", line 135, in main
run_driver(True)
File "twitch_farmer.py", line 221, in run_driver
executable_path=chrome_driver_path)
File "C:\Users*\scoop\apps\python\current\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init
self.service.start()
File "C:\Users*
\scoop\apps\python\current\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
stdin=PIPE)
File "C:\Users*\scoop\apps\python\current\lib\subprocess.py", line 756, in init
restore_signals, start_new_session)
File "C:\Users*
\scoop\apps\python\current\lib\subprocess.py", line 1100, in _execute_child
args = list2cmdline(args)
File "C:\Users**\scoop\apps\python\current\lib\subprocess.py", line 511, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

Would it be possible to simulate Twitch viewing without using selenium for less performance cost

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.

Error when launching bot

I receive the following error when trying to start the bot:

Using proxy: [XXX.XXX.XXX.175:3128]
Traceback (most recent call last):
  File "twitch_farmer.py", line 254, in <module>
    main()
  File "twitch_farmer.py", line 134, in main
    run_driver(True)
  File "twitch_farmer.py", line 231, in run_driver
    executable_path=chrome_driver_path)
  File "/home/twitch/Twitch-Farmer/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__
    desired_capabilities=desired_capabilities)
  File "/home/twitch/Twitch-Farmer/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/home/twitch/Twitch-Farmer/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/twitch/Twitch-Farmer/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/home/twitch/Twitch-Farmer/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 4.4.0-148-generic x86_64)

Followed the steps on the installation guide, but created a new non-root user and created a virtualenv for python3.7 (deadsnakes repository, as im using ubuntu 16.04 and python 3.7 is not supported on default packages):

sudo adduser twitch

su twitch

cd

git clone https://github.com/MD3XTER/Twitch-Farmer.git

virtualenv -p /usr/bin/python3.7 Twitch-Farmer

source Twitch-Farmer/bin/activate

cd Twitch-Farmer

pip3 install selenium pandas

python3 twitch_farmer.py

What am I missing? Thank you for your work MD3XTER

Just the login screen

When it starts the code it loads correctly to the login screen of the twitch, but does not put the username nor the password, then gives the time and goes to the next proxy ip

what channel should i follow?: test
using proxy: ip:port

using username: test
using password: test


Time expired, changing proxy!!!(1)

AttributeError: 'DataFrame' object has no attribute 'username'

Traceback (most recent call last):
File "twitch_farmer.py", line 254, in
main()
File "twitch_farmer.py", line 126, in main
username_rows = accounts_csv.username
File "C:\Python3\lib\site-packages\pandas\core\generic.py", line 4376, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'username'

Error

Good afternoon, sorry for the inconvenience, but I put it according to the "README" and when I start the code it responds with this error:

user@server:~/Twitch-Farmer$ python3 twitch_farmer.py
What channel should I follow? : test
Traceback (most recent call last):
File "twitch_farmer.py", line 244, in
main()
File "twitch_farmer.py", line 120, in main
with open(get_full_path("/page_elements.json")) as page_elements_file:
TypeError: invalid file: PosixPath('/home/user/Twitch-Farmer/page_elements.json')

I didn't understand what the script exactly do..

Hello MD3XTER,

thank you for the sharing but i don't really understand whats the script doing here. Do he simply connect to an account (a fake account that we have created) then go to follow the channel we've just indicate?

Best Regards

Login page won't load

Getting this when starting the bot.. any ideas?

This site can’t be reached

The webpage at https://www.twitch.tv/login might be temporarily down or it may have moved permanently to a new web address.

ERR_TUNNEL_CONNECTION_FAILED

Error please help

Traceback (most recent call last):
File "Twitch-Farmer.py", line 163, in
SetUp(proxies[proxy_count], username, password)
File "Twitch-Farmer.py", line 15, in SetUp
driver = webdriver.Chrome(chrome_options=chrome_options)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 75, in init
desired_capabilities=desired_capabilities)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in init
self.start_session(desired_capabilities, browser_profile)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception
from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"B057B7CD5B054C2543B4285B9BFFDA4D","isDefault":true},"id":1,"name":"","origin":"://"}
(Session info: chrome=67.0.3396.99)
(Driver info: chromedriver=2.19.346063 (38b35413bd4a486d436a9749e090454bc9ff6708),platform=Mac OS X 10.12.6 x86_64)

subs prime

if i do this can work with twitch subs prime?

        sub_button = driver.find_element_by_xpath(
            get_page_element("sub_button"))

        sub_button.click()

        sleep(5)

        subprime_button = driver.find_element_by_xpath(
            get_page_element("subprime_button"))

        subprime_button.click()

        # wait for request
        sleep(5)

"subprime_button": {
    "type": "xPath",
    "value": "//button[@data-a-target='subscribe-with-prime-button']"
},
"sub_button": {
    "type": "xPath",
    "value": "//button[@data-a-target='subscribe-button']"
},

Proxy Type?

I am GUESSING these are only http proxies? or is there support for SOCKS?

IndentationError

After starting it with cmd I got this error.

File "Twitch-Farmer.py", line 166
print ("Bot Stopped!!!")
^
IndentationError: unindent does not match any outer indentation level

Spécial Question

If i give you m'y Twitch account can you fix the script for m'y account and transfer the file after that ?

Twitch-Farmet with oauth keys

Can Twitch-Farmet work with hash accs (not login:password)
I have a accs in format
loginname:oauthXXXXXXXXXXXXXXXXXXXXXXXXXX
how to gets this script work with this format?

Updated APIs

I heard that Twitch updated their APIs and most bots stopped working. Does this affect this bot? I tried using it today and it couldn't get past the first account.

Error!

Traceback (most recent call last):
File "twitch_farmer.py", line 254, in
main()
File "twitch_farmer.py", line 134, in main
run_driver(True)
File "twitch_farmer.py", line 210, in run_driver
current_proxy = find_available_proxy()
File "twitch_farmer.py", line 178, in find_available_proxy
proxies_csv = pandas.read_csv(proxies_csv_path, sep=',', dtype="str")
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 702, in parser_f
return _read(filepath_or_buffer, kwds)
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 435, in _read
data = parser.read(nrows)
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 1139, in read
ret = self._engine.read(nrows)
File "/usr/local/lib/python3.5/dist-packages/pandas/io/parsers.py", line 1995, in read
data = self._reader.read(nrows)
File "pandas/_libs/parsers.pyx", line 899, in pandas._libs.parsers.TextReader. read
File "pandas/_libs/parsers.pyx", line 914, in pandas._libs.parsers.TextReader. _read_low_memory
File "pandas/_libs/parsers.pyx", line 968, in pandas._libs.parsers.TextReader. _read_rows
File "pandas/_libs/parsers.pyx", line 955, in pandas._libs.parsers.TextReader. _tokenize_rows
File "pandas/_libs/parsers.pyx", line 2172, in pandas._libs.parsers.raise_pars er_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 2 fields in line 3, saw 5

root@WearyInternal-VM:/home/bot/Twitch-Farmer# pandas.errors.ParserError: Error tokenizing data. C error: Expected 2 fields in line 3, saw 5

How do I fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.