突破网易相册的反盗链

网易相册,免费,无限容量,存取速度快(我用着确实快,要安装插件),而且支持批量上传图片,用着很方便.以前链接网易相册上的图片时从没遇到反盗链的问题,今天在引用时发现有了反盗链。链接的图片都显示如下,右键属性查看图看地址 1.没加反盗链: 2.加了反盗链: …………………………...

网易相册,免费,无限容量,存取速度快(我用着确实快,要安装插件),而且支持批量上传图片,用着很方便.以前链接网易相册上的图片时从没遇到反盗链的问题,今天在引用时发现有了反盗链。链接的图片都显示如下,右键属性查看图看地址
1.没加反盗链:

2.加了反盗链:

……………………………………………………………………………………………….
这两个图片网易地址是相同的,都为http://img150.photo.163.com/admcg/16264326/390837893.jpg
网易相册有个特点,盗链的图片当时你可以看,发给别人就看不了,这是因为你看到的是缓存的图片。如果清除缓存和cookies再看,就看不到了。
网易相册,免费,无限容量,存取速度快(我用着确实快,要安装插件),而且支持批量上传图片。用着很方便
突破反盗链的方法是:新建一showpic.asp文件,内容如下:
<%
Dim url, body, myCache
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
%>
将该文件上传到服务器空间,以后在要链接的图片地址前加上 路径/showpic.asp?url=图片地址 ,即可正常显示图片了

COMMENTS

名称

传销,1,代码,1,多说,1,海内,1,生活,29,汤圆,1,网络,8,相册,3,学习,3,音乐,1,银行,1,游戏,1,转载,27,blogger,2,Bluehost,1,php,1,swift,1,wordpress,3,
ltr
item
平凡梦想: 突破网易相册的反盗链
突破网易相册的反盗链
http://web.archive.org/web/20071218135007im_/http://img150.photo.163.com/admcg/16264326/390837893.jpg
平凡梦想
http://blog.rechar.net/2007/03/blog-post_15.html
http://blog.rechar.net/
http://blog.rechar.net/
http://blog.rechar.net/2007/03/blog-post_15.html
true
6547323685510588419
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content