普通链接与迅雷、旋风、快车链接相互转化的步骤

把普通链接转为迅雷、旋风、快车链接(过程返过来就可以把迅雷、旋风、快车链接变成普通链接)

关于迅雷、快车、超级旋风下载地址加密算法都是通过base64算法加密,只不过在加密前后做了一些特别的标志。Base64编码是一种加密算法

1、  迅雷专用链接编码 

          原地址为:http://im.baidu.com/install/BaiduHi.exe

          a   在原地址前面加"AA",后面加"ZZ"(不包括引号),地址变为:AAhttp://im.baidu.com/install/BaiduHi.exeZZ 

          b   此地址base64编码为:

                QUFodHRwOi8vaW0uYmFpZHUuY29tL2luc3RhbGwvQmFpZHVIaS5leGVaWg== 

         c    迅雷专链即在上地址前加thunder://,即:

               Thunder://QUFodHRwOi8vaW0uYmFpZHUuY29tL2luc3RhbGwvQ mFpZHVIaS5leGVaWg==

2、  快车专用链接编码

        a   在原地址前后都加上"[FLASHGET]"(不包括引号),地址变为:[FLASHGET]http://im.baidu.com/install/BaiduHi.exe[FLASHGET]

        b   此地址base64编码为:

                W0ZMQVNIR0VUXWh0dHA6Ly9pbS5iYWlkdS5jb20vaW5zdGFsbC9CYWlkdUhpLmV4ZVtGTEFTSEdFVF0=&yinbing1986

        c  快车专链即在上地址前加flashget://,注意后面还要加上"&符号",符号怎么得出不清楚,在最后后面加的是个人信息,可加可不加。

               Flashget://W0ZMQVNIR0VUXWh0dHA6Ly9pbS5iYWlkdS5jb20vaW5zdGFsbC9CYWlkdUhpLmV4ZVtGTEFTSEdFVF0=&yinbing1986

       注意: 在把快车专用链接变成普通链接时,要取[FLASHGET]之间的信息。

3、  旋风专用链接编码

         a  旋风相对就简单多了,将原地址直接base64编码为

             aHR0cDovL2ltLmJhaWR1LmNvbS9pbnN0YWxsL0JhaWR1SGkuZXhl

         b  旋风专链即在上地址前加qqdl://,即

              qqdl://aHR0cDovL2ltLmJhaWR1LmNvbS9pbnN0YWxsL0JhaWR1SGkuZXhl


4、  知道其原理后,要解密起来就有了方法,但是有没有最直接的方法呢?有

       打开网址http://tool.114la.com/code/urlconvert/

       Base64编码与解码网址: http://base64.xpcha.com/ 


代码如下: 

import java.io.IOException;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

/**
 * 转化qq旋风、迅雷、快车的专用下载链接为普通http的下载链接 * 如果找不到 sun.misc.BASE64Decoder 类,用以下步骤可解决
 * 右键项目-》属性-》 java bulid path-》jre System Library-》access rules-》resolution选择
 * accessible,下面填上** 点击确定即可!!! *
 * 
 * @author Jcking
 */
public class Turn2HTTP {
	// public static final String preUrl = "qqdl://aHR0cDovL2Rvd24ucXEuY29tL3NnL2Z1bGwvc2dfRnVsbFZlcnNpb25fMS4xLjU4LmV4ZQ==";
	// public static final String preUrl = "Thunder://QUFodHRwOi8vaW0uYmFpZHUuY29tL2luc3RhbGwvQmFpZHVIaS5leGVaWg==";
	public static final String preUrl = "Flashget://W0ZMQVNIR0VUXWh0dHA6Ly9pbS5iYWlkdS5jb20vaW5zdGFsbC9CYWlkdUhpLmV4ZVtGTEFTSEdFVF0=&yinbing1986";
	public static final String divider = "//";

	private void turn(String url) {
		String head = url.substring(0, url.indexOf(divider));
		String content = url.substring(url.indexOf(divider) + divider.length());
		String result = "";
		if ("qqdl:".equalsIgnoreCase(head)) {
			// 为qq旋风链接
			result = qqdl2http(content);
		} else if ("thunder:".equalsIgnoreCase(head)) {
			// 为迅雷链接
			result = thunder2http(content);
		} else if ("flashget:".equalsIgnoreCase(head)) {
			// 为快车链接
			result = flashget2http(content);
		}
		System.out.println(result);
	}

	private String qqdl2http(String url) {
		try {
			byte[] bytes = new BASE64Decoder().decodeBuffer(url);
			String result = new String(bytes);
			return result;
		} catch (IOException e) {
			return null;
		}
	}

	private String thunder2http(String url) {
		try {
			byte[] bytes = new BASE64Decoder().decodeBuffer(url);
			String result = new String(bytes);
			//左闭右开
			result = result.substring(2, result.length() - 2);
			return result;
		} catch (IOException e) {
			return null;
		}
	}

	private String flashget2http(String url) {
		String flag = "[FLASHGET]";
		try {
			byte[] bytes = new BASE64Decoder().decodeBuffer(url);
			String result = new String(bytes);
			result = result.substring(flag.length(), result.lastIndexOf(flag));
			return result;
		} catch (IOException e) {
			return null;
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("Turn2HTTP");
		String url = "http://im.baidu.com/install/BaiduHi.exe";
		String preUrl = Turn2SpecialLink.http2flashget(url);
		System.out.println(preUrl);
		new Turn2HTTP().turn(preUrl);
	}
}

import java.io.IOException;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

/**
 * 普通链接转为特殊链接,如迅雷,快车,旋风
 * 
 * @author huangqunyan
 * 
 */
public class Turn2SpecialLink {
	// private String url = "http://im.baidu.com/install/BaiduHi.exe";
	public static String http2qqdl(String url) {
		String result = new BASE64Encoder().encode(url.getBytes());
		return "qqdl://" + result;
	}
	public static String http2thunder(String url) {
		String urlStr = "AA" + url + "ZZ";
		String result = new BASE64Encoder().encode(urlStr.getBytes());
		return "thunder://" + result;
	}
	public static String http2flashget(String url) {
		String urlStr = "[FLASHGET]" + url + "[FLASHGET]";
		String result = new BASE64Encoder().encode(urlStr.getBytes());
		return "Flashget://" + result +"&qanyan";
	}
	public static void main(String[] args) {
		String url = "http://im.baidu.com/install/BaiduHi.exe";
		System.out.println(Turn2SpecialLink.http2flashget(url));
		System.out.println(Turn2SpecialLink.http2thunder(url));
		System.out.println(Turn2SpecialLink.http2qqdl(url));
	}
}

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值