├── README.md ├── mp3.php ├── tu.php ├── test.php ├── down.php └── index.html /README.md: -------------------------------------------------------------------------------- 1 | 百度网盘直链,学习PHP的产物,(*^__^*) ,通过正则表达式获取百度网盘的文件真实地址,来实现直链的效果,适合一些使用外链的网站使用。 2 | 原理:正则获取地址,然后截取第一个匹配的结果,再将结果中的一些字符替换掉,然后通过location重定向到真实的文件地址。 -------------------------------------------------------------------------------- /mp3.php: -------------------------------------------------------------------------------- 1 | /is'; 6 | preg_match_all($pattern,$file,$result); 7 | $tempurl=implode("",$result[1]); 8 | $fileurlt=str_replace("\"","",$tempurl); 9 | $fileurl=str_replace("&","&",$fileurlt); 10 | header("location:$fileurl") 11 | ?> -------------------------------------------------------------------------------- /tu.php: -------------------------------------------------------------------------------- 1 | /is'; 6 | preg_match_all($pattern,$file,$result); 7 | $tempurl=implode("",$result[1]); 8 | $fileurlt=str_replace("\"","",$tempurl); 9 | $fileurl=str_replace("&","&",$fileurlt); 10 | header("location:$fileurl") 11 | ?> 12 | -------------------------------------------------------------------------------- /test.php: -------------------------------------------------------------------------------- 1 | /is'; 6 | preg_match_all($pattern,$file,$result); 7 | $tempurl=implode("",$result[1]); 8 | $fileurlt=str_replace("\"","",$tempurl); 9 | $fileurl=str_replace("&","&",$fileurlt); 10 | header("Content-type:image"); 11 | readfile($fileurl); 12 | ?> 13 | -------------------------------------------------------------------------------- /down.php: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 百度外链工具 5 | 6 | 7 | 8 |

9 | 欢迎使用百度外链工具 10 |

11 |

12 | 使用方法: 13 |

14 | 先将文件上传到百度网盘,然后将文件【分享给好友】→【创建链接】获取下载地址。再将得到的链接中的shareid=xxxxx&uk=xxxxxx部分替换掉相应的链接中的相应部分。 15 |
    16 |

    17 | 1.图片外链:http://w.chenxuefeng.net.cn/tu.php?shareid=104754&uk=4211133661
    18 | 百度外链 19 |

    20 |

    21 | 2.音乐外链:http://w.chenxuefeng.net.cn/mp3.php?shareid=104708&uk=4211133661
    22 | 百度外链 23 |

    24 |

    25 |
    26 |

    27 |

    28 | 3.下载外链:http://w.chenxuefeng.net.cn/down.php?shareid=104775&uk=4211133661
    29 | 百度外链 30 |

    31 |

    32 | 更新日志(2013-04-20): 33 |

    34 |

    35 | 1.初步完善工具功能。 36 |

    37 |

    38 | 2.支持文档下载,音乐外链,图片外链三种方式。 39 |

    40 |

    41 | 3.修复图片外链功能。

    42 | 图片外链
    43 | 44 |

    45 |
    46 |

    47 |

    48 |
    49 |

    50 |

    51 | 欢迎大家到我的博客里反馈问题。
    52 |

    53 | 54 |
    55 | 59 | 72 | 73 | 74 | 75 | 78 | 79 |
    80 | 81 | 82 | --------------------------------------------------------------------------------