├── proxy.txt ├── requirements.txt ├── LICENSE ├── node.py └── README.md /proxy.txt: -------------------------------------------------------------------------------- 1 | http://Username:Password@ip:port 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | websockets==12.0 3 | loguru 4 | websockets-proxy 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 0xSolana 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import requests 3 | import json 4 | import time 5 | import uuid 6 | from loguru import logger 7 | 8 | # Constants 9 | NP_TOKEN = "WRITE_YOUR_NP_TOKEN_HERE" 10 | PING_INTERVAL = 30 # seconds 11 | RETRIES = 60 # Global retry counter for ping failures 12 | 13 | DOMAIN_API = { 14 | "SESSION": "https://api.nodepay.ai/api/auth/session", 15 | "PING": "https://nw2.nodepay.ai/api/network/ping" 16 | } 17 | 18 | CONNECTION_STATES = { 19 | "CONNECTED": 1, 20 | "DISCONNECTED": 2, 21 | "NONE_CONNECTION": 3 22 | } 23 | 24 | status_connect = CONNECTION_STATES["NONE_CONNECTION"] 25 | token_info = NP_TOKEN 26 | browser_id = None 27 | account_info = {} 28 | 29 | def uuidv4(): 30 | return str(uuid.uuid4()) 31 | 32 | def valid_resp(resp): 33 | if not resp or "code" not in resp or resp["code"] < 0: 34 | raise ValueError("Invalid response") 35 | return resp 36 | 37 | async def render_profile_info(proxy): 38 | global browser_id, token_info, account_info 39 | 40 | try: 41 | np_session_info = load_session_info(proxy) 42 | 43 | if not np_session_info: 44 | response = call_api(DOMAIN_API["SESSION"], {}, proxy) 45 | valid_resp(response) 46 | account_info = response["data"] 47 | if account_info.get("uid"): 48 | save_session_info(proxy, account_info) 49 | await start_ping(proxy) 50 | else: 51 | handle_logout(proxy) 52 | else: 53 | account_info = np_session_info 54 | await start_ping(proxy) 55 | except Exception as e: 56 | logger.error(f"Error in render_profile_info for proxy {proxy}: {e}") 57 | error_message = str(e) 58 | if any(phrase in error_message for phrase in [ 59 | "sent 1011 (internal error) keepalive ping timeout; no close frame received", 60 | "500 Internal Server Error" 61 | ]): 62 | logger.info(f"Removing error proxy from the list: {proxy}") 63 | remove_proxy_from_list(proxy) 64 | return None 65 | else: 66 | logger.error(f"Connection error: {e}") 67 | return proxy 68 | 69 | def call_api(url, data, proxy): 70 | headers = { 71 | "Authorization": f"Bearer {token_info}", 72 | "Content-Type": "application/json" 73 | } 74 | 75 | try: 76 | response = requests.post(url, json=data, headers=headers, proxies={"http": proxy, "https": proxy}, timeout=10) 77 | response.raise_for_status() 78 | except requests.RequestException as e: 79 | logger.error(f"Error during API call: {e}") 80 | raise ValueError(f"Failed API call to {url}") 81 | 82 | return valid_resp(response.json()) 83 | 84 | async def start_ping(proxy): 85 | try: 86 | await ping(proxy) 87 | while True: 88 | await asyncio.sleep(PING_INTERVAL) 89 | await ping(proxy) 90 | except asyncio.CancelledError: 91 | logger.info(f"Ping task for proxy {proxy} was cancelled") 92 | except Exception as e: 93 | logger.error(f"Error in start_ping for proxy {proxy}: {e}") 94 | 95 | async def ping(proxy): 96 | global RETRIES, status_connect 97 | 98 | try: 99 | data = { 100 | "id": account_info.get("uid"), 101 | "browser_id": browser_id, 102 | "timestamp": int(time.time()) 103 | } 104 | 105 | response = call_api(DOMAIN_API["PING"], data, proxy) 106 | if response["code"] == 0: 107 | logger.info(f"Ping successful via proxy {proxy}: {response}") 108 | RETRIES = 0 109 | status_connect = CONNECTION_STATES["CONNECTED"] 110 | else: 111 | handle_ping_fail(proxy, response) 112 | except Exception as e: 113 | logger.error(f"Ping failed via proxy {proxy}: {e}") 114 | handle_ping_fail(proxy, None) 115 | 116 | def handle_ping_fail(proxy, response): 117 | global RETRIES, status_connect 118 | 119 | RETRIES += 1 120 | if response and response.get("code") == 403: 121 | handle_logout(proxy) 122 | elif RETRIES < 2: 123 | status_connect = CONNECTION_STATES["DISCONNECTED"] 124 | else: 125 | status_connect = CONNECTION_STATES["DISCONNECTED"] 126 | 127 | def handle_logout(proxy): 128 | global token_info, status_connect, account_info 129 | 130 | token_info = None 131 | status_connect = CONNECTION_STATES["NONE_CONNECTION"] 132 | account_info = {} 133 | save_status(proxy, None) 134 | logger.info(f"Logged out and cleared session info for proxy {proxy}") 135 | 136 | def load_proxies(proxy_file): 137 | try: 138 | with open(proxy_file, 'r') as file: 139 | proxies = file.read().splitlines() 140 | return proxies 141 | except Exception as e: 142 | logger.error(f"Failed to load proxies: {e}") 143 | raise SystemExit("Exiting due to failure in loading proxies") 144 | 145 | def save_status(proxy, status): 146 | pass 147 | def save_session_info(proxy, data): 148 | pass 149 | def load_session_info(proxy): 150 | return {} 151 | def is_valid_proxy(proxy): 152 | return True 153 | def remove_proxy_from_list(proxy): 154 | pass 155 | async def main(): 156 | with open('proxy.txt', 'r') as f: 157 | all_proxies = f.read().splitlines() 158 | 159 | active_proxies = [proxy for proxy in all_proxies[:100] if is_valid_proxy(proxy)] # By default 100 proxies will be run at once 160 | tasks = {asyncio.create_task(render_profile_info(proxy)): proxy for proxy in active_proxies} 161 | 162 | while True: 163 | done, pending = await asyncio.wait(tasks.keys(), return_when=asyncio.FIRST_COMPLETED) 164 | for task in done: 165 | failed_proxy = tasks[task] 166 | if task.result() is None: 167 | logger.info(f"Removing and replacing failed proxy: {failed_proxy}") 168 | active_proxies.remove(failed_proxy) 169 | if all_proxies: 170 | new_proxy = all_proxies.pop(0) 171 | if is_valid_proxy(new_proxy): 172 | active_proxies.append(new_proxy) 173 | new_task = asyncio.create_task(render_profile_info(new_proxy)) 174 | tasks[new_task] = new_proxy 175 | tasks.pop(task) 176 | 177 | for proxy in set(active_proxies) - set(tasks.values()): 178 | new_task = asyncio.create_task(render_profile_info(proxy)) 179 | tasks[new_task] = proxy 180 | 181 | await asyncio.sleep(3) # Prevent tight loop in case of rapid failures 182 | 183 | if __name__ == '__main__': 184 | try: 185 | asyncio.run(main()) 186 | except (KeyboardInterrupt, SystemExit): 187 | logger.info("Program terminated by user.") 188 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NodePay Multi Account 100% Uptime FREE Python Bot [v2] Bot 2 | 3 | This Python Bot script manages WebSocket connections through specified HTTP proxies, Unlimited Proxies and multiple Nodepay Accounts handling authentication and maintaining persistent connections with a server. The script also includes functionality to periodically send ping messages to keep the connection alive forever. If you can run your pc 24/7 then you dont need a Vps or proxy server lol. 4 | 5 | ## Features 6 | 7 | - Connects to a WebSocket server using HTTP proxies. 8 | - Handles Multiple Nodepay User IDs at once !! Multiple Proxies (1 Proxy ~60 $NODEPAY) 9 | - Per Proxy ~1400 ** $NODEPAY per day** Unlimited proxies Make Unlimited Money ! 10 | - Handles All kinds of Error such a Dead proxy/ SSL: WRONG_VERSION_NUMBER / sent 1011 (internal error) keepalive ping timeout; no close frame received / 500 Internal Server Error / sent 1011 (internal error) keepalive. 11 | - Automatically removes the dead proxy from the File!! 12 | 13 | #Get NP_TOKEN 14 | 15 | 1. Open the link and log in [https://app.nodepay.ai/dashboard](https://app.nodepay.ai/dashboard) 16 | 2. Press F12 on the page to open the console and enter the code (Ctrl + Shift + i) inspect 17 | 3. Write `localStorage.getItem('np_token');` in the console 18 | 4. "PRINTED TEXT IS THE Np _TOKEN" 19 | 5. ![image](https://github.com/Solana0x/nodepay/assets/142747768/bf907faa-0e56-4935-a5dc-da95f612fa07) 20 | 21 | #Get USer_Id (NOT NEEDED IN NEW CODE) 22 | 23 | 1. Press F12 on the page to open the console and enter the code (Ctrl + Shift + i) inspect 24 | 2. Go To Networks Tab in the Inspect 25 | 3. Search for the Devices then check the response 26 | 4. You will Get the User-id there 27 | 5. ![image](https://github.com/Solana0x/nodepay/assets/142747768/d9b07511-0554-4330-8d7c-81395b92c25b) 28 | 29 | #Get Proxies IP address HTTP 30 | 31 | 1. Create a Account in [https://www.webshare.io/?referral_code=gppl5h10bwn5](https://www.webshare.io/?referral_code=gppl5h10bwn5) 32 | 2. For webshare plan are 1000 Proxy for 1 Month !! hence total earning is => 43,200,000 $NODEPAY Points 33 | 3. ![image](https://github.com/Solana0x/nodepay/assets/142747768/82eb59b5-9f74-4d14-96b0-c35bb1e8925e) 34 | 4. You Got 1000 Ips now => Earning == ~1,440,000 Tokens per day and distribute Ips across multiple accounts / User ID !! You get 250GB bandwidth so create 20-30 Nodepay accounts to get 25-30M nodepay points per day 35 | 5. USe only webshare to Buy proxy because as of now only webshare website opened port for nodepay ! other proxy sellers i dont know ! 36 | 37 | ## Requirements 38 | 39 | - Invitation link Nodepay Accounts ( [https://app.nodepay.ai/register?ref=PGiwMlh6dQJVmxE](https://app.nodepay.ai/register?ref=PGiwMlh6dQJVmxE) ) 40 | - Python (install Python By - https://www.python.org/downloads/ [windows/mac]) or Ubuntu Server [`sudo apt install python3`] 41 | - VPS Server ! You can get Via AWS free Tier or Google Free tier or Gitpod or any online for just ~ 2-5$ per month 42 | - Proxy Server - you can buy DataCenter Proxies to Earn $NODEPAY Some Free Cheap proxies (Best proxy providers is webshare) 43 | - Get NP_token andcUser ID from Nodepay Dashboard 44 | 45 | ## SETPS TO RUN THE CODE - 46 | 47 | Before running the script, ensure you have Python installed on your machine. Then, install the necessary Python packages using: 48 | 49 | 1. ``` git clone https://github.com/Solana0x/nodepay.git ``` 50 | 2. ``` cd nodepay ``` 51 | 3. ``` pip install -r requirements.txt ``` 52 | 4. Replace `NP TOken` list in correct formate in `node.py` File Line ```9```. 53 | 5. By default 100 proxies will be taken randomly if you wana change then change here `active_proxies = [proxy for proxy in all_proxies[:100] if is_valid_proxy(proxy)]` line 169. Here 100 means 100 proxy will be used at once. 54 | 6. Dont Forget to add multiple proxies in the proxy.txt file you can add 1000+ proxy !! Formate # `HTTP://username:pass@ip:port`. 55 | 7. You can get Multiple Proxy Ip address from Proxies.fo Website !! [use multiple IP ! `1 IP == ~1400 $NODEPAY per Day `. 56 | 8. To Run Script `python3 node.py` - Proxy one 57 | 10. To Run multiple User ID just copy paste the `node.py` file code and create new python file and repeat the process !!. 58 | 59 | **Note** - 1 ip == 1000-1400 $Nodepay Per Day. 60 | 61 | ![image](https://github.com/Solana0x/nodepay/assets/142747768/cbfd5d20-6d30-494c-9af1-34c2415d27d1) 62 | 63 | ## FOR ANY KIND OF HELP CONTACT : ` 0xphatom ` on Discord https://discord.com/users/979641024215416842 64 | 65 | 66 | 67 | 68 | # NodePay 多账户 100% 在线免费 Python 机器人 [v1] 69 | 70 | 此 Python 机器人脚本通过指定的 HTTP 代理管理 WebSocket 连接,支持无限代理和多个 Nodepay 账户,处理身份验证并保持与服务器的持久连接。脚本还包括定期发送 ping 消息以保持连接永久在线的功能。如果你可以全天候运行电脑,就不需要 VPS 或代理服务器。 71 | 72 | ## 功能 73 | 74 | - 使用 HTTP 代理连接到 WebSocket 服务器。 75 | - 同时处理多个 Nodepay 用户 ID!多个代理 (1 代理 ~60 $NODEPAY)。 76 | - 每个代理每天约 1400 $NODEPAY,无限代理无限赚钱! 77 | - 处理各种错误,如死代理/SSL: WRONG_VERSION_NUMBER/发送 1011(内部错误)保持连接 ping 超时;未收到关闭帧/500 内部服务器错误/发送 1011(内部错误)保持连接。 78 | - 自动从文件中删除死代理! 79 | 80 | #获取 NP_TOKEN 81 | 82 | 1. 打开链接并登录 [https://app.nodepay.ai/dashboard](https://app.nodepay.ai/dashboard) 83 | 2. 在页面上按 F12 打开控制台并输入代码(Ctrl + Shift + i)检查 84 | 3. 在控制台中输入 `localStorage.getItem('np_token');` 85 | 4. "打印的文本是 NP_TOKEN" 86 | 5. ![image](https://github.com/Solana0x/nodepay/assets/142747768/bf907faa-0e56-4935-a5dc-da95f612fa07) 87 | 88 | #获取用户 ID (新代码中不需要) 89 | 90 | 1. 在页面上按 F12 打开控制台并输入代码(Ctrl + Shift + i)检查 91 | 2. 转到检查中的网络标签 92 | 3. 搜索设备然后检查响应 93 | 4. 你会在那里得到用户 ID 94 | 5. ![image](https://github.com/Solana0x/nodepay/assets/142747768/d9b07511-0554-4330-8d7c-81395b92c25b) 95 | 96 | #获取代理 IP 地址 HTTP 97 | 98 | 1. 创建一个账户在 [https://www.webshare.io/?referral_code=gppl5h10bwn5](https://www.webshare.io/?referral_code=gppl5h10bwn5) 99 | 2. 对于 webshare 计划,每月 1000 个代理!!因此总收入为 => 43,200,000 $NODEPAY 点数 100 | 3. ![image](https://github.com/Solana0x/nodepay/assets/142747768/82eb59b5-9f74-4d14-96b0-c35bb1e8925e) 101 | 4. 你现在有了 1000 个 IP => 收入 == 每天约 1,440,000 代币,并在多个账户/用户 ID 中分配 IP!你有 250GB 带宽,因此可以创建 20-30 个 Nodepay 账户,每天获得 25-30M nodepay 点数 102 | 5. 只使用 webshare 购买代理,因为目前只有 webshare 网站为 nodepay 打开端口!其他代理卖家我不知道! 103 | 104 | ## 要求 105 | 106 | - 邀请链接 Nodepay 账户 ( [https://app.nodepay.ai/register?ref=PGiwMlh6dQJVmxE](https://app.nodepay.ai/register?ref=PGiwMlh6dQJVmxE) ) 107 | - Python (通过 https://www.python.org/downloads/ [windows/mac] 安装 Python) 或 Ubuntu 服务器 [`sudo apt install python3`] 108 | - VPS 服务器!你可以通过 AWS 免费套餐或 Google 免费套餐或 Gitpod 或任何在线获得,只需每月约 2-5 美元 109 | - 代理服务器 - 你可以购买数据中心代理来赚取 $NODEPAY 一些免费便宜的代理(最佳代理提供商是) 110 | - 从 Nodepay 仪表板获取 NP_token 和用户 ID 111 | 112 | ## 运行代码的步骤 - 113 | 114 | 在运行脚本之前,确保你的计算机上已安装 Python。然后,使用以下命令安装必要的 Python 包: 115 | 116 | 1. ``` git clone https://github.com/Solana0x/nodepay.git ``` 117 | 2. ``` cd nodepay ``` 118 | 3. ``` pip install -r requirements.txt ``` 119 | 4. 在“node.py”文件行“``9```中以正确的格式替换“NP TOken”列表。 120 | 5. 默认情况下,如果您想更改,将随机获取 100 个代理,然后在此处更改 `active_proxies = [proxy for proxy in all_proxies[:100] if is_valid_proxy(proxy)]` 第 169 行。这里 100 表示将同时使用 100 个代理。 121 | 6. 不要忘记在 proxy.txt 文件中添加多个代理,你可以添加 1000+ 个代理!格式 # `HTTP://username:pass@ip:port`。 122 | 7. 你可以从 Proxies.fo 网站获取多个代理 IP 地址!![使用多个 IP!`1 IP == 每天约 1400 $NODEPAY`。WEBSHARE 123 | 8. 运行脚本 `python3 node.py` - 代理一个 124 | 9. 要运行多个用户 ID,只需复制粘贴 `node.py` 文件代码并创建新 Python 文件并重复该过程!! 125 | 126 | **注意** - 1 个 IP == 每天 1000-1400 $Nodepay。 127 | 128 | ![image](https://github.com/Solana0x/nodepay/assets/142747768/52323bc5-a151-44de-8038-f79b970736b5) 129 | 130 | ## 任何帮助请联系:` 0xphatom ` 在 Discord 上 https://discord.com/users/979641024215416842 131 | 132 | --------------------------------------------------------------------------------