迅雷加密链接批量转化

on under python
1 minute read

将thunder://….的link转化成可以在迅雷中直接下载的link,eg.ftp://…
that is:
thunder://… ==> ftp://… or something else
用于手机迅雷下载vedio时wifi下载速度不快,将手机迅雷中的相应下载link放到pc端下载.

def main():
    import re
    import base64
    def get_pure_list(list):
        pure_list=[]
        for each in list:
            each=re.sub(r'(\s)',"",each)
            pure_list.append(each)
            #re.sub(r'\r\n',"",each)
            #re.sub(r'\n',"",each)
        return pure_list
        
    f=open("1.txt","r+")
    all=f.readlines()
    f.close()
    all_pure="".join(get_pure_list(all))
    tmp=all_pure.split('thunder://')
    print all_pure
    for each in tmp[1:]:
        f=open("2.txt","a+")
        decode_link=base64.decodestring(each)[2:-2]
        print decode_link
        f.write(decode_link+'\r\n')
        f.close()

if __name__=='__main__':
    main()
auxilary, python
home
github
archive
category