视频采集开始:"&cjHost&"
"
xml=bytesToStr(getRemoteContent(url,"body"),"utf-8")
If left(xml, 5) <> "115 then title=getStrByLen(title,115)
pic=filterQuote(vNodes(i).childNodes(5).text)
des=filterQuote(vNodes(i).childNodes(14).text)
m_lang=filterQuote(vNodes(i).childNodes(6).text)
if computeStrLen(m_lang)>30 then m_lang=getStrByLen(m_lang,30)
publisharea=filterQuote(vNodes(i).childNodes(7).text)
if computeStrLen(publisharea)>30 then publisharea=getStrByLen(publisharea,30)
publishyear=vNodes(i).childNodes(8).text
states=vNodes(i).childNodes(9).text
m_note=filterQuote(vNodes(i).childNodes(10).text)
actor=replaceStr(trim(filterQuote(vNodes(i).childNodes(11).text))," ",",")
if computeStrLen(actor)>250 then actor=getStrByLen(actor,250)
director=replaceStr(filterQuote(vNodes(i).childNodes(12).text)," ",",")
if computeStrLen(director)>40 then director=getStrByLen(director,40)
if not isNum(publishyear) then publishyear=0
if not isNum(states) then states=0
localId=getBindedLocalId(libid)
if not isNul(title) then
title=replace(replace(title,"[","["),"]","]")
if isNum(localId) then
titleArray=split(title,"/")
if UBound(titleArray)>-1 then title=titleArray(0)
for m_i=0 to ubound(titleArray)
if not isNul(titleArray(m_i)) then m_where=m_where&" or '/'+m_name+'/' like '%/"&titleArray(m_i)&"/%' "
next
m_where=trimOuterStr(m_where," or")
m_sql="select top 1 m_id,m_playdata from {pre}data where "&m_where
set vrsObj=conn.db(m_sql,"execute")
if vrsObj.eof then
m_enname=MoviePinYin(title):sql="insert into {pre}data(m_name,m_type,m_state,m_pic,m_actor,m_des,m_playdata,m_isunion,m_publishyear,m_publisharea,m_note,m_letter,m_enname,m_director,m_lang) values('"&title&"',"&localId&","&states&",'"&pic&"','"&actor&"','"&des&"','"&vid&"',1,"&publishyear&",'"&publisharea&"','"&m_note&"','"&Left(m_enname,1)&"','"&m_enname&"','"&director&"','"&m_lang&"')"
else
select case gatherSet
case 0,1,2,3
m_playdata = gatherIntoLibTransfer(vrsObj("m_playdata"),vid,gatherSet)
sql="update {pre}data set m_state="&states&ifthen(isSpecial(vtype),",m_note='"&m_note&"'","")&",m_lang='"&m_lang&"',m_playdata='"&m_playdata&"',m_isunion=1,m_addtime='"&now()&"' where m_id="&vrsObj("m_id")
case 4
m_enname=MoviePinYin(title):sql="insert into {pre}data(m_name,m_type,m_state,m_pic,m_actor,m_des,m_playdata,m_isunion,m_publishyear,m_publisharea,m_note,m_letter,m_enname,m_director,m_lang) values('"&title&"',"&localId&","&states&",'"&pic&"','"&actor&"','"&des&"','"&vid&"',1,"&publishyear&",'"&publisharea&"','"&m_note&"','"&Left(m_enname,1)&"','"&m_enname&"','"&director&"','"&m_lang&"')"
case 5
sql="update {pre}data set m_actor='"&actor&"',m_director='"&director&"',m_lang='"&m_lang&"',m_pic='"&pic&"',m_des='"&des&"',m_publishyear="&publishyear&ifthen(isSpecial(vtype),",m_note='"&m_note&"'","")&",m_publisharea='"&publisharea&"',m_addtime='"&now()&"' where m_id="&vrsObj("m_id")
end select
end if
vrsObj.close : set vrsObj=nothing
conn.db sql,"execute"
'echo "OK
"
else
libid=000000
titleArray=split(title,"/")
if UBound(titleArray)>-1 then title=titleArray(0)
for m_i=0 to ubound(titleArray)
if not isNul(titleArray(m_i)) then m_where=m_where&" or '/'+m_name+'/' like '%/"&titleArray(m_i)&"/%' "
next
m_where=trimOuterStr(m_where," or")
m_sql="select top 1 m_id,m_playdata from {pre}temp where "&m_where
set vrsObj2=conn.db(m_sql,"execute")
if vrsObj2.eof then
'pic=gatherPicHandle(pic,title)
sql="insert into {pre}temp(m_name,m_type,m_state,m_pic,m_actor,m_des,m_playdata,m_publishyear,m_publisharea,m_director,m_lang) values('"&title&"',"&libid&","&states&",'"&pic&"','"&actor&"','"&des&"','"&vid&"',"&publishyear&",'"&publisharea&"','"&director&"','"&m_lang&"')"
else
select case gatherSet
case 0,1,2,3
m_playdata = gatherIntoLibTransfer(vrsObj2("m_playdata"),vid,gatherSet)
sql="update {pre}temp set m_name='"&title&"',m_state="&states&",m_lang='"&m_lang&"',m_playdata='"&m_playdata&"',m_addtime='"&now()&"' where m_id="&vrsObj2("m_id")
case 4
'pic=gatherPicHandle(pic,title)
sql="insert into {pre}temp(m_name,m_type,m_state,m_pic,m_actor,m_des,m_playdata,m_publishyear,m_publisharea,m_director,m_lang) values('"&title&"',"&libid&","&states&",'"&pic&"','"&actor&"','"&des&"','"&vid&"',"&publishyear&",'"&publisharea&"','"&director&"','"&m_lang&"')"
case 5
'pic=gatherPicHandle(pic,title)
sql="update {pre}temp set m_pic='"&pic&"',m_actor='"&actor&"',m_director='"&director&"',m_lang='"&m_lang&"',m_des='"&des&"',m_publishyear="&publishyear&",m_publisharea='"&publisharea&"',m_addtime='"&now()&"' where m_id="&vrsObj2("m_id")
end select
end if
vrsObj2.close : set vrsObj2=nothing
conn.db sql,"execute"
end if
end if
echo "数据
"&title&"已经采集成功
"
Next
set xmlobj = nothing
if page
暂停"&gatherWaitTime&"秒--
即将开始同步第"&page&"/"&pagecount&"页 "
if gtype="day" Then
echo ""
elseif gtype="type" then
echo ""
end if
else
if gtype="select" then
die ""
else
die ""
end if
end if
End Sub
Sub AddResUrl(ByVal rid,ByVal sUrl,ByVal sTxt)
on Error resume next
Dim l:l=UBound(res,2)+1:l=ifthen(err.number>0,0,l):ReDim Preserve res(2,l)
res(0,l)=rid:res(1,l)=sUrl:res(2,l)=sTxt
End Sub
Function getRemoteContent(Byval url,Byval returnType)
if not isObject(gXmlHttpObj) then:set gXmlHttpObj=tryXmlHttp():end if
gXmlHttpObj.open "GET",url,False
gXmlHttpObj.send()
select case returnType
case "text"
getRemoteContent=gXmlHttpObj.responseText
case "body"
getRemoteContent=gXmlHttpObj.responseBody
end select
End Function
Function FilterChar(ByVal Text)
dim i
for i=1 to &H1F
if i<>10 AND i<>13 then Text=Replace(Text,Chr(i),"")
next
FilterChar=Text
End Function
Function ifthen(ByVal Bo,ByVal v1,ByVal v2)
if Bo=true then
ifthen=v1
else
ifthen=v2
end if
End Function
Function isSpecial(ByVal sType)
isSpecial=false
if Instr(sType,"剧")>2 then
isSpecial=true
elseif Instr(sType,"动漫")>0 then
isSpecial=true
elseif Instr(sType,"动画")>0 then
isSpecial=true
elseif Instr(sType,"综艺")>0 then
isSpecial=true
end if
End Function
%>