thebrumby / HotWalletClaimer

Looking to optimize your earnings with HOT tokens on the Near Protocol? How about Wave on SUI? Tree on BSC? Or Vertus on Ton? This Python script simplifies the process by monitoring your account status within popular Telegram apps, ensuring rewards are claimed at the correct time.
MIT License
89 stars 31 forks source link

Running in phone #8

Closed hawryyy30 closed 1 month ago

hawryyy30 commented 1 month ago

Is it possible running this in mobile phone. I'm using Ubuntu on UserLAnd but i can't seem to install it properly

this is the logs i got :

024-05-15 05:41:34 (675 KB/s) - 'chromedriver-linux64.zip' saved [8679823/8679823]                                   
Archive:  chromedriver-linux64.zip                           inflating: chromedriver-linux64/LICENSE.chromedriver
  inflating: chromedriver-linux64/chromedriver             ./install.sh: line 58: google-chrome: command not found
./install.sh: line 59: /usr/local/bin/chromedriver: No such file or directory
                                                           Installed Versions:
PM2 version: [PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized                          5.3.1
Python version: Python 3.10.12                             Node.js version: v22.1.0
npm version: 10.7.0                                        Google Chrome version:
ChromeDriver version:
thebrumby commented 1 month ago

Hi,

I'm on iPhone myself, so I couldn't say for sure. I've not tried to install it on a mobile phone personally, but if it worked it would transform the hardware requirements to run the script.

Looking at the output, everything is installed with the exception of Google Chrome and Chromedriver. Have you tried other ways of trying to install those two packages? Or maybe you could try to manually install a line at a time?

Start by installing Chrome Driver

Download the Chrome deb package

wget -O /tmp/chrome.deb https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_124.0.6367.91-1_amd64.deb

Install the package

sudo dpkg -i /tmp/chrome.deb

Fix any dependency issues

sudo apt-get install -f -y

Remove the downloaded deb package

rm /tmp/chrome.deb

Install any additional dependencies that may be required for Chrome

sudo apt-get install -y libxss1 libappindicator1 libindicator7

And now for Chrome Driver

Ensure unzip is installed

sudo apt install -y unzip

Download the Chromedriver zip file

wget https://storage.googleapis.com/chrome-for-testing-public/124.0.6367.91/linux64/chromedriver-linux64.zip

Unzip the downloaded file

unzip chromedriver-linux64.zip

Remove the zip file

rm chromedriver-linux64.zip

Move the chromedriver to a location in your PATH and make it executable

sudo mv chromedriver /usr/local/bin/ sudo chmod +x /usr/local/bin/chromedriver

hawryyy30 commented 1 month ago

@thebrumby Thanks for the reply. I might be wrong, but i can't install the chrome because chrome only supports amd64, which doesnt match my system(arm64). Can i perhaps use chromium as alternative?

thebrumby commented 1 month ago

Hi,

You're correct, I believe that Google Chrome only supports amd64 architecture, which obviously wouldn't work on an arm64 system.

I'll have a play in the coming days to see if I can get an installer that works with both platforms.

hawryyy30 commented 1 month ago

I tried your solution earlier and unfortunately still no luck.

This time i have this error

Activating virtual environment...
Running script: ./hot.py
Traceback (most recent call last):
  File "/root/HotWalletBot/./hot.py", line 15, in <module>
    from webdriver_manager.chrome import ChromeDriverManager
ModuleNotFoundError: No module named 'webdriver_manager'
Deactivating virtual environment...

I've seen some references out there, and the code you provide are similar to those. I don't know if im close or not. But i would be happy to help test things out if you want, otherwise, im looking forward to your next update.

Thanks for your patience. Have a great day

thebrumby commented 1 month ago

Actually, I added another post but removed it!

source venv/bin/activate
pip install webdriver_manager
deactivate

When ran from the HotWalletBot directory would install the module, but in my testing, it didn't work in Ubuntu 24 ran on ARM64 so I deleted it to avoid too much confusion :D

hawryyy30 commented 1 month ago

😂😂 I tried it and it works now we are onto another error, is this the error you encountered?

Your session will be prefixed with: HOT:
Enter your unique Session Name here, or hit <enter> for the next sequential wallet: tele1
Traceback (most recent call last):
  File "/root/HotWalletBot/./hot.py", line 1145, in <module>
    main()
  File "/root/HotWalletBot/./hot.py", line 1082, in main
    log_into_telegram()
  File "/root/HotWalletBot/./hot.py", line 364, in log_into_telegram
    driver = get_driver()
  File "/root/HotWalletBot/./hot.py", line 244, in get_driver
    driver = setup_driver()
TypeError: setup_driver() missing 1 required positional argument: 'session_path'
Deactivating virtual environment...
thebrumby commented 1 month ago

Nope, a different error :D

Around line 214 it should actually read

def setup_driver():

thebrumby commented 1 month ago

But then after that, I just hung indefinitely because apparently there is no "official" Linux ARN64 driver, I'm just trying to find a work around :)

thebrumby commented 1 month ago

Hey Buddy,

Thanks for your patience and support! After 12 hours of experimentation, I’m excited to share that I’ve just released version 3.0.2, which includes ARM64 Linux support. I've tested it with a couple of versions of Ubuntu on AWS and it appears to work correctly.

Now for the million-dollar question! Will this allow people to run it on their mobile devices? Over to you for the answer :)

And one final thought: The default method of logging into Telegram is by scanning a QR code, which you may not be able to do if you also need the same device for Telegram. In this instance, you can edit the settings can change the option to allow login by QR code to "n". Otherwise, you have to wait until it displays 5 QR codes, and then it will fail back to the One-Time Password method using the country your mobile phone is registered in and your phone number.

hawryyy30 commented 1 month ago

Hi, thanks for your hard work ! Sorry for the late reply :". The install process took so much times due to bad internet connection.

It still has error on the chromedriver, i have made sure that the chromium was downloaded and not corrupted. I hope its just a minor error.

here is the latest log:

chromium-chrom 100%   4.96M  9.34KB/s    in 9m 55s

2024-05-16 02:15:35 (8.54 KB/s) - 'chromium-chromedriver_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb' saved [5201396/5201396]

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reading state information... Done
Selecting previously unselected package chromium-chromedriver.
(Reading database ... 51510 files and directories currently installed.)
Preparing to unpack chromium-chromedriver_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb ...
Unpacking chromium-chromedriver (112.0.5615.49-0ubuntu0.18.04.1) ...
Setting up chromium-chromedriver (112.0.5615.49-0ubuntu0.18.04.1) ...
./install.sh: line 148: /usr/local/bin/chromedriver: No such file or directory

Installed Versions:
PM2 version: [PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
[PM2] PM2 Successfully daemonized
5.3.1
Python version: Python 3.10.12
Node.js version: v22.2.0
npm version: 10.7.0
Chromium/Chrome version: 107.0.5304.62
Chromedriver version:
Architecture: aarch64
Note: x86_64 users can run this script again to switch between Google Chrome/Chromium browsers.
root@localhost:~/HotWalletBot# ./launch.sh
Listing available Telegram Claim Assistant scripts:
1) ./cold.py
2) ./hot.py
3) ./tree.py
4) ./vertus.py
5) ./wave.py
Please select a script by number:
2
Activating virtual environment...
Running script: ./hot.py with arguments:
Initialising the HOT: Wallet Auto-claim Python Script - Good Luck!

Current settings:
forceClaim: False
debugIsOn: False
hideSensitiveInput: True
screenshotQRCode: True
maxSessions: 1
verboseLevel: 2
lowestClaimOffset: 0
highestClaimOffset: 15
forceNewSession: False

Should we update our settings? (Default:<enter> / Yes = y):
Your session will be prefixed with: HOT:
Enter your unique Session Name here, or hit <enter> for the next sequential wallet: tg1
Initial ChromeDriver setup may have failed: [Errno 2] No such file or directory: '/usr/local/bin/chromedriver'
Please ensure you have the correct ChromeDriver version for your system.
Deactivating virtual environment...
hawryyy30 commented 1 month ago

I have this figured out. Turns out, there are 2 locations for chrome driver, 1 for chromium and 1 for chrome. Since i use chromium i mv the existing chromedriver to another location and then symlinked chromium driver location to usr/local/bin

now chromedriver --version is finally detected

But, i have another error, i encountered this error too yesterday, when i tried running the script in my cloud VPS(running ubuntu 22)

HOT ERROR

Your session will be prefixed with: HOT:
Enter your unique Session Name here, or hit <enter> for the next sequential wallet: tele1

CHROME DRIVER INITIALISED: Try not to exit the script before it detaches.
Step 02 - Initiating the One-Time Password (OTP) method...

Step 02 - Attempting to switch to log in by phone number...
Step 02 - An error occurred while trying to switch to log in by phone number: Message: move target out of bounds
  (Session info: headless chrome=107.0.5304.62)
Stacktrace:
#0 0x00300033a1dc <unknown>
#1 0x0030002f2b80 <unknown>
#2 0x0030000e317c <unknown>
#3 0x00300014d198 <unknown>
#4 0x003000144e44 <unknown>
#5 0x00300010bd7c <unknown>
#6 0x00300010cc9c <unknown>
#7 0x0030003158a8 <unknown>
#8 0x003000325614 <unknown>
#9 0x0030003251a8 <unknown>
#10 0x00300035f6bc <unknown>
#11 0x003000325ea4 <unknown>
#12 0x00300030a780 <unknown>
#13 0x00300032fe80 <unknown>
#14 0x00300032ffa4 <unknown>
#15 0x003000345964 <unknown>
#16 0x00786917d5c8 <unknown>
#17 0x0078691e5edc <unknown>

Step 03 - Attempting to update users country...
Step 03 - Please enter your Country Name as it appears in the Telegram list: ID
Traceback (most recent call last):
  File "/root/HotWalletBot/./hot.py", line 1149, in <module>
    main()
  File "/root/HotWalletBot/./hot.py", line 1086, in main
    log_into_telegram()
  File "/root/HotWalletBot/./hot.py", line 401, in log_into_telegram
    target_element.send_keys(user_input)
AttributeError: 'NoneType' object has no attribute 'send_keys'
Deactivating virtual environment...
root@localhost:~/HotWalletBot#

VERTUS ERROR

Your session will be prefixed with: Vertus:
Enter your unique Session Name here, or hit <enter> for the next sequential wallet: tg2

CHROME DRIVER INITIALISED: Try not to exit the script before it detaches.
Step 02 - Initiating the One-Time Password (OTP) method...

Step 02 - Attempting to switch to log in by phone number...
Step 03 - Attempting to update users country...
Step 03 - Please enter your Country Name as it appears in the Telegram list: ID
Step 04 - Attempting to request users phone number...
Step 04 - Please enter your phone number without leading 0 (visible input): 8*****128
Step 05 - Attempting to click next to proceed to OTP entry...
Step 06 - What is the Telegram OTP from your app? 2****
Step 08 - Attempting to check for 2FA requirement (will timeout if you don't have 2FA)...
Step 08 - 2FA input field not found.

CHROME DRIVER DETACHED: It is now safe to exit the script.
Would you like to backup your Telegram directory? (Y/n): y
Enter a custom filename for the backup (leave blank for default): tg1
Traceback (most recent call last):
  File "/root/HotWalletBot/./vertus.py", line 1094, in <module>
    main()
  File "/root/HotWalletBot/./vertus.py", line 1035, in main
    next_steps()
  File "/root/HotWalletBot/./vertus.py", line 506, in next_steps
    cookies = driver.get_cookies()
AttributeError: 'NoneType' object has no attribute 'get_cookies'
Deactivating virtual environment...
thebrumby commented 1 month ago

Hi again,

It seems like you've had some progress, even if we're not totally there yet! In both the examples you shared, it looks like an error was thrown at the point where we were trying to interact with the target_element returned by the move_and_click() function. However, in my tests on AWS yesterday, I didn't experience the issues you're reporting with Chromium 112 on the ARM64 architecture.

I'm wondering if the error is being reported from headless Chrome 107 instead of 112? To help diagnose this, could you try running the steps from the installer one by one to see if that's part of the problem? This way, we can pinpoint where things might be going wrong. Here’s a quick checklist:

sudo apt-get clean
sudo apt-get autoclean
sudo rm -rf /var/lib/apt/lists/
sudo apt update
sudo apt-get install xdg-utils libasound2-dev -y
# Fetch and install chromium-codecs-ffmpeg-extra
wget http://launchpadlibrarian.net/660838579/chromium-codecs-ffmpeg-extra_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb
sudo gdebi -n chromium-codecs-ffmpeg-extra_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb

# Fetch and install chromium-browser
wget http://launchpadlibrarian.net/660838574/chromium-browser_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb
sudo gdebi -n chromium-browser_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb

# Fetch and install chromium-chromedriver
wget http://launchpadlibrarian.net/660838578/chromium-chromedriver_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb
sudo gdebi -n chromium-chromedriver_112.0.5615.49-0ubuntu0.18.04.1_arm64.deb

You could also type these in the command line interface (before and after) to see how it reports the situation:

google-chrome --version
# or
chromium-browser --version
chromedriver --version
bedjoey commented 1 month ago

CHROME DRIVER INITIALISED: Try not to exit the script before it detaches. Step 01 - Backup restored successfully. Step 01 - Attempting to verify if we are logged in (hopefully QR code is not present). Step 01 - nothing found to action. The QR code test passed.

Step 02 - Attempting to check for the start button (should not be present)... Step 02 - Timeout while trying to check for the start button (should not be present). Step 03 - Attempting to open a link for the app... Step 03 - Failed to find the 'Open Wallet' button within the expected timeframe.

Step 03 - Attempting to find the chat window/message input box... Step 03 - Timeout while trying to find the chat window/message input box. Step 03 - Failed to find the message input box.

Step 03 - Attempting to restore from backup and retry.

CHROME DRIVER DETACHED: It is now safe to exit the script. Session released: ./selenium/Wave:Wallet2 Session started: ./selenium/Wave:Wallet2 in status.txt

CHROME DRIVER INITIALISED: Try not to exit the script before it detaches.

where is the problem?