PHP源码,让163网易相册QQ相册里的照片也能外链 调用防盗连图片
现在很多相册都已经不能用外链了,比如常用的网易163相册、QQ相册、SOHU相册等等,甚至一些博客上传后的图片也不能用做外链,破解它的方法其实网上早就有了,但是很少看到有直接做成小工具让大家用的哈,这两天似乎做这类小工具上瘾了,每天都要做上一个,花不了几分钟时间,但是确十分有用哦~~~今天又做了一个破解163网易相册/QQ相册/sohu相册等在线小工具,用起来也不错。
其实原理很简单,就是用一个中转的程序把图片度到cache里面,然后再显示出来,本来我也想放一个程序的,但是发现似乎占用的内存还不小,用的少还不怕,要是大家都用我可是收不了!
所以我把PHP和ASP的代码都给出来,以便以后谁用的上,代码不是我写的,我也是在网上找的哦~~~
[color=blue]注:推荐使用第一种方法,163、QQ都有效。[/color]
[color=#0000ff] [/color][color=red]第2种方法,好像失效了。或是可能哪里出问题了。[/color]
[url=http://www.idc866.com/forum-19-1.html][b]PHP源码[/b][/url][b]1:
[/b]<?php
if(substr($_GET['url'], 0, 7)!="http://"){
exit;
}
readfile($_GET['url']);
?>
[b][url=http://www.idc866.com/forum-19-1.html][b]PHP源码[/b][/url]2:[/b]
<?
$pics=file($p);
for($i=0;$i<count($pics);$i++)
{
echo $pics[$i];
}
?>
[size=4][color=blue]★ 用法:把以上代码,存为一个 PHP文件,如:163.php[/color][/size]
★ 使用方法:**** Hidden Message *****
★ 显示:
[img]http://www.idc866.com/163.php?url=http://img.ph.126.net/ccdDbwSL4NelDFBj6enx0g==/1529535023446145054.jpg[/img]
以下ASP方式也是一样的用法:
[b]ASP代码:[/b]
<%
'形如
'http://weste.net/pic.asp?url=http://img.photo.163.com/-C9z6fC8-rzRRU4hymYcuQ==/753789987632211589.jpg
Dim url, body, myCache
On Error Resume Next
url = Request.QueryString("url")
Set myCache = new cache
myCache.name = "picindex"&url
If myCache.valid Then
body = myCache.value
Else
body = GetWebData(url)
myCache.add body,dateadd("d",1,now)
End If
If Err.Number = 0 Then
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite body
Response.Flush
Else
Wscript.Echo Err.Description
End if
'取得数据
Public Function GetWebData(ByVal strUrl)
Dim curlpath
curlpath = Mid(strUrl,1,Instr(8,strUrl,"/"))
Dim Retrieval
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", strUrl, False,"",""
.setRequestHeader "Referer", curlpath
.Send
GetWebData =.ResponseBody
End With
Set Retrieval = Nothing
End Function
'cache类
class Cache
private obj 'cache内容
private expireTime '过期时间
private expireTimeName '过期时间application名
private cacheName 'cache内容application名
private path 'url
private sub class_initialize()
path=request.servervariables("url")
path=left(path,instrRev(path,"/"))
end sub
private sub class_terminate()
end sub
public property get blEmpty
'是否为空
if isempty(obj) then
blEmpty=true
else
blEmpty=false
end if
end property
public property get valid
'是否可用(过期)
if isempty(obj) or not isDate(expireTime) then
valid=false
elseif CDate(expireTime)<now then
valid=false
else
valid=true
end if
end property
public property let name(str)
'设置cache名
cacheName=str & path
obj=application(cacheName)
expireTimeName=str & "expires" & path
expireTime=application(expireTimeName)
end property
public property let expires(tm)
'重设置过期时间
expireTime=tm
application.lock
application(expireTimeName)=expireTime
application.unlock
end property
public sub add(var,expire)
'赋值
if isempty(var) or not isDate(expire) then
exit sub
end if
obj=var
expireTime=expire
application.lock
application(cacheName)=obj
application(expireTimeName)=expireTime
application.unlock
end sub
public property get value
'取值
if isempty(obj) or not isDate(expireTime) then
value=null
elseif CDate(expireTime)<now then
value=null
else
value=obj
end if
end property
public sub makeEmpty()
'释放application
application.lock
application(cacheName)=empty
application(expireTimeName)=empty
application.unlock
obj=empty
expireTime=empty
end sub
public function equal(var2)
'比较
if typename(obj)typename(var2) then
equal=false
elseif typename(obj)="Object" then
if obj is var2 then
equal=true
else
equal=false
end if
elseif typename(obj)="Variant()" then
if join(obj,"^")=join(var2,"^") then
equal=true
else
equal=false
end if
else
if obj=var2 then
equal=true
else
equal=false
end if
end if
end function
end class
%>
<%
'形如
'http://weste.net/pic.asp?url=http://img.photo.163.com/-C9z6fC8-rzRRU4hymYcuQ==/753789987632211589.jpg
Dim url, body, myCache
On Error Resume Next
url = Request.QueryString("url")
Set myCache = new cache
myCache.name = "picindex"&url
If myCache.valid Then
body = myCache.value
Else
body = GetWebData(url)
myCache.add body,dateadd("d",1,now)
End If
If Err.Number = 0 Then
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"
Response.BinaryWrite body
Response.Flush
Else
Wscript.Echo Err.Description
End if
'取得数据
Public Function GetWebData(ByVal strUrl)
Dim curlpath
curlpath = Mid(strUrl,1,Instr(8,strUrl,"/"))
Dim Retrieval
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", strUrl, False,"",""
.setRequestHeader "Referer", curlpath
.Send
GetWebData =.ResponseBody
End With
Set Retrieval = Nothing
End Function
'cache类
class Cache
private obj 'cache内容
private expireTime '过期时间
private expireTimeName '过期时间application名
private cacheName 'cache内容application名
private path 'url
private sub class_initialize()
path=request.servervariables("url")
path=left(path,instrRev(path,"/"))
end sub
private sub class_terminate()
end sub
public property get blEmpty
'是否为空
if isempty(obj) then
blEmpty=true
else
blEmpty=false
end if
end property
public property get valid
'是否可用(过期)
if isempty(obj) or not isDate(expireTime) then
valid=false
elseif CDate(expireTime)<now then
valid=false
else
valid=true
end if
end property
public property let name(str)
'设置cache名
cacheName=str & path
obj=application(cacheName)
expireTimeName=str & "expires" & path
expireTime=application(expireTimeName)
end property
public property let expires(tm)
'重设置过期时间
expireTime=tm
application.lock
application(expireTimeName)=expireTime
application.unlock
end property
public sub add(var,expire)
'赋值
if isempty(var) or not isDate(expire) then
exit sub
end if
obj=var
expireTime=expire
application.lock
application(cacheName)=obj
application(expireTimeName)=expireTime
application.unlock
end sub
public property get value
'取值
if isempty(obj) or not isDate(expireTime) then
value=null
elseif CDate(expireTime)<now then
value=null
else
value=obj
end if
end property
public sub makeEmpty()
'释放application
application.lock
application(cacheName)=empty
application(expireTimeName)=empty
application.unlock
obj=empty
expireTime=empty
end sub
public function equal(var2)
'比较
if typename(obj)<>typename(var2) then
equal=false
elseif typename(obj)="Object" then
if obj is var2 then
equal=true
else
equal=false
end if
elseif typename(obj)="Variant()" then
if join(obj,"^")=join(var2,"^") then
equal=true
else
equal=false
end if
else
if obj=var2 then
equal=true
else
equal=false
end if
end if
end function
end class
%> this is the good way to use end of 163 photo gallary 同时也可以用FLASH的方式或其他语言程序来表达
模拟访问该页,即可正常访问该图片 看不懂該怎麼用~~ [b]回复 [url=http://www.idc866.com/redirect.php?goto=findpost&pid=36100&ptid=155]4#[/url] [i]夏筱羽[/i] [/b]
[size=4][color=#0000ff]★ 用法:把以上代码,存为一个 PHP文件,如:163.php[/color][/size]
方法已添加到主贴中。 卡下哈 看看能用不 试试去.........
页:
[1]