Giter VIP home page Giter VIP logo

warp-cloner's Introduction

Warp Cloner

warp-cloner

Simple Python script that can clone Warp Plus keys.

With this script you will be able to clone many 12-24 PB keys.

Installation

  1. Clone this repository
  2. Install Python 3.11 or higher
  3. Install dependencies using pip install -r requirements.txt
  4. Copy .env.example to .env and fill variables (see next section)
  5. Launch script using python -u src/main.py
  6. Wait for results in console.

Configuration

  • BASE_KEYS (optional) - keys to clone divided as array in JSON format (ex: ["key1", "key2"]), if none then default keys will be used (script may not work with default keys)
  • THREADS_COUNT (default: 1) - amount of threads.
  • DEVICE_MODELS (optional) - custom device model names divided as array in JSON format (ex: ["Android", "Secret Device"])
  • SAVE_WIREGUARD_VARIABLES (default: false) - should script get variables that are required to generate WireGuard config (peer ips, private / public key, endpoint)?
  • PROXY_FILE (optional) - path to proxy file, if none then script will be launched in proxyless mode.
  • DELAY (default: 25) - seconds to sleep after key clone
  • OUTPUT_FILE (default: output.txt) - file to append generated keys
  • OUTPUT_FORMAT (default: {key} | {referral_count}) - output format (if SAVE_WIREGUARD_VARIABLES is set to true, additinal variables is available: {private_key}, {peer_endpoint}, {peer_public_key}, {interface_addresses}, {reserved})
  • WEBHOOK_KEYS_URL (optional) - http endpoint that will accept post request with key data
  • RETRY_COUNT (default: 3) - how much times application will retry generation with same key

Notes

Proxy format

Proxy format for PROXY_FILE is protocol://user:pass@ip:port, example: socks5://example.org:1892 / http://totoro:[email protected], one proxy per line.

Getting your own 12-24 PB keys to fill BASE_KEYS

You can get your own key to start with using @warpplus's bot (limited to 1 key per 24 hours) or find some keys on forums.

Properly closing application

To avoid getting error "Too many connected devices" in future, you should properly exit from the application by pressing control + c and wait for application to close (it will take ~30 seconds).

Proxy selection

You can use almost any proxy (ipv4 / ipv6) as far as they don't block Warp API endpoint. I suggest you to use ipv6 proxy because they are way cheaper, but keep in mind, that your network should support ipv6 in most cases to do this.

Contributing

I will support this project as far as I can, but issues and pull requests are always welcome!

License

This project licensed under MIT License.

Support me

You can support my further developments or support this project by buying me a coffee using link below or by starring this repo ♥

Buy Me A Coffee

warp-cloner's People

Contributors

dependabot[bot] avatar jogerj avatar misaka-blog avatar totoroterror 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

warp-cloner's Issues

Properly work with parallel generations

In current release, we're waiting for slowest response and then handle all answers, it will be better to add some kind of workers

async def worker(id: int, initial_delay: int = 0, keys: list[str] = config.BASE_KEYS.split(',')):
    await sleep(initial_delay) 
    while True:
         await clone_key(...)
         await sleep(cfg.DELAY)
   
async def main():
     await asyncio.gather(worker(i, cfg.delay / worker_num * i) for i in range(worker_num) )

错误

2024-01-15 20:03:31.129 | ERROR | main:custom_clone_key:43 - Failed to add key: 400 {"result":null,"success":false,"errors":[{"code":1056,"message":"Too many connected devices."}],"messages":[]} (key: W32Zg5F7-V92mt68f-1dep203B, retry count: 0)

TypeError

hi.
how to resolve this error?

host@server:~/warp-cloner$ python3 -u src/main.py
Traceback (most recent call last):
  File "/home/unko/warp-cloner/src/main.py", line 7, in <module>
    from config import config
  File "/home/unko/warp-cloner/src/config.py", line 5, in <module>
    class Settings(BaseSettings):
  File "/home/unko/warp-cloner/src/config.py", line 13, in Settings
    PROXY_FILE: str | None = Field(env='PROXY_FILE', default=None)
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

env:

# BASE_KEYS=
THREADS_COUNT=1
PROXY_FILE=/home/unko/warp-cloner/proxies.txt
DELAY=25
OUTPUT_FILE=output.txt
OUTPUT_FORMAT={key}

custom cycle function

i think it will be better to replace current key dispenser algorythm with a custom cycle function that allows dynamic arrays.
the problem in current implementation is that on some point key_counter will be at ~end of keys array and it will produce results like [300, 1, 2, 302, 1, 304, etc.] and probably will overflow first keys with "Too many connected devices"

win子系统ubuntu运行出错

Traceback (most recent call last):
File "/home/vip/warp-cloner/src/main.py", line 8, in
from warp import clone_key, GetInfoData
File "/home/vip/warp-cloner/src/warp.py", line 1, in
from distutils.command.config import config
ModuleNotFoundError: No module named 'distutils.command'

How do i fix this

Failed to register: 400 {"success":false,"result":null,"errors":["Invalid registration request"],"messages":[]} (key: Failed to register: 400 {"success":false,"result":null,"errors":["Invalid registration request"],"messages":[]} (key: XXXXX-XXXXX-XXXXX)

It always shows even tho i have fully working keys any ways how to fix
(i redacted the key so no one connects)

there's problem installing the script any solution?

pip install -r requirements.txt
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting aiodns~=3.0.0
Using cached aiodns-3.0.0.tar.gz (6.7 kB)
ERROR: Could not find a version that satisfies the requirement aiohttp~=3.8.5 (from -r requirements.txt (line 2)) (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 0.8.3, 0.8.4, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.14.2, 0.14.3, 0.14.4, 0.15.0, 0.15.1, 0.15.2, 0.15.3, 0.16.0, 0.16.1, 0.16.2, 0.16.3, 0.16.4, 0.16.5, 0.16.6, 0.17.0, 0.17.1, 0.17.2, 0.17.3, 0.17.4, 0.18.0, 0.18.1, 0.18.2, 0.18.3, 0.18.4, 0.19.0, 0.20.0, 0.20.1, 0.20.2, 0.21.0, 0.21.1, 0.21.2, 0.21.4, 0.21.5, 0.21.6, 0.22.0a0, 0.22.0b0, 0.22.0b1, 0.22.0b2, 0.22.0b3, 0.22.0b4, 0.22.0b5, 0.22.0b6, 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.22.4, 0.22.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 2.0.0rc1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6.post1, 2.0.7, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.3.0a4, 2.3.0, 2.3.1, 2.3.2b2)
ERROR: No matching distribution found for aiohttp~=3.8.5 (from -r requirements.txt (line 2))

Android problem

aarch64-linux-android-clang -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -DHAVE_CONFIG_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DCARES_STATICLIB=1 -Ideps/build-config/config_android -Ideps/build-config/include -Ideps/c-ares/include -I/data/data/com.termux/files/usr/include/python3.11 -c deps/c-ares/src/lib/ares_getnameinfo.c -o build/temp.linux-aarch64-cpython-311/deps/c-ares/src/lib/ares_getnameinfo.o
deps/c-ares/src/lib/ares_getnameinfo.c:300:15: error: call to undeclared function 'getservbyport_r'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (getservbyport_r(port, proto, &se, (void )tmpbuf,
^
deps/c-ares/src/lib/ares_getnameinfo.c:300:15: note: did you mean 'getservbyport'?
/data/data/com.termux/files/usr/include/netdb.h:262:17: note: 'getservbyport' declared here
struct servent
getservbyport(int __port_in_network_order, const char* __proto);
^
1 error generated.
error: command '/data/data/com.termux/files/usr/bin/aarch64-linux-android-clang' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycares
Building wheel for yarl (pyproject.toml) ... done
Created wheel for yarl: filename=yarl-1.8.2-cp311-cp311-linux_aarch64.whl size=151345 sha256=0754ec4db656cc27ea313367a0c6d137d56ef80eb634b35ca0d2e99a9341b709
Stored in directory: /data/data/com.termux/files/home/.cache/pip/wheels/94/cd/3e/4b106d0785f75161a57556e0b5daffd2ad0e80a6db033e6087
Successfully built aiohttp cffi frozenlist multidict yarl
Failed to build pycares
ERROR: Could not build wheels for pycares, which is required to install pyproject.toml-based projects

Invalid scheme proxy

Screenshot_20230606-180704_Termux
Yep i ran it on termux the proxies are made by me and works gracefully its the code i think

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.