使用Flash DownLoad編寫采集器(之突破防盜連下載音樂(lè)文件)第3/4頁(yè)
更新時(shí)間:2007年02月22日 00:00:00 作者:
<Script Language="VBScript">
Dim IStr,StrSave,StrCookie
Dim CAIType
Dim MusicBody,MusicNameArr,MusicURLArr,MusicCount,MusicPtr,MusicName,MusicPlayer,MusicURL,MusicSave
Set IStr = CreateObject("IVVN.String")
'msgbox IStr.Version
FDown.BackColor = "#FFFFFF"
FDown.FillColor = "#FFFFFF"
FDown.FrameColor = "#E0E0E0"
'=============================================================================================================================================================
'FDown事件模塊 開始
'=============================================================================================================================================================
'下載庫(kù)通過(guò)該函數(shù)通知下載狀態(tài)
Private Sub FDown_Status(ByVal lIndex, ByVal lStatus, ByVal bstrStatusParam)
On Error Resume Next
If blnDStop = True Then
FDown.bStop
Exit Sub
End If
document.getElementById("DownForm").innerText = FDown.Url
If FDown.DownLoadType = dtToFile And FDown.SavePath <> "" And FDown.Filename <> "" Then
document.getElementById("DownTo").innerText = FDown.SavePath & "\" & FDown.Filename
Else
document.getElementById("DownTo").innerText = "抓取數(shù)據(jù)..."
End If
Dim strMsg
strMsg = "線程" & lIndex + 1 & ":"
If lStatus = 0 Then
strMsg = strMsg & "解析域名 "
ElseIf lStatus = 1 Then
strMsg = strMsg & "獲得IP地址 "
ElseIf lStatus = 2 Then
strMsg = strMsg & "連接服務(wù)器 "
ElseIf lStatus = 3 Then
strMsg = strMsg & "連接服務(wù)器成功 "
ElseIf lStatus = 4 Then
strMsg = strMsg & "重定向到 "
ElseIf lStatus = 5 Then
strMsg = strMsg & "開始接收數(shù)據(jù) "
ElseIf lStatus = 6 Then
strMsg = strMsg & "下載結(jié)束 "
End If
strMsg = strMsg & bstrStatusParam & vbCrLf
document.getElementById("DownState").innerText = strMsg
End Sub
'下載庫(kù)通過(guò)該事件通知文件下載進(jìn)度
Private Sub FDown_Progress(ByVal dbFileSize, ByVal dbFinished, ByVal dbSpeed)
On Error Resume Next
If blnDStop = True Then
FDown.bStop
Exit Sub
End If
Dim BFile
Dim BRead
Dim BShare
Dim BSpeed
BFile = dbFileSize
BRead = dbFinished
BShare = dbFinished / (dbFileSize / 100)
BSpeed = dbSpeed
If IsNumeric(dbFinished) = True And IsNumeric(dbFileSize) = True Then
BFile = dbFileSize
BRead = dbFinished
BShare = dbFinished / (dbFileSize / 100)
pb.setModel(BRead/BFile)
document.getElementById("DownLoading").innerText = BRead & " of " & BFile & " transferred (" & Round(BShare, 2) & "%)"
End If
If IsNumeric(dbSpeed) = True Then
BSpeed = dbSpeed
document.getElementById("DownSpeed").innerText = "Throughput " & BSpeed & " /s"
End If
End Sub
'下載庫(kù)通過(guò)該事件通知下載過(guò)程結(jié)束
Private Sub FDown_DownloadEnd(ByVal bSuccess)
On Error Resume Next
Select Case CAIType
Case "C1"
StrBody = FDown.Body
oSpecialName = IStr.RegContent(StrBody,"專輯名稱:","</li>")
document.getElementById("SpecialName").value = oSpecialName
oSinGer = IStr.RegContent(StrBody,"歌手名稱:","</li>")
document.getElementById("SinGer").value = oSinGer
oGongSi = IStr.RegContent(StrBody,"唱片公司:","</li>")
document.getElementById("GongSi").value = oGongSi
oYuYan = IStr.RegContent(StrBody,"專輯語(yǔ)種:","</li>")
document.getElementById("YuYan").value = oYuYan
oTimes = IStr.RegContent(StrBody,"發(fā)行時(shí)間:","</li>")
document.getElementById("Times").value = oTimes
oPIC = IStr.RegContent(StrBody,"<div class=""rightcolumn""><div id=""albuminfo""><img src=""",""">")
document.getElementById("PIC").value = oPIC
oremark = IStr.RegContent(StrBody,"<h2>專輯介紹</h2><p>","</p>")
document.getElementById("remark").value = oremark
StrSave = document.getElementById("SavePath").value & "\" & oSinGer & "\" & oSpecialName
CAIType = "C2"
Download_File 0, oPIC, StrSave & "\1.jpg", True, document.getElementById("SpecialURL").value, StrCookie
MusicBody = IStr.RegContent(StrBody,"<form name=form2 target=myplay action=../rd18playlist.htm>","<input name=""chkall2"" onclick=CheckAll(this.form) type=""button"" value=""全 選"" />")
MusicNameArr = IStr.RegContent(MusicBody,"<a href=""../mydown.htm?musicname=",""" target=_blank>",0,True)
MusicNameArr = Split(MusicNameArr,"§")
MusicURLArr = IStr.RegContent(MusicBody,"<input name=""checked"" type=""checkbox"" value=""",""" />",0,True)
MusicURLArr = Split(MusicURLArr,"§")
MusicCount = UBound(MusicURLArr)
CAIType = "C3"
MusicPtr = 0
GetMusic
Case "C3"
StrBody = FDown.Body
MusicURL = "http://wma7.520music.com/20060312/" & IStr.RegContent(StrBody,"document.write(""<PARAM NAME=\""URL\"" VALUE='""+url+""/","'>"")")
MusicSave = StrSave & "\" & MusicPtr+1 & IStr.GetFileExt(MusicURL)
CAIType = ""
StrCookie = Download_Text(0,"http://hi.520music.com/hi.htm", "gb2312", True, MusicPlayer, "")
StrCookie = FDown.Body
StrCookie = IStr.RegContent(StrCookie,"document.cookie=""","; domain=hi.520music.com;")
'MsgBox StrCookie
CAIType = "C4"
Download_File 0, MusicURL, MusicSave, False, document.getElementById("SpecialURL").value, StrCookie
Case "C4"
CAIType = "C3"
MusicPtr = MusicPtr + 1
GetMusic
End Select
If blnDStop = True Then
FDown.bStop
Exit Sub
End If
End Sub
相關(guān)文章
asp實(shí)現(xiàn)檢查目錄是否存在與建立目錄的函數(shù)
asp實(shí)現(xiàn)檢查目錄是否存在與建立目錄的函數(shù)...2007-09-09
用asp實(shí)現(xiàn)網(wǎng)址和郵件地址的轉(zhuǎn)換函數(shù)
用asp實(shí)現(xiàn)網(wǎng)址和郵件地址的轉(zhuǎn)換函數(shù)...2007-11-11
利用Split函數(shù)進(jìn)行多關(guān)鍵字檢索
利用Split函數(shù)進(jìn)行多關(guān)鍵字檢索...2006-07-07
asp 下用正則表達(dá)式檢測(cè)郵箱格式的函數(shù)
asp 下用正則表達(dá)式檢測(cè)郵箱格式的函數(shù)...2007-08-08
asp獲取當(dāng)前網(wǎng)頁(yè)地址的代碼
2008-01-01

