All Projects → philipperemy → Expressvpn Python

philipperemy / Expressvpn Python

Licence: mit
ExpressVPN - Python Wrapper (public IP auto fetch).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Expressvpn Python

Docker Ipsec Vpn Server
Docker image to run an IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
Stars: ✭ 4,356 (+4534.04%)
Mutual labels:  vpn, vpn-client
Aws Vpn Server Setup
Setup your own private, secure, free* VPN on the Amazon AWS Cloud in 10 minutes. CloudFormation
Stars: ✭ 672 (+614.89%)
Mutual labels:  vpn, vpn-client
Algo
Set up a personal VPN in the cloud
Stars: ✭ 24,275 (+25724.47%)
Mutual labels:  vpn, vpn-client
Pi Hole On Google Compute Engine Free Tier With Full Tunnel And Split Tunnel Wireguard Vpn Configs
Run your own privacy-first ad blocking service at home, or in the cloud for free with Google Cloud Services.
Stars: ✭ 343 (+264.89%)
Mutual labels:  vpn, vpn-client
Subnet
Simple, auditable & elegant VPN, built with TLS mutual authentication and TUN.
Stars: ✭ 1,040 (+1006.38%)
Mutual labels:  vpn, vpn-client
Macosvpn
🔧 Create macOS VPNs programmatically (L2TP & Cisco)
Stars: ✭ 348 (+270.21%)
Mutual labels:  vpn, vpn-client
Openconnect
OpenConnect client extended to support Palo Alto Networks' GlobalProtect VPN
Stars: ✭ 654 (+595.74%)
Mutual labels:  vpn, vpn-client
KidVPN
The world's smallest VPN server and client.
Stars: ✭ 63 (-32.98%)
Mutual labels:  vpn, vpn-client
Ios App
Official IVPN iOS app
Stars: ✭ 89 (-5.32%)
Mutual labels:  vpn, vpn-client
Pritunl Client Electron
Pritunl OpenVPN client
Stars: ✭ 772 (+721.28%)
Mutual labels:  vpn, vpn-client
Android Vpn Client Ics Openvpn
⭐ Create your Android VPN App by using Android Studio and publish to Google Play Store 🤖
Stars: ✭ 270 (+187.23%)
Mutual labels:  vpn, vpn-client
Strongswan
strongSwan - IPsec-based VPN
Stars: ✭ 1,112 (+1082.98%)
Mutual labels:  vpn, vpn-client
android
Android eduVPN application
Stars: ✭ 80 (-14.89%)
Mutual labels:  vpn, vpn-client
Fanqiang Vpn.github.io
2021年 中国翻墙软件、VPN推荐指南,对比VPS搭建梯子、SSR机场、蓝灯、WireGuard、V2ray、老王VPN等科学上网软件与翻墙方法,中国最新科学上网翻墙VPN梯子下载推荐,稳定好用。
Stars: ✭ 390 (+314.89%)
Mutual labels:  vpn, vpn-client
desktop-app-daemon
Official IVPN Desktop app (service)
Stars: ✭ 34 (-63.83%)
Mutual labels:  vpn, vpn-client
Openvpn3
OpenVPN 3 is a C++ class library that implements the functionality of an OpenVPN client, and is protocol-compatible with the OpenVPN 2.x branch.
Stars: ✭ 510 (+442.55%)
Mutual labels:  vpn, vpn-client
iosvpn.github.io
iPhone和iOS 翻墙梯子VPN推荐,2022中国苹果手机iPhone翻墙软件和科学上网避坑指南,稳定梯子推荐。
Stars: ✭ 72 (-23.4%)
Mutual labels:  vpn, vpn-client
nordvpn
NordVpn Docker Client
Stars: ✭ 475 (+405.32%)
Mutual labels:  vpn, vpn-client
Node
Mysterium Network Node - official implementation of distributed VPN network (dVPN) protocol
Stars: ✭ 681 (+624.47%)
Mutual labels:  vpn, vpn-client
Gof5
Open Source F5 BIG-IP VPN client for Linux, MacOS, FreeBSD and Windows
Stars: ✭ 47 (-50%)
Mutual labels:  vpn, vpn-client

ExpressVPN - Python Wrapper (LINUX)

Full bash documentation: https://www.expressvpn.com/support/vpn-setup/app-for-linux/

This will not work on Windows!

Installation with PyPI

If the command expressvpn is already installed on your Ubuntu then just run this:

pip install expressvpn-python

Download/Install the package on the official website

The package DEB for Ubuntu 64bits 2.3.4 is already part of the repository. For another OS, please refer to: https://www.expressvpn.com/support/vpn-setup/app-for-linux/#download

git clone [email protected]:philipperemy/expressvpn-python.git evpn && cd evpn
sudo dpkg -i expressvpn_2.3.4-1_amd64.deb # will install the binaries provided by ExpressVPN
sudo pip install . # will install it as a package. Or install it within a virtualenv (better option).

Change your public IP every x seconds

Check the script: vpn.sh

Set up expressvpn

You can find your activation key here: https://www.expressvpn.com/setup.

expressvpn activate # paste your activate key and press ENTER.
expressvpn preferences set send_diagnostics false

After login and to logout, simply run:

expressvpn logout

NOTE that you will have to activate expressvpn again if you logout.

Python bindings

Connect

Bash

expressvpn connect

Python

from expressvpn import connect
connect()

Connect with alias

Bash

expressvpn connect [ALIAS]

Python

from expressvpn import connect_alias
connect_alias(alias: str)

Random connect

Python

from expressvpn.wrapper import random_connect
random_connect()

Disconnect

Bash

expressvpn disconnect

Python

from expressvpn import disconnect
disconnect()

IP auto switching

Sometimes websites like Amazon or Google will ban you after too many requests. It's easy to detect because your script will fail for some obscure reason. Most of the time, if the HTML contains the word captcha or if the websites returns 403, it means that you probably got banned. But don't panic, you can use a VPN coupled with IP auto switching. Here's an example of a scraper doing IP auto switching:

from expressvpn import wrapper
import logging

def main():
    while True:
        try:
            scrape()
        except BannedException as be:
            logging.info('BANNED EXCEPTION in __MAIN__')
            logging.info(be)
            logging.info('Lets change our PUBLIC IP GUYS!')
            change_ip()
        except Exception as e:
            logging.error('Exception raised.')
            logging.error(e)


def change_ip():
    max_attempts = 10
    attempts = 0
    while True:
        attempts += 1
        try:
            logging.info('GETTING NEW IP')
            wrapper.random_connect()
            logging.info('SUCCESS')
            return
        except Exception as e:
            if attempts > max_attempts:
                logging.error('Max attempts reached for VPN. Check its configuration.')
                logging.error('Browse https://github.com/philipperemy/expressvpn-python.')
                logging.error('Program will exit.')
                exit(1)
            logging.error(e)
            logging.error('Skipping exception.')
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].