获取远程flash并保存到本地
远程 获取 本地 保存 Flash
2023-06-13 09:13:46 时间
<%
"--------------------------------------------------------------
Dbname = "../data/flash.mdb" "更改数据库文件位置,强烈建议更改为.asp的文件!
Set Conn = Server.CreateObject("ADODB.Connection")
Connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.Mappath(Dbname)
Conn.Open Connstr
"------------------------------------------------------------
Set List = Conn.Execute("Select * From System")
WebName = List("WebName")
WebUrl = List("WebUrl")
webemail = List("webemail")
zzname = List("zzname")
qq = List("webqq")
%>
<%
Server.ScriptTimeOut=999999999
%>
<%
if request("overid")="" then
response.write "结束ID不可为空"
response.end
elseif request("download")="" then
response.write "请选择是否下载"
response.end
end if
if request("id")=request("overid") then
response.write "采集任务结束"
response.end
end if
gourl1=request("id")
gourl1=gourl1+1
%>
<%
function GetPy(Str)
for i=1 to len(Str)
GetPy=GetPy&GetPyChar(mid(Str,i,1))
next
end function
Function GetURL(url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "GET", url, False
.Send
GetURL = bytes2bstr(.responsebody)
if len(.responsebody)<100 then
response.write "获取远程文件 <a href="&url&" target=_blank>"&url&"</a> 失败。"
response.write"<meta http-equiv=""refresh"" content=""0;URL=getid.asp?id="&gourl1&""">"
response.end
end if
End With
Set Retrieval = Nothing
End Function
function bytes2bstr(vin)
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin,i,1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin,i+1,1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
i = i + 1
end if
next
bytes2bstr = strreturn
end function
Function GetKey(HTML,Start,Last)
filearray=split(HTML,Start)
filearray2=split(filearray(1),Last)
GetKey=filearray2(0)
End Function
"------------------------------------
Function SaveRemoteFile(s_LocalFileName, s_RemoteFileUrl)
Dim Ads, Retrieval, GetRemoteData
Dim bError
bError = False
SaveRemoteFile = False
On Error Resume Next
Set Retrieval = Server.CreateObject("Msxml2.ServerXMLHTTP")
With Retrieval
.Open "GET", s_RemoteFileUrl, False
.Send
If .Status = 200 Then
GetRemoteData = .ResponseBody
Else
bError = True
End If
End With
Set Retrieval = Nothing
If Not bError Then
Set Ads = Server.CreateObject("Adodb.Stream")
With Ads
.Type = 1
.Open
.Write GetRemoteData
.SaveToFile Server.MapPath(s_LocalFileName), 2
.Cancel()
.Close()
End With
Set Ads=nothing
End If
If Err.Number = 0 And Not bError Then
SaveRemoteFile = True
Else
Err.Clear
End If
End Function
%>
<%
flashId=Request("Id")
Url="http://www.gameyes.com/swf/"&flashId&".htm"
Html = GetURL(Url)
num=len(html)
if num<600 then
response.write "<font color=red>FLASH序号:</font> "&gourl1
response.write "此页不存在,跳转下一个........<meta http-equiv=""refresh"" content=""0;URL=getid.asp?id="&gourl1&"&overid="&request("overid")&"&download="&request("download")&""">"
response.end
end if
nclassid1=GetKey(Html,"FLASH游戏 >> <a class=a href=../list/a_",".htm>") "
nclass=GetKey(Html,"<a class=a href=../list/a_"&nclassid1&".htm>","</a>")
nclass=nclass&"类"
classid1=GetKey(Html,"class=a href="../list/",".htm">")
classname=GetKey(Html,"class=a href="../list/"&classid1&".htm">","</a>")
body=GetKey(Html,"<div id=""view_intro"">","</div>")
body=replace(body,"<tr>","")
body=replace(body,"<td>","")
pic1=GetKey(Html,"#secrt{background:url(../smallpic",") 2 2 no-repeat;border:1px")
pic1=replace(pic1,"_b.gif",".gif")
pic1=replace(pic1,"_b.jpg",".jpg")
pic="http://www.gameyes.com/smallpic"&pic1
pictype=right(pic,4)
flashurl=GetKey(Html,"download.asp?id="&flashId&"&swf=","""><img src=")
flashurl=replace(flashurl,"http://old.gameyes.com/flash","http://60.191.9.222/flash")
flashurl="http://old.gameyes.com/flash"&flashurl
flashname=GetKey(Html,"<title>","小游戏 休闲小游戏网 gameyes.com</title>")
%>
<%
response.write "<font color=red>FLASH序号:</font> "&gourl1
response.write "<br>"
response.write "<font color=red>FLASH名称:</font> "&flashname
response.write "<br>"
response.write "<font color=red>所属大类:</font> "&nclass
response.write "<br>"
response.write "<font color=red>所属二类:</font> "&classname
response.write "<br>"
response.write "<font color=red>游戏介绍:</font> "&body
response.write "<br>"
response.write "<font color=red>游戏小图:</font> "&pic
response.write "<br>"
response.write "<font color=red>FLASH地址:</font> "&flashurl
response.write "<br>"
%>
<%
if request("download")="yes" then
response.write"开始下载FLASH<br>"
response.flush
result = SaveRemoteFile("../flashfile/"&request("id")&".swf",""&flashurl&"")
If result Then
Response.Write "<b>FLASH下载成功——保存在<a href=../flashfile/"&request("id")&".swf target=_blank>flashfile/"&request("id")&".swf</a><br>"
Else
Response.Write "<b>FLASH保存失败</b><br>"
End If
end if
if request("download")="yes" then
response.write"开始下载FLASH图片<br>"
response.flush
result = SaveRemoteFile("../flashpic/"&request("id")&pictype&"",""&pic&"")
If result Then
Response.Write "<b>FLASH图片下载成功——保存在<a href=../flashpic/"&request("id")&pictype&" target=_blank>flashpic/"&request("id")&pictype&"</a>"
Else
Response.Write "<b>FLASH图片保存失败</b><br>"
response.write "此FLASH采集完毕,继续采集下一个<br><hr>"
End If
end if
%>
<%
DBPath = Server.MapPath("../data/flash.mdb")
set Conn=server.createobject("adodb.connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set rs=server.CreateObject("ADODB.RecordSet")
Sql="Select * From class Where name=""&nclass&"""
Rs.Open Sql,Conn,1,3
If Rs.Eof And Rs.Bof Then
Rs.AddNew
End If
rs("name")=nclass
rs("classid")="0"
Rs.Update
Rs.Close
Set Rs = Nothing
Set rsc = Conn.Execute("select * from class where name=""&nclass&""")
nclassid=rsc("id")
rsc.close
set rsc=nothing
"处理FLASH的二级类别,如数据库中没有该类别,则增加
set rst=server.CreateObject("ADODB.RecordSet")
Sql="Select * From class Where name=""&classname&"""
Rst.Open Sql,Conn,1,3
If Rst.Eof And Rst.Bof Then
Rst.AddNew
End If
rst("name")=classname
rst("classid")=nclassid
Rst.Update
Rst.Close
Set Rst = Nothing
"取类别的ID号
Set rsc = Conn.Execute("select * from class where name=""&classname&""")
classid=rsc("id")
rsc.close
set rsc=nothing
"===================================================
"可以开始写入flash
set rs=server.CreateObject("ADODB.RecordSet")
Sql="Select * From flash Where flashname=""&flashname&"" and flashurl=""&flashurl&"""
Rs.Open Sql,Conn,1,3
If Rs.Eof And Rs.Bof Then
Rs.AddNew
End If
rs("flashname")=flashname
if request("download")="yes" then
rs("flashurl")="../flashfile/"&request("id")&".swf"
else
rs("flashurl")=flashurl
end if
rs("nclass")=NClassID
rs("classid")=classid
rs("classname")=classname
if request("download")="yes" then
rs("pic")="../flashpic/"&request("id")&pictype
else
rs("pic")=pic
end if
rs("size")="500kb"
rs("sj")=now()
rs("body")=body
rs("tj")="no"
rs("hot")="1"
rs("user")="admin"
rs("zz")="未知"
rs("geshou")="不祥"
Rs.Update
Rs.Close
Set Rs = Nothing
conn.close
set conn=nothing
%>
<%
dim gourl
gourl=flashId+1
response.write"<meta http-equiv=""refresh"" content=""0;URL=getid.asp?id="&gourl&"&overid="&request("overid")&"&download="&request("download")&""">"
%>
相关文章
- 软件分享 | 第六期 服务器远程连接工具获取和安装
- git pull 从远程获取代码并合并本地的版本
- 前端下载远程文件从后端获取文件名
- 【Android 逆向】Android 进程注入工具开发 ( 注入代码分析 | 获取注入的 libbridge.so 动态库中的 load 函数地址 并 通过 远程调用 执行该函数 )
- 多款本田车型存在漏洞,车辆可被远程控制
- ORA-19659: incremental restore would advance file string past RESETLOGS ORACLE 报错 故障修复 远程处理
- ORA-22292: Cannot open a LOB in read-write mode without a transaction ORACLE 报错 故障修复 远程处理
- ORA-23423: job number string is not positive ORACLE 报错 故障修复 远程处理
- ORA-29253: Invalid count argument passed to procedure dbms_sql.define_array ORACLE 报错 故障修复 远程处理
- ORA-29272: initialization failed ORACLE 报错 故障修复 远程处理
- ORA-32340: cannot tune the materialized view definition ORACLE 报错 故障修复 远程处理
- ORA-39260: Cannot delete column from cluster. ORACLE 报错 故障修复 远程处理
- ORA-41103: Only the designated Cluster Director: string can undesignate itself. ORACLE 报错 故障修复 远程处理
- ORA-44002: invalid object name ORACLE 报错 故障修复 远程处理
- ORA-48504: Relation Parameter Must be Specified ORACLE 报错 故障修复 远程处理
- ORA-53820: Invalid locator path string ORACLE 报错 故障修复 远程处理
- MySQL Error number: 4049; Symbol: ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-010714; Symbol: ER_WRONG_COUNT_FOR_ORIGIN; SQLSTATE: HY000 报错 故障修复 远程处理
- ORA-01994: GRANT failed: password file missing or disabled ORACLE 报错 故障修复 远程处理
- SQLServer 错误 21892 无法在与虚拟网络名称“%s”相关联的可用性组主副本上查询 sys.availability_replicas 以获取成员副本的服务器名称:错误 = %d,错误消息 = %s。 故障 处理 修复 支持远程
- ORA-06441: ssvwatev: Incorrect parameter passed to function call ORACLE 报错 故障修复 远程处理
- MySQL Error number: MY-011488; Symbol: ER_GRP_RPL_CERTIFIER_MSSG_PROCESS_ERROR; SQLSTATE: HY000 报错 故障修复 远程处理
- MySQL Error number: MY-012064; Symbol: ER_IB_MSG_239; SQLSTATE: HY000 报错 故障修复 远程处理
- ORA-12324: cannot use the ROM: link type on a private database link ORACLE 报错 故障修复 远程处理
- ORA-14307: partition contains too many list values ORACLE 报错 故障修复 远程处理
- ORA-16089: archive log has already been registered ORACLE 报错 故障修复 远程处理
- python不下载获取远程图片的宽度和高度及文件大小的方法详解编程语言
- Linux远程获取文件的实现方法(linux远程获取文件)
- MSSQL远程渗透之获取shell技巧(mssql获取shell)
- 远程攻击:MSSQL密码获取技术(远程获取mssql密码)
- 用php获取远程图片并把它保存到本地的代码
- 使用C#获取远程图片Form用户名与密码Authorization认证的实现
- 解析php通过cookies获取远程网页的指定代码