home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 May
/
PCWorld_2008-05_cd.bin
/
komunikace
/
bitcomet
/
bitcomet_setup.exe
/
scripts
/
mp3_baidu.lua
< prev
next >
Wrap
Text File
|
2007-08-30
|
1KB
|
44 lines
function url_process(linkurl, fileurl, str)
local pattern_name = "歌曲名:.->(.-)%s*...<"
local pattern_url = "歌曲名:.-href=\"(.-)\""
local pattern_ext = ".*(%..-)$"
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
start, _, tmp = string.find(str, pattern_url)
print(start, tmp)
if start == nil then return "" else url = tmp end
start, _, tmp = string.find(url, pattern_ext)
print(start, tmp)
if start == nil then return "" else ext = tmp end
return base_name .. ext
end
function url_query(str)
local start
local url_table = {}
local i
url_table[0] = "202%.108%.23%.172"
url_table[1] = "220%.181%.38%.82"
for i = 0,1 do
start = string.find(str, url_table[i])
if start ~= nil then return true end
end
return false
end
f = {}
f.process = url_process
f.accept = url_query
inteligent_name_table["mp3_baidu.lua"] = f