Closed sirzento closed 1 year ago
Hi, I am not sure if the library I am using for automatic download takes ARM arch into account. You can hardcode it though.
sudo apt-get install chromium-chromedriver
service = ChromeService('/home/something/')
It should work
Wow that was a fast answer.
Sadly I'm kinda a linux noob and I have no clue what I have to do on your step 2. Where is the driverPath
that I need to change?
The driver is on /usr/lib/chromium-browser/chromedriver
Ok nevermind. Found the place where I need to change it in the main.py. Problem is, that there are still error messages after starting:
*********************************************************
* Thank you for using Capsule Farmer! *
* Please consider supporting League of Poro on YouTube. *
*********************************************************
INFO: 2022/09/01 21:08:43 - Using configuration from: ./config.yaml
100% [..........................................................................] 7067070 / 7067070Traceback (most recent call last):
File "/home/EsportsCapsuleFarmer/./main.py", line 186, in <module>
driver = createWebdriver(browser, isHeadless and hasAutoLogin)
File "/home/EsportsCapsuleFarmer/./main.py", line 40, in createWebdriver
return webdriver.Chrome(service=service, options=options)
File "/root/.local/share/virtualenvs/EsportsCapsuleFarmer-aO-VNY7R/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__
super().__init__(DesiredCapabilities.CHROME['browserName'], "goog",
File "/root/.local/share/virtualenvs/EsportsCapsuleFarmer-aO-VNY7R/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 92, in __init__
super().__init__(
File "/root/.local/share/virtualenvs/EsportsCapsuleFarmer-aO-VNY7R/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 277, in __init__
self.start_session(capabilities, browser_profile)
File "/root/.local/share/virtualenvs/EsportsCapsuleFarmer-aO-VNY7R/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 370, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/root/.local/share/virtualenvs/EsportsCapsuleFarmer-aO-VNY7R/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 435, in execute
self.error_handler.check_response(response)
File "/root/.local/share/virtualenvs/EsportsCapsuleFarmer-aO-VNY7R/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, 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/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x005588bdbe54 <unknown>
#1 0x00558895e9bc <unknown>
#2 0x00558897e280 <unknown>
#3 0x00558897a7e8 <unknown>
#4 0x0055889ac1f8 <unknown>
#5 0x005588983658 <unknown>
#6 0x005588c1bcdc <unknown>
#7 0x005588c1ec54 <unknown>
#8 0x005588c09bb0 <unknown>
#9 0x005588c1f540 <unknown>
#10 0x005588bfecec <unknown>
#11 0x005588c386a0 <unknown>
#12 0x005588c387ec <unknown>
#13 0x005588c50bc0 <unknown>
#14 0x007fb2961628 <unknown>
#15 0x007fb248e01c <unknown>
Installed chromium: Version 101.0.4951.57 (Official Build) Built on Debian , running on (64-bit)
Update: Selenium realy doesn't like to be run as root so running it with the pi user works!
There is only a slight problem left. When running it in headless mode, the login fails Automatic login failed, incorrect credentials?
. There isn't even a log message that says that the credentials are submitted so it fails before that somehow. The error message appears exactly after 20s so I guess the WebDriverWait().until
is running in a timeout. Setting it to 50s will throw the error after 50s.
Running it with the browser visible does work.
I'm glad you got it working. Just a note, the bot is completely untested on raspi/ARM and you are probably the first one to try.
I would test it, but all my Pis are running non-standard OS.
Could you add driver.save_screenshot('screenshot.png')
before or after the wait just so we can see what's happening?
EDIT: If you save two screenshots they need to have different names
Here is the screenshot.
Since it is in german the translation is:
A problem has occurred with the OAuth2 protocol. Please try again later.
We are sorry, the login servers are temporarily unavailable. Please try again later. Under Service Status you can find more information
Running farmer inside Raspberry Pi gave my quite a headache. I settled to running it in docker-composed config, where browser and farmer run in separate containers. Check my fork if you are interesed.
Running farmer inside Raspberry Pi gave my quite a headache. I settled to running it in docker-composed config, where browser and farmer run in separate containers. Check my fork if you are interesed.
Thanks, I will try that. I see that you added the 'remote' option as browser. Should I use this? And I guess you did test it with firefox right? Edit: I can't even install docker right on my system... Can it work without it?
Running farmer inside Raspberry Pi gave my quite a headache. I settled to running it in docker-composed config, where browser and farmer run in separate containers. Check my fork if you are interesed.
Thanks, I will try that. I see that you added the 'remote' option as browser. Should I use this? And I guess you did test it with firefox right? Edit: I can't even install docker right on my system... Can it work without it?
Unfortunately not :( By the way if you manage to install docker on your device I extended README.md with detailed instructions.
Running farmer inside Raspberry Pi gave my quite a headache. I settled to running it in docker-composed config, where browser and farmer run in separate containers. Check my fork if you are interesed.
Added link to your repo to Readme. Thanks for solving that!
Running farmer inside Raspberry Pi gave my quite a headache. I settled to running it in docker-composed config, where browser and farmer run in separate containers. Check my fork if you are interesed.
Added link to your repo to Readme. Thanks for solving that!
No problem :) Glad I could help. Thank you for creating farmer for us, lazy people :)
@kacperkr90 I can't open an issue on your fork so I will ask you here. I forgot to add the last two key in the api.env and now it is throwing errors that it can't find those keys. What must I do to refresh the keys after I added those to the api.env file? It wasn't restarting the docker container
Never mind, got it. But I have another error. This is my log: https://i.imgur.com/gsodtHC.png
strange thing is, that everything after the "INFO next check" was posted at 18:13. But the next check should have been on 18:06.
Any Ideas to that error?
EDIT: Could be because my RAM and SWP was full.
EDIT2: I still have some errors. I got it to work for a few hours and now it started to throw errors. Here is my log: https://pastebin.com/raw/snyRAJqp
Hey, I enabled issues on my fork, so if you have any other problems you can create discussion there :)
Anyway, I see that you are using the old version of the code. Yesterday I reverted changes related to switching to Twitch provider (Now I see that OVERRIDES are easier and simpler solution).
To update composed config do the following:
EDIT: I'll remove printing password in log, it was done for debugging purposes.
@kacperkr90 ~I can't open an issue on your fork so I will ask you here. I forgot to add the last two key in the api.env and now it is throwing errors that it can't find those keys. What must I do to refresh the keys after I added those to the api.env file? It wasn't restarting the docker container~
Never mind, got it. But I have another error. This is my log: https://i.imgur.com/gsodtHC.png
strange thing is, that everything after the "INFO next check" was posted at 18:13. But the next check should have been on 18:06.
Any Ideas to that error?
EDIT: Could be because my RAM and SWP was full.
EDIT2: I still have some errors. I got it to work for a few hours and now it started to throw errors. Here is my log: https://pastebin.com/raw/snyRAJqp
I get this error when trying to start the script:
Running on Raspbian Bullseye with Python 3.10