thebrumby / HotWalletClaimer

Looking to optimize HOT earnings on Near Protocol, Wave on SUI, Vertus on TON, or other supported apps like Hamster Kombat? This Python script monitors and claims rewards for your favorite Telegram crypto games. It avoids API injections by simulating mouse movements in a real browser.
MIT License
146 stars 46 forks source link

Help Me: My Telegram account has been logout on my device #239

Open wordfangsss opened 1 day ago

wordfangsss commented 1 day ago

My Telegram account has been logged out on all devices, and I no longer have access to the phone number to request OTP. However, I checked on my VPS, and it turns out that my Telegram session in Selenium is still running and has not been logged out. To ensure that the session is still active, I tried running one of the Telegram games like ./launch.sh seed and logged in using the Telegram session that I had previously backed up when I first ran the script. Now, the question is, how can I log in again to my Telegram app on my device?

thebrumby commented 15 hours ago

Hi,

You can create a Python file to extract the OTP. Here's how:

  1. On your VPS, save the script at the bottom of this reply in your games folder as otp.py:

  2. Run the script on your VPS using this command:

    ./launch.sh otp
  3. When prompted, select No to updating the settings.

  4. Choose any wallet name or use the default.

  5. Attempt to log into your Telegram account on your preferred device via the phone number and OTP method.

  6. Once the OTP has been sent, go back to your VPS, and select the account from your saved Telegram session.

  7. The VPS will return a message like The most recent OTP was: 12345...

  8. Enter the OTP on your preferred device, and you should be logged back into your Telegram account.

import os
import shutil
import sys
import time
import re
import json
import getpass
import random
import subprocess
from PIL import Image
from pyzbar.pyzbar import decode
import qrcode_terminal
import fcntl
from fcntl import flock, LOCK_EX, LOCK_UN, LOCK_NB
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException, ElementClickInterceptedException
from datetime import datetime, timedelta
from selenium.webdriver.chrome.service import Service as ChromeService

from claimer import Claimer

class OTPFinder(Claimer):

    def initialize_settings(self):
        super().initialize_settings()
        self.script = "games/cold.py"
        self.prefix = "BNB-Cold:"
        self.url = "https://web.telegram.org/k/#777000"
        self.pot_full = "Filled"
        self.pot_filling = "Mining"
        self.seed_phrase = None
        self.forceLocalProxy = False
        self.forceRequestUserAgent = False
        self.start_app_xpath = "//button//span[contains(text(), 'Open Wallet')]"

    def __init__(self):
        self.settings_file = "variables.txt"
        self.status_file_path = "status.txt"
        self.wallet_id = ""
        self.load_settings()
        self.random_offset = random.randint(self.settings['lowestClaimOffset'], self.settings['highestClaimOffset'])
        super().__init__()

    def next_steps(self):
        # Initialise Chrome/Chromium & load the login notification service user (ID 777000)
        self.step = "01"
        self.driver = self.get_driver()
        self.driver.get(self.url)
        # Check for the last OTP & Print it
        xpath = "(//span[@class='translatable-message'])[last()]"
        self.target_element = self.move_and_click(xpath,10, False, "read the last OTP code ", "08", "visible")
        OTP = self.monitor_element(xpath, 10, "grab the last OTP")
        OTP = self.strip_html_and_non_numeric(OTP)
        print(f"The most recent OTP was: {OTP}")
        # Close the session
        self.quit_driver()

def main():
    claimer = OTPFinder()
    claimer.run()

if __name__ == "__main__":
    main()
wordfangsss commented 4 hours ago

Hi,

You can create a Python file to extract the OTP. Here's how:

  1. On your VPS, save the script at the bottom of this reply in your games folder as otp.py:
  2. Run the script on your VPS using this command:
    ./launch.sh otp
  3. When prompted, select No to updating the settings.
  4. Choose any wallet name or use the default.
  5. Attempt to log into your Telegram account on your preferred device via the phone number and OTP method.
  6. Once the OTP has been sent, go back to your VPS, and select the account from your saved Telegram session.
  7. The VPS will return a message like The most recent OTP was: 12345...
  8. Enter the OTP on your preferred device, and you should be logged back into your Telegram account.
import os
import shutil
import sys
import time
import re
import json
import getpass
import random
import subprocess
from PIL import Image
from pyzbar.pyzbar import decode
import qrcode_terminal
import fcntl
from fcntl import flock, LOCK_EX, LOCK_UN, LOCK_NB
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException, ElementClickInterceptedException
from datetime import datetime, timedelta
from selenium.webdriver.chrome.service import Service as ChromeService

from claimer import Claimer

class OTPFinder(Claimer):

    def initialize_settings(self):
        super().initialize_settings()
        self.script = "games/cold.py"
        self.prefix = "BNB-Cold:"
        self.url = "https://web.telegram.org/k/#777000"
        self.pot_full = "Filled"
        self.pot_filling = "Mining"
        self.seed_phrase = None
        self.forceLocalProxy = False
        self.forceRequestUserAgent = False
        self.start_app_xpath = "//button//span[contains(text(), 'Open Wallet')]"

    def __init__(self):
        self.settings_file = "variables.txt"
        self.status_file_path = "status.txt"
        self.wallet_id = ""
        self.load_settings()
        self.random_offset = random.randint(self.settings['lowestClaimOffset'], self.settings['highestClaimOffset'])
        super().__init__()

    def next_steps(self):
        # Initialise Chrome/Chromium & load the login notification service user (ID 777000)
        self.step = "01"
        self.driver = self.get_driver()
        self.driver.get(self.url)
        # Check for the last OTP & Print it
        xpath = "(//span[@class='translatable-message'])[last()]"
        self.target_element = self.move_and_click(xpath,10, False, "read the last OTP code ", "08", "visible")
        OTP = self.monitor_element(xpath, 10, "grab the last OTP")
        OTP = self.strip_html_and_non_numeric(OTP)
        print(f"The most recent OTP was: {OTP}")
        # Close the session
        self.quit_driver()

def main():
    claimer = OTPFinder()
    claimer.run()

if __name__ == "__main__":
    main()

image_2024-09-24_01-21-11 showing error like this

wordfangsss commented 3 hours ago

i check the logs error showing like this

Traceback (most recent call last): File "/root/HotWalletBot/games/seed.py", line 268, in main() File "/root/HotWalletBot/games/seed.py", line 265, in main claimer.run() File "/root/HotWalletBot/games/claimer.py", line 166, in run wait_time = self.full_claim() File "/root/HotWalletBot/games/seed.py", line 100, in full_claim self.launch_iframe() File "/root/HotWalletBot/games/claimer.py", line 865, in launch_iframe self.send_start(self.step) File "/root/HotWalletBot/games/claimer.py", line 971, in send_start if not attempt_send_start(): # Retry after restoring backup File "/root/HotWalletBot/games/claimer.py", line 957, in attempt_send_start chat_input.send_keys("/start") File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py", line 231, in send_keys self._execute( File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute return self._parent.execute(command, params) File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute self.error_handler.check_response(response) File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: stale element not found (Session info: chrome=128.0.6613.137); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception Stacktrace:

0 0x56362c7fa34a

1 0x56362c4ded70

2 0x56362c4eef51

3 0x56362c4e53fc

4 0x56362c4e3719

5 0x56362c4e680f

6 0x56362c4e68bc

7 0x56362c52e5a2

8 0x56362c52e633

9 0x56362c525148

10 0x56362c552532

11 0x56362c5220e8

12 0x56362c5526fe

13 0x56362c57062e

14 0x56362c5522d3

15 0x56362c520325

16 0x56362c52132e

17 0x56362c7c30cf

18 0x56362c7c7186

19 0x56362c7b09e7

20 0x56362c7c7921

21 0x56362c797cee

22 0x56362c7e9458

23 0x56362c7e9658

24 0x56362c7f8f6d

25 0x7f79a2821ac3

Traceback (most recent call last): File "/root/HotWalletBot/games/seed.py", line 268, in main() File "/root/HotWalletBot/games/seed.py", line 265, in main claimer.run() File "/root/HotWalletBot/games/claimer.py", line 166, in run wait_time = self.full_claim() File "/root/HotWalletBot/games/seed.py", line 100, in full_claim self.launch_iframe() File "/root/HotWalletBot/games/claimer.py", line 865, in launch_iframe self.send_start(self.step) File "/root/HotWalletBot/games/claimer.py", line 971, in send_start if not attempt_send_start(): # Retry after restoring backup File "/root/HotWalletBot/games/claimer.py", line 958, in attempt_send_start chat_input.send_keys(Keys.RETURN) File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py", line 231, in send_keys self._execute( File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute return self._parent.execute(command, params) File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute self.error_handler.check_response(response) File "/root/HotWalletBot/venv/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: stale element not found (Session info: chrome=128.0.6613.137); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception Stacktrace:

0 0x555b8f65034a

1 0x555b8f334d70

2 0x555b8f344f51

3 0x555b8f33b3fc

4 0x555b8f339719

5 0x555b8f33c80f

6 0x555b8f33c8bc

7 0x555b8f37cbf1

8 0x555b8f3a8532

9 0x555b8f3780e8

10 0x555b8f3a86fe

11 0x555b8f3c662e

12 0x555b8f3a82d3

13 0x555b8f376325

14 0x555b8f37732e

15 0x555b8f6190cf

16 0x555b8f61d186

17 0x555b8f6069e7

18 0x555b8f61d921

19 0x555b8f5edcee

20 0x555b8f63f458

21 0x555b8f63f658

22 0x555b8f64ef6d

23 0x7fa024173ac3

so i think the sessions is not active again right?