",start)
42 |
43 | if href == nil then
44 | break
45 | end
46 | href = "http://www.rufengso.net" .. href
47 | table.insert(result,{["title"]=title,["href"]=href})
48 | start = end_position + 1
49 | end
50 |
51 | return result
52 |
53 | end
54 |
55 | function onItemClick(item)
56 |
57 | local url = exRequest(item.href)
58 | if url == nil then
59 | return ACT_MESSAGE, '获取URL失败'
60 | end
61 |
62 | return ACT_SHARELINK, url
63 |
64 | end
65 |
66 | function exRequest(url)
67 | local ret = request(url)
68 | local _, __, href = string.find(ret,'class="dbutton2" href="(.-)"',1)
69 |
70 | ret = request(href)
71 | _,__,url = string.find(ret, "URL='(.-)'")
72 | return url
73 | end
74 |
--------------------------------------------------------------------------------
/插件备份/search_zhuzhupan.lua:
--------------------------------------------------------------------------------
1 | local curl = require "lcurl.safe"
2 |
3 | script_info = {
4 | ["title"] = "猪猪盘",
5 | ["description"] = "http://www.zhuzhupan.com/",
6 | ["version"] = "0.0.1",
7 | }
8 |
9 | function onSearch(key, page)
10 | if page == 1 then
11 | return parse(get("http://www.zhuzhupan.com/search?s=1&query=" .. pd.urlEncode(key)))
12 | else
13 | return {}
14 | end
15 | end
16 |
17 | function onItemClick(item)
18 | local act = ACT_SHARELINK
19 | local _, _, arg = string.find(get(item.url), "(https?://pan.baidu.com/s/[A-Za-z0-9-_]+)")
20 | if arg == nil or #arg == 0 then
21 | act = ACT_ERROR
22 | arg = "获取链接失败"
23 | end
24 | return act, arg
25 | end
26 |
27 | function get(url)
28 | local r = ""
29 | local c = curl.easy{
30 | url = url,
31 | followlocation = 1,
32 | timeout = 15,
33 | cookie = "is_ps2=SUCCESS",
34 | proxy = pd.getProxy(),
35 | writefunction = function(buffer)
36 | r = r .. buffer
37 | return #buffer
38 | end,
39 | }
40 | local _, e = c:perform()
41 | c:close()
42 | return r
43 | end
44 |
45 | function parse(data)
46 | local result = {}
47 | local start = 1
48 | while true do
49 | local a, b, url, title, time = string.find(data, "href=\"(/gotopan_pay%?.-)\".-_blank\">(.-).-分享时间:(%d%d%d%d%-%d%d%-%d%d)", start)
50 | if url == nil then
51 | break
52 | end
53 | local tooltip = string.gsub(title, "
(.-)", "%1")
54 | title = string.gsub(title, "
(.-)", "{c #ff0000}%1{/c}")
55 | table.insert(result, {["url"] = "http://www.zhuzhupan.com" .. url, ["title"] = title, ["time"] = time, ["showhtml"] = "true", ["tooltip"] = tooltip})
56 | start = b + 1
57 | end
58 | return result
59 | end
--------------------------------------------------------------------------------
/插件备份/serach_58wangpan.lua:
--------------------------------------------------------------------------------
1 | local curl = require "lcurl.safe"
2 | local json = require "cjson.safe"
3 |
4 |
5 | script_info = {
6 | ["title"] = "58网盘",
7 | ["version"] = "0.0.1",
8 | ["description"] = "https://www.58wangpan.com/",
9 | }
10 |
11 | function request(args)
12 |
13 | local cookie = args.cookie or ""
14 | local referer = args.referer or ""
15 | --pd.logInfo("the cccc..:"..cookie)
16 | local header = args.header or {"User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36","Cookie: "..cookie,"Referer: "..referer}
17 | --pd.logInfo("header cookie:"..header[2])
18 | local method = args.method or "GET"
19 | local para = args.para
20 | local url = args.url
21 | local data = ""
22 |
23 | local c = curl.easy{
24 | url = url,
25 | ssl_verifyhost = 0,
26 | ssl_verifypeer = 0,
27 | timeout = 15,
28 | proxy = pd.getProxy(),
29 | }
30 |
31 |
32 | if para ~= nil then
33 | c:setopt(curl.OPT_POST, 1)
34 | c:setopt(curl.OPT_POSTFIELDS, para)
35 | end
36 |
37 | if header ~= nil then
38 | c:setopt(curl.OPT_HTTPHEADER, header)
39 | end
40 |
41 | if method == "HEAD" then
42 | c:setopt(curl.OPT_NOBODY, 1)
43 | --c:setopt(curl.OPT_FOLLOWLOCATION, 1)
44 | c:setopt(curl.OPT_HEADERFUNCTION, function(h)
45 | data = data .. h
46 | end)
47 | else
48 | c:setopt(curl.OPT_WRITEFUNCTION, function(buffer)
49 | data = data .. buffer
50 | return #buffer
51 | end)
52 | end
53 |
54 | local _, err = c:perform()
55 | if err == nil and method == "HEAD" then
56 | --data = c:getinfo(curl.INFO_EFFECTIVE_URL)
57 | end
58 | c:close()
59 |
60 | if err then
61 | return nil, tostring(err)
62 | else
63 | return data, nil
64 | end
65 |
66 |
67 |
68 | end
69 |
70 | function onSearch(key,page)
71 | local url = "https://www.58wangpan.com/search/o1kw"..pd.urlEncode(key).."pg"..page
72 |
73 | local result = {}
74 | local start = 1
75 | local p_start,p_end,title,href,fileType,time
76 | local data = request({url=url})
77 | while true do
78 | p_start,p_end,fileType,href,title,time=string.find(data,'
.-
.-
(.-)
',start)
79 |
80 | if not href then
81 | pd.logInfo("no href:..")
82 | break
83 | end
84 |
85 | --pd.logInfo("href:"..href)
86 | --pd.logInfo("title:"..title)
87 | --pd.logInfo("singer:"..singer)
88 | --pd.logInfo("songstype:"..songstype)
89 | --pd.logInfo("fileSize:"..fileSize)
90 | --pd.logInfo("time:"..time)
91 |
92 |
93 | href = "https://www.58wangpan.com"..href
94 | --local img = "https://www.58wangpan.com/images/"..fileType..".png"
95 | local tooltip = string.gsub(title, '
(.-)', "%1")
96 | title = string.gsub(title,'
(.-)', "{c #ff0000}%1{/c}")
97 | pd.logInfo("title:.."..title)
98 | table.insert(result,{["href"]=href, ["title"]=title, ["time"]=time, ["showhtml"] = "true", ["tooltip"] = tooltip, ["fileType"] = fileType})
99 |
100 | start = p_end + 1
101 |
102 | end
103 |
104 | return result
105 | end
106 |
107 | function onItemClick(item)
108 | local url = getUrl(item.href)
109 | if url then
110 | return ACT_SHARELINK,url
111 | else
112 | return ACT_ERROR,"获取链接失败"
113 | end
114 |
115 | end
116 |
117 | function getUrl(href)
118 | local data = request({url=href})
119 | local baiduPan_url,url
120 | --pd.logInfo("data:"..data)
121 | local p_start,p_end,fileID = string.find(data,"dialog_fileId = '(.-)'")
122 | if fileID then
123 | url = "https://www.58wangpan.com/redirect/file?id="..fileID
124 | data = request({url=url,referer=href})
125 | p_start,p_end,baiduPan_url = string.find(data,"var url = '(.-)'")
126 | end
127 | --pd.logInfo("baiduPan_url:"..baiduPan_url)
128 | return baiduPan_url
129 | end
130 |
131 |
--------------------------------------------------------------------------------
/插件备份/serach_LOSSLESSMUSIC.lua:
--------------------------------------------------------------------------------
1 | local curl = require "lcurl.safe"
2 | local json = require "cjson.safe"
3 |
4 |
5 | script_info = {
6 | ["title"] = "LOSSLESS MUSIC",
7 | ["version"] = "0.0.1",
8 | ["description"] = "https://www.sq688.com/",
9 | }
10 |
11 | function request(args)
12 |
13 | local cookie = args.cookie or ""
14 | --pd.logInfo("the cccc..:"..cookie)
15 | local header = args.header or {"User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"}
16 | --pd.logInfo("header cookie:"..header[2])
17 | local method = args.method or "GET"
18 | local para = args.para
19 | local url = args.url
20 | local data = ""
21 | if cookie then
22 | --pd.logInfo("set header cookie:".."Cookie: "..cookie)
23 | table.insert(header,"Cookie: "..cookie)
24 | --pd.logInfo("the header is:"..header[2])
25 | end
26 | local c = curl.easy{
27 | url = url,
28 | ssl_verifyhost = 0,
29 | ssl_verifypeer = 0,
30 | timeout = 15,
31 | proxy = pd.getProxy(),
32 | }
33 |
34 |
35 | if para ~= nil then
36 | c:setopt(curl.OPT_POST, 1)
37 | c:setopt(curl.OPT_POSTFIELDS, para)
38 | end
39 |
40 | if header ~= nil then
41 | c:setopt(curl.OPT_HTTPHEADER, header)
42 | end
43 |
44 | if method == "HEAD" then
45 | c:setopt(curl.OPT_NOBODY, 1)
46 | --c:setopt(curl.OPT_FOLLOWLOCATION, 1)
47 | c:setopt(curl.OPT_HEADERFUNCTION, function(h)
48 | data = data .. h
49 | end)
50 | else
51 | c:setopt(curl.OPT_WRITEFUNCTION, function(buffer)
52 | data = data .. buffer
53 | return #buffer
54 | end)
55 | end
56 |
57 | local _, err = c:perform()
58 | if err == nil and method == "HEAD" then
59 | --data = c:getinfo(curl.INFO_EFFECTIVE_URL)
60 | end
61 | c:close()
62 |
63 | if err then
64 | return nil, tostring(err)
65 | else
66 | return data, nil
67 | end
68 |
69 |
70 |
71 | end
72 |
73 | function onSearch(key,page)
74 | local url = "https://www.sq688.com/search.php?key="..pd.urlEncode(key).."&page="..page
75 |
76 | local result = {}
77 | local start = 1
78 | local p_start,p_end,title,href,singer,songstype,fileSize,time
79 | local data = request({url=url})
80 | while true do
81 | p_start,p_end,href,title,singer,songstype,fileSize,time=string.find(data,'
.-(.-).-(.-) | .-class="songstype">(.-).-(.-) | .-(%d%d%d%d%-%d%d%-%d%d) | ',start)
82 |
83 | if not href then
84 | break
85 | end
86 |
87 | --pd.logInfo("href:"..href)
88 | --pd.logInfo("title:"..title)
89 | --pd.logInfo("singer:"..singer)
90 | --pd.logInfo("songstype:"..songstype)
91 | --pd.logInfo("fileSize:"..fileSize)
92 | --pd.logInfo("time:"..time)
93 |
94 |
95 | href = "https://www.sq688.com"..href
96 |
97 | local tooltip = string.gsub(title, key, "%1")
98 | title = string.gsub(title,key, "{c #ff0000}%1{/c}")
99 | local description = "歌手:"..singer.." 文件大小:"..fileSize.." 文件格式:"..songstype
100 | table.insert(result,{["href"]=href, ["title"]=title, ["time"]=time, ["showhtml"] = "true", ["tooltip"] = tooltip, ["check_url"] = "true",["description"] = description})
101 |
102 | start = p_end + 1
103 |
104 | end
105 |
106 | return result
107 | end
108 |
109 | function onItemClick(item)
110 | local url = getUrl(item.href)
111 | if url then
112 | return ACT_SHARELINK,url
113 | else
114 | return ACT_ERROR,"获取链接失败"
115 | end
116 |
117 | end
118 |
119 | function getUrl(href)
120 | local data = request({url=href})
121 | --pd.logInfo("data:"..data)
122 | local p_start,p_end,baiduPan_url,password = string.find(data,'.-data%-clipboard%-text="(.-)">')
123 | if password then
124 | baiduPan_url = baiduPan_url .. " " .. password
125 | end
126 | --pd.logInfo("baiduPan_url:"..baiduPan_url)
127 | return baiduPan_url
128 | end
129 |
130 |
--------------------------------------------------------------------------------
/插件备份/serach_dalipan.lua:
--------------------------------------------------------------------------------
1 | local curl = require "lcurl.safe"
2 |
3 | script_info = {
4 | ["title"] = "大力盘",
5 | ["description"] = "https://www.dalipan.com/",
6 | ["version"] = "0.0.1",
7 | }
8 |
9 | function request(url,header)
10 | local r = ""
11 | local c = curl.easy{
12 | url = url,
13 | httpheader = header,
14 | ssl_verifyhost = 0,
15 | ssl_verifypeer = 0,
16 | followlocation = 1,
17 | timeout = 15,
18 | proxy = pd.getProxy(),
19 | writefunction = function(buffer)
20 | r = r .. buffer
21 | return #buffer
22 | end,
23 | }
24 | local _, e = c:perform()
25 | c:close()
26 | return r
27 | end
28 |
29 |
30 |
31 | function onSearch(key, page)
32 |
33 | local header = {
34 | "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
35 | }
36 |
37 | local data = request("https://www.dalipan.com/search?keyword=" .. pd.urlEncode(key) .. "&page=" .. page, header)
38 | local result = {}
39 | local start = 1
40 |
41 | while true do
42 |
43 | local a, b, img, id, title, time = string.find(data, ')
(.-).-
(.-)
', start)
44 |
45 | if id == nil then
46 | break
47 | end
48 |
49 | --title = string.gsub(title, "^%s*", "", 1)
50 | local tooltip = string.gsub(title, "
(.-)", "%1")
51 | title = string.gsub(title, "
(.-)", "{c #ff0000}%1{/c}")
52 | table.insert(result, {["id"] = id , ["title"] = title, ["showhtml"] = "true", ["tooltip"] = tooltip, ["time"] = time, ["image"] = "https://dalipan.com" .. img, ["icon_size"] = "35,40"})
53 | -- table.insert(result, {["url"] = url .. " " .. pwd, ["title"] = title, ["showhtml"] = "true", ["tooltip"] = tooltip, ["check_url"] = "true", ["time"] = time})
54 | start = b + 1
55 |
56 | end
57 | return result
58 | end
59 |
60 |
61 | function parseDetail(id)
62 |
63 | local deatil_url = "https://www.dalipan.com/detail/".. id
64 | header = {
65 | "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36",
66 | "referer: " .. deatil_url,
67 | }
68 | local image_url = "https://www.dalipan.com/images/recommand.png"
69 | request(image_url, header)
70 | local api_url = 'https://www.dalipan.com/api/private?id=' .. id
71 | local ret = request(api_url, header)
72 | local a, c, pwd, url = string.find(ret, '"pwd": "(.-)",.-"url": "(.-)"')
73 |
74 | return url .. " " .. pwd
75 |
76 | end
77 |
78 | function onItemClick(item)
79 |
80 | local url = parseDetail(item.id)
81 | return ACT_SHARELINK, url
82 | end
83 |
84 |
--------------------------------------------------------------------------------
/插件备份/serach_lanzousearch.lua:
--------------------------------------------------------------------------------
1 | local curl = require "lcurl.safe"
2 | local json = require "cjson.safe"
3 |
4 |
5 | script_info = {
6 | ["title"] = "蓝奏云搜索",
7 | ["version"] = "0.0.6",
8 | ["description"] = "搜索蓝奏云资源,点击下载",
9 | }
10 |
11 | function request(args)
12 |
13 | local cookie = args.cookie or ""
14 | --pd.logInfo("the cccc..:"..cookie)
15 | local header = args.header or {"User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"}
16 | --pd.logInfo("header cookie:"..header[2])
17 | local method = args.method or "GET"
18 | local para = args.para
19 | local url = args.url
20 | local data = ""
21 | if cookie then
22 | --pd.logInfo("set header cookie:".."Cookie: "..cookie)
23 | table.insert(header,"Cookie: "..cookie)
24 | --pd.logInfo("the header is:"..header[2])
25 | end
26 | local c = curl.easy{
27 | url = url,
28 | ssl_verifyhost = 0,
29 | ssl_verifypeer = 0,
30 | timeout = 15,
31 | proxy = pd.getProxy(),
32 | }
33 |
34 |
35 | if para ~= nil then
36 | c:setopt(curl.OPT_POST, 1)
37 | c:setopt(curl.OPT_POSTFIELDS, para)
38 | end
39 |
40 | if header ~= nil then
41 | c:setopt(curl.OPT_HTTPHEADER, header)
42 | end
43 |
44 | if method == "HEAD" then
45 | c:setopt(curl.OPT_NOBODY, 1)
46 | --c:setopt(curl.OPT_FOLLOWLOCATION, 1)
47 | c:setopt(curl.OPT_HEADERFUNCTION, function(h)
48 | data = data .. h
49 | end)
50 | else
51 | c:setopt(curl.OPT_WRITEFUNCTION, function(buffer)
52 | data = data .. buffer
53 | return #buffer
54 | end)
55 | end
56 |
57 | local _, err = c:perform()
58 | if err == nil and method == "HEAD" then
59 | --data = c:getinfo(curl.INFO_EFFECTIVE_URL)
60 | end
61 | c:close()
62 |
63 | if err then
64 | return nil, tostring(err)
65 | else
66 | return data, nil
67 | end
68 |
69 |
70 |
71 | end
72 |
73 | function onSearch(key, page)
74 | if page == 1 then
75 | interfaceID = pd.choice({"接口1","接口2"}, 1, "请选择")
76 | if interfaceID == 1 then
77 | engine = "site%3Apan.lanzou.com+"
78 | else
79 | engine = "site%3Awww.lanzous.com+"
80 | end
81 | end
82 |
83 |
84 | local cookie = setCookie()
85 | --pd.logInfo("the cookie is:"..cookie)
86 | local data,p_start,p_end
87 | --pd.logInfo("start send request")
88 | data = request({url="https://www.dogedoge.com/results?q="..engine..""..pd.urlEncode(key).."&p="..page,cookie=cookie})
89 |
90 | -- Detect the cookie Invalid
91 | if string.find(data,"302 Found") then
92 | pd.logInfo("the cookie is invalid, reset it")
93 | cookie = setCookie("reset")
94 | data = request({url="https://www.dogedoge.com/results?q=site%3Apan.lanzou.com+"..pd.urlEncode(key).."&p="..page,cookie=cookie})
95 |
96 | end
97 |
98 | --pd.logInfo(data)
99 |
100 | --pd.logInfo("get request data:"..data)
101 | local result = {}
102 | local start = 1
103 | local href,title,lanzou_url
104 | while true do
105 | -- get href and title
106 | --pd.logInfo("start:"..start)
107 | p_start,p_end,href,title = string.find(data,'
(.-)',start)
108 | --pd.logInfo("p_end:"..p_end)
109 | if href then
110 | -- get avaliable data
111 | -- pd.logInfo("get title:"..title)
112 | -- pd.logInfo("get href:"..href)
113 | -- complete href
114 | href = "https://www.dogedoge.com" .. href
115 | -- get lanzou url
116 | _,__,lanzou_url = string.find(request({url=href,method="HEAD"}),"Location:.- (%S-)%s")
117 | pd.logInfo("lanzou url:"..lanzou_url)
118 | local single_data = request({url=lanzou_url})
119 | --pd.logInfo("get lanzou url data:"..(data or ""))
120 | if single_data then
121 | local url_type
122 | if string.find(single_data,"filemoreajax") then
123 | url_type = "list"
124 | else
125 | url_type = "file"
126 | end
127 | --pd.logInfo("this url is "..url_type.." url")
128 | if not string.find(single_data,"输入密码") then
129 | -- the url do not need password
130 | local tooltip = string.gsub(title, "
(.-)", "%1")
131 | title = string.gsub(title,"
(.-)", "{c #ff0000}%1{/c}")
132 | table.insert(result,{["url"]=lanzou_url, ["title"]=title, ["description"]=lanzou_url, ["showhtml"] = "true", ["tooltip"] = tooltip, ["url_type"] = url_type})
133 | end
134 |
135 | end
136 | start = p_end + 1
137 | else
138 | --pd.logInfo("this key words has not avaliable url:"..key)
139 | break
140 | end
141 |
142 | end
143 | return result
144 |
145 | end
146 |
147 | function onItemClick(item)
148 | -- get the lanzou_url about clike item
149 | local lanzou_url = item.url
150 | -- get url type
151 | local url_type = item.url_type
152 | local title
153 | -- get real download url
154 | local download_url
155 | if url_type == "list" then
156 | download_url,title = getList(lanzou_url)
157 | --pd.logInfo("get download_url:"..download_url)
158 | else
159 | download_url,title = getSingle(lanzou_url)
160 | --pd.logInfo("get single download_url:"..download_url)
161 | end
162 |
163 |
164 |
165 | -- if download url is nil, return error
166 |
167 | if download_url == nil then
168 | return ACT_ERROR,"不支持的链接"
169 | elseif pd.addUri then
170 | pd.addUri(download_url, {["out"] = title})
171 | return ACT_MESSAGE, "已添加到下载列表"
172 | else
173 | --pd.logInfo("start to download:"..download_url)
174 | return ACT_DOWNLOAD, download_url
175 | end
176 |
177 | end
178 |
179 | function getSingle(url)
180 | local download_url,header,p_strat,p_end,fileName,fileId
181 |
182 | local data = request({url=url})
183 | if string.find(data,"输入密码") then
184 | --pd.logInfo("this lanzou url need password"..url)
185 | return nil
186 | end
187 |
188 | if not data then
189 | pd.logInfo("this url can not get data"..url)
190 | return nil
191 | end
192 | -- get file name
193 | p_strat,p_end,fileName = string.find(data,'
(.-) %- 蓝奏云')
194 |
195 | -- structure the request header
196 | header = {"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36","referer: ".. url}
197 |
198 | -- get file id
199 | p_strat,p_end,fileId = string.find(data,'[^-]