home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 May
/
PCWorld_2008-05_cd.bin
/
komunikace
/
bitcomet
/
bitcomet_setup.exe
/
scripts
/
mp3_qihoo.lua
< prev
next >
Wrap
Text File
|
2007-02-27
|
977b
|
35 lines
function url_process(linkurl, fileurl, str)
local pattern_name = "<[Aa] href.-kw=.-><[Ss][Pp][Aa][Nn].->(.-)</[Ss][Pp][Aa][Nn]></[Aa]>"
local pattern_url = "<[Pp]><[Aa].-href=\"(.-)\">.-</[Aa]>"
local pattern_ext = ".*(%..-)$"
local start, _, tmp
local base_name, ext, url
start, _, tmp = string.find(str, pattern_name)
if start == nil then return "" else base_name = tmp end
start, _, tmp = string.find(str, pattern_url)
if start == nil then return "" else url = tmp end
start, _, tmp = string.find(url, pattern_ext)
if start == nil then return "" else ext = tmp end
return base_name .. ext
end
function url_query(str)
local start
local pattern_url = "so%.mp3%.qihoo%.com/"
start = string.find(str, pattern_url)
if start == nil then return false end
return true
end
f = {}
f.process = url_process
f.accept = url_query
inteligent_name_table["mp3_qihoo.lua"] = f