home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 May
/
PCWorld_2007-05_cd.bin
/
komunikace
/
bitcomet
/
bitcomet_setup.exe
/
scripts
/
mp3_sogou.lua
< prev
next >
Wrap
Text File
|
2007-01-10
|
923b
|
37 lines
function url_process(linkurl, fileurl, str)
local pattern_name = "歌名:%s*(.-)</"
local pattern_ext = "格式:%s*(.-)%s* "
local start, _, tmp
local base_name, ext, url
start, _, tmp = string.find(str, pattern_name)
--print(start, tmp)
if start == nil then return "" else base_name = tmp end
base_name = string.gsub(base_name, "<.->", "")
start, _, tmp = string.find(str, pattern_ext)
--print(start, tmp)
if start == nil then return "" else ext = tmp end
ext = "." .. string.lower(ext)
return base_name .. ext
end
function url_query(str)
local start
local pattern_url = "d%.sogou%.com/down"
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_sogou.lua"] = f