首页> 实战笔录 >PHP开发笔记 >PHP PHP
PHP网页调用迅雷下载文件
作者:小萝卜 2019-07-23 【 PHP 】 浏览 2676
简介PHP实现迅雷下载文件
后端php代码:
//将链接转化成迅雷的下载资源链接
function ThunderEncode($url, $type='en') {
if($type =='en'){
return "thunder://".base64_encode("AA".$url."ZZ");
}else{
return substr(base64_decode(substr(trim($url),10)),2,-2);
}
}
$url = 'http://www.luowebs.com/uploads/20190722/46479528965.mp4'; //url例子
$thunderUrl = ThunderEncode("http://请改成你需要的链接.rar");
前端代码:
< SCRIPT src="http://pstatic.xunlei.com/js/webThunderDetect.js">< /SCRIPT>
< a oncontextmenu=ThunderNetwork_SetHref(this) onclick="return OnDownloadClick_Simple(this,2,4)" href="#" thunderResTitle="下载资源名" thunderType="" thunderPid="52345834" thunderHref="< ?php echo $thunderUrl;? >" >迅雷专用高速下载< /a>
很赞哦! (0)
相关文章
- PHP怎么判断访问的设备是ios还是安卓?
- PHP获取指定年月日开始和结束的时间戳
- php利用正则表达式提取内容中的所有图片(Img)或第一张图片(Img)
- PHP获取当前操作系统的语言信息
- php在高并发时使用redis锁限制并发访问
- Namespace declaration statement has to be the very first statement or after any declare call in the
- php自定义加密和解密,url参数加密,实现分享返利
- 修改wordpress数据库表前缀wp_的方法
- PHP快速自定义分页类
- php获取网站运行了多长时间,服务器运行了多长时间,活动持续多长时间