1. 程式人生 > >python3, 解析迅雷地址為原地址

python3, 解析迅雷地址為原地址

.post pos 解析 pla tool __main__ cdr pre pytho

解析迅雷地址為原地址,
gist地址: https://gist.github.com/leo493852107/b51b8f8cd3af4594a716920f3648d58b
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = "leo"
__time__ = "2018-01-12"


‘‘‘
解析迅雷地址為原地址

thunder://QUFodHRwJTNBJTJGJTJGenVpZGF6eS54dW5sZWl6aXl1YW4ubmV0JTJGMTgwMSUyRiVFOCU5OSU4RSVFNSU5NSVCOCVFOSVCRSU5OSVFNSU5MCU5Ri00MC5tcDRaWg==

參考:
http://www.iplaypy.com/code/security/se2360.html
‘‘‘ import base64 import re from urllib.parse import unquote import urllib3 import requests def convert_thunder_url(thunder_url): request_url = "https://tool.lu/urlconvert/ajax.html" params = { "link": thunder_url } res = requests.post(request_url, params=params).json() http_str
= res[text][http] return http_str def jie_ma(http_str): print(unquote(http_str)) def convert_2(thunder_url): tmp = thunder_url.replace(thunder://, ‘‘) http_str = base64.b64decode(tmp.encode()).decode(gbk)[2:-2] return http_str if __name__ == __main__: print("將迅雷鏈接轉換為真實地址:
") while True: thunder_url = input("請輸入迅雷鏈接:") http_str = convert_2(thunder_url) jie_ma(http_str) # while True: # thunder_url = input("請輸入迅雷鏈接:") # http_str = convert_thunder_url(thunder_url) # jie_ma(http_str)

python3, 解析迅雷地址為原地址