Setup - adam1x/ThunderRedirect GitHub Wiki

Install / prepare these

To use this script, you will need the following software / dependencies:

And you will need an HTTP proxy server that can access *.xunlei.com without being redirected to www.kankan.com. Any server within mainland China should work, while those in the U.S. generally won't.

Load Xunlei Lixian's webpage

There are two ways to set up a proxy server for Xunlei Lixian's webpages only.

Method 1: using a PAC (proxy auto-config) file

Here is a sample PAC file (without a valid proxy server address) which routes all geoblocked Lixian webpages through the given proxy:

var HTTP_PROXY = "PROXY {insert valid HTTP proxy server here}";

function FindProxyForURL(url, host)
{
    if (shExpMatch(host, "vod*.*.lixian.vip.xunlei.com") ||
        shExpMatch(host, "dl.*.lixian.vip.xunlei.com"))
    {
        return "DIRECT";
    }
    
    if (shExpMatch(url, "http://*.xunlei.com*"))
    {
        return HTTP_PROXY;
    }

    return "DIRECT";
}

Upload this file to a publicly accessible URL, and fill it into your system's proxy settings.
For example, on macOS, open up System Preferences and navigate to Network -> Advanced... -> Proxies -> Automatic Proxy Configuration. And fill in the URL field.

You may need to restart your browser, reconnect to the internet, or restart the entire system for this to take effect.

Method 2: using a Chrome extension

For this method, you will need Chrome and Proxy SwitchyOmega.

Once you have both installed, create a Proxy Profile in Proxy SwitchyOmega with your HTTP proxy server, which should look like the picture below:

Now create a Switch Profile with the following source code (click on Edit source code), where {PROXY_PROFILE_NAME} is how you named the Proxy Profile that has just been created:

[SwitchyOmega Conditions]
@with result

dl*.*.lixian.vip.xunlei.com +direct
vod*.*.lixian.vip.xunlei.com +direct
*.xunlei.com +{PROXY_PROFILE_NAME}

* +direct

Save, and activate this Switch Profile by left-clicking on the extension's icon in Chrome Menu and selecting the profile.

Having followed either one of the methods, you should now be able to load http://lixian.xunlei.com and log in without a problem (as long as your proxy is working).

Export download commands from Lixian's webpage

Once you have ThunderLixianExporter loaded into Tampermonkey or Greasemonkey, there should be a new dropdown menu available in the Lixian webpage's toolbar: 批量导出.

Go ahead and select one (or more) download tasks and click on 批量导出. Then select Aria2 in the dropdown menu. You should see a pop up window titled aria2 download command. Copy all of the text within the body of this window (watch out, it could be long).

Download with aria2

Launch aria2 with this command: aria2c --enable-rpc --rpc-listen-all, either on your machine or some other device on the network (e.g. a Raspberry Pi). Note the domain name or IP address of this device.

Run this script: python3 main.py. Input the address of the device aria2 is running on, as well as the secret token if there is one, as prompted. And then enter the address of the HTTP proxy (IP address and port number) you are using to access Xunlei Lixian.

Finally, paste in the aria2 commands you have copied before as prompted, and your downloads will be processed and downloaded by aria2.