Sign inSign up

dumbaspl/windscribe-ephemeral-port-torrent

By dumbaspl

Updated about 1 month ago

Image
0

222

dumbaspl/windscribe-ephemeral-port-torrent repository overview

windscribe-ephemeral-port-torrent

Automatically create ephemeral ports in Windscribe and update your torrent client to use the new port

Caution

v3 has not been well tested yet, use at your own risk. Feedback welcome.

Features

  • Automatically (re)create ephemeral port forwards in Windscribe
  • Automatically update your torrent client to use the new port
  • Support for multiple torrent clients:
  • Automatically update port forwarding in Gluetun

Setup

Getting authHash

What? Why?

A while ago Windscribe added Cloudflare CAPTCHA, and their own CAPTCHA to the login endpoint, so we can no longer log in using the normal credentials reliably. Normal web sessions expire, but the session in the Windscribe app doesn't. Turns out that at some point, they decided to merge the APIs, and now the same token that's used in the app also works on the web. This means that you only need to extract it once, and as long as you don't log out of the desktop app, it will keep working.

How?

Download the official app and log in

There is a (vibe coded) Python script available here that will extract it for you (Tested on Linux/Windows)

For manual extraction, the value you're looking for is named authHash and is located inside of the wsnetSettings key in:

  • Linux: $XDG_CONFIG_HOME/Windscribe/Windscribe2.conf
  • Windows: HKCU\Software\Windscribe\Windscribe2
  • Mac: I have no idea, and neither does the slop generator it seems, feel free to contribute.

DON'T LOG OUT! It will invalidate the session. If you want to log out without invalidating it, remove the configuration files listed above instead.

Configuration

Configuration is done using environment variables

At least one torrent client or gluetun is required to be configured.

VariableDescriptionRequiredDefault
WINDSCRIBE_AUTH_HASHauthHash extracted from the desktop appYES
DELUGE_URLThe base URL for the deluge web UINO
DELUGE_PASSWORDThe password for the deluge web UINO
DELUGE_HOST_IDThe internal host id to connect to in the deluge web UI. It will be printed in stdout after the first successful connection to delugeOnly if you have more than one connection configured in connection managerIf you have multiple configured in deluge web ui the app will print them out and crash. If you have only one, that one will be used, and you don't need to specify it explicitly
QBITTORRENT_URLThe base URL for the qBittorrent web UINO
QBITTORRENT_API_KEYThe API key for the qBittorrent (qBittorrent >= v5.2.0)NO
TRANSMISSION_URLThe base URL for the transmission web UI (transmission >= 4.1)NO
TRANSMISSION_USERNAMEThe username for the transmission web UINO
TRANSMISSION_PASSWORDThe password for the transmission web UINO
GLUETUN_URLThe base URL for the gluetun Control serverNO
GLUETUN_API_KEYThe API key for the gluetun Control server (needs /v1/portforward permission)NO
WINDSCRIBE_RETRY_DELAYhow long to wait (in milliseconds) before retrying after a windscribe error.NO3600000 (1 hour)
WINDSCRIBE_EXTRA_DELAYhow long to wait (in milliseconds) after the ephemeral port expires before trying to create a new one.NO60000 (1 minute)
TORRENT_RETRY_DELAYhow long to wait (in milliseconds) before retrying after a torrent client errorNO300000 (5 minutes)

Running

Using docker (and docker compose in this example)
services:
  windscribe-ephemeral-port-torrent:
    image: dumbaspl/windscribe-ephemeral-port-torrent:latest
    restart: unless-stopped
    environment:
      WINDSCRIBE_AUTH_HASH: <authHash>
      # DELUGE_URL: http://deluge:8112
      # DELUGE_PASSWORD: <password>
      # QBITTORRENT_URL: http://qbittorrent:8080
      # QBITTORRENT_API_KEY: <apiKey>
      # TRANSMISSION_URL: http://transmission:9091
      # TRANSMISSION_USERNAME: <username>
      # TRANSMISSION_PASSWORD: <password>
      # GLUETUN_URL: http://gluetun:8000
      # GLUETUN_API_KEY: <apiKey>
Native

make a .env file with the necessary configuration

go build -o windscribe-ephemeral-port-torrent
./windscribe-ephemeral-port-torrent

Make yourself a systemd service or something

AI disclaimer

Previous versions of this project were fully handwritten by me, this is an AI-assisted rewrite of the original codebase in GO with support for more torrent clients.

All code has been reviewed and tested by me.

License

MIT

Contributing

With pet projects, I prefer to write things myself. No guarantees that I won't abandon your PR for 2 years and then re-write it. Debugging, testing, and feedback always welcome.

Tag summary

Content type

Image

Digest

sha256:7d1c4d24b

Size

3.5 MB

Last updated

about 1 month ago

docker pull dumbaspl/windscribe-ephemeral-port-torrent:3.0.0-rc2