Decoding Real Addresses from Xunlei Thunder Download Links
Students who frequently download videos and games often encounter Xunlei download links starting with ’thunder://’, but are often unable to download due to copyright issues. Here, we will explain the conversion between regular download URLs and Xunlei download links.
For example, a random download link is:
https://www.bobobk.com/favicon.ico
1. Converting a Regular URL to a Xunlei Link
1.1 Add “AA” to the beginning and “ZZ” to the end of the original URL. The address becomes: AAhttps://www.bobobk.com/favicon.icoZZ
1.2 Base64 encode this address:
QUFodHRwczovL3d3dy5ib2JvYmsuY29tL2Zhdmljb24uaWNvWlo=
1.3 The Xunlei dedicated link is created by adding thunder://
before the above address:
thunder://QUFodHRwczovL3d3dy5ib2JvYmsuY29tL2Zhdmljb24uaWNvWlo=
Conversion Code
import base64
def convert_to_thunder(s):
s1 = "AA"+s+"ZZ"
s2 = base64.b64encode(s1.encode())
s3 = "thunder://" + s2.decode()
return s3
normal_url = 'https://www.bobobk.com/favicon.ico'
print(convert_to_thunder(normal_url))
2. Converting a Xunlei Link to a Regular URL
2.1 Remove “thunder://” from the beginning of the original link.
The address becomes:
QUFodHRwczovL3d3dy5ib2JvYmsuY29tL2Zhdmljb24uaWNvWlo=
2.2 Base64 decode this address:
AAhttps://www.bobobk.com/favicon.icoZZ
2.3 Remove “AA” from the front and “ZZ” from the back.
https://www.bobobk.com/favicon.ico
Conversion Code
import base64
def convert_thunder(s):
s1 = s.strip().split("//")[1]
s2 = base64.b64decode(s1).decode()
s3 = s2[2:-2]
return s3
thunder = 'thunder://QUFodHRwczovL3d3dy5ib2JvYmsuY29tL2Zhdmljb24uaWNvWlo='
print(convert_thunder(thunder))
JavaScript Code
Running Python code on another server can be cumbersome. Here’s JavaScript code that can be run directly in a browser to get the results.
// decode
var rawcode = document.querySelector("#de_thunder").value.substring(10);
var decodedadd = window.atob(rawcode);
var decodedadd = decodedadd.substring(2,decodedadd.length-2); // Corrected line: 'substring' should be 'decodedadd.substring'
document.querySelector('#decoded').innerHTML = decodedadd;
// encode
var rawcode = document.querySelector("#en_thunder").value; // Removed .substring(10) since this is the input for encoding, not a thunder link
var encodedadd = window.btoa("AA".concat(rawcode,"ZZ"));
var encodedadd = "thunder://".concat(encodedadd);
document.querySelector('#encoded').innerHTML = encodedadd;
Conclusion
This article demonstrates how to encrypt and decrypt Xunlei links using both Python and JavaScript. You can also use the tool on Chunjiang Muker Xunlei Encryption and Parsing.
- 原文作者:春江暮客
- 原文链接:https://www.bobobk.com/en/299.html
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。