------------------------------------------------------------------------------
轉貼內容
轉自無限論壇
原出處:http://pro.tw.fdzone.org/viewthr ... p;extra=&page=1
可轉証明

------------------------------------------------------------------------------
我所使用的 shareme.lua
如何使用這個腳本,您有兩個方法
1. 在以下欄位填上相對應的資料
DownUserMail = " " 下載用的帳號
DownPassWord = " " 密碼
DownUserID = " " 流水號(可不填)
UpUserMail = " " 上傳用的帳號
UpPassWord = " " 密碼
UpUserID = " " 流水號(可不填)
2.自己打帳號密碼 (檔案清單內 右鍵->屬性->進階->)
Username(帳號) = 電子郵件形式的帳號
Password(密碼) = 密碼-流水號 (請不要省 減號) ex: password-I0123456
以上流水號都可以省略,除非(簡言之:這是帳號切換開關 有寫才會切換帳號)
1.您要傳檔案到指定帳戶的時候才要寫上(多帳號時)
2.您的上下傳帳號分開的(上傳用 32GB 下載用2GB)
如何找流水號:
請打開瀏覽器,登入shareme網站中的檔案管理,隨意上傳一個檔案後複製其連結,可能如下
http://www.shareme.tw/file/Downl ... 32f37352e7061727430
其中 I04567XX 即為您的流水號
為什麼又取消編碼腳本:
因為我沒弄懂 函數之間的相容關係(新舊版本之間函數有些微不同)
AddFormFile( "file", false) 這是新版才能用的.....
現在弄懂了,當然就能用回我習慣公開的開放腳本
使用上注意的地方:
如果您上傳的檔案太小可能會導致網頁瞬間完檔而抓不到檔名,進而無法取得連結(舊版才會)
舊版本(1.2.3.4以上1.2.3.4.4以下版本)複製內容到剪貼板
代碼:
--[[
freegrab.MODULE["shareme.tw"] = { name="shareme", cat="webhost",
home="http://www.shareme.tw", charset="UTF-8",
fnformat="$url.$ext"}
]]
MODULE_NAME = "shareme"
MODULE_VERSION = "0.0.4"
MODULE_REQUIRE_VERSION = "1.2.3.4"
MODULE_AUTHOR = ""
MODULE_LAST_UPDATE = "2008/07/03"
MODULE_DESCR = [[ ]]
DownUserMail = " @seed.net.tw"
DownPassWord = " "
DownUserID = " "
UpUserMail = " @seed.net.tw"
UpPassWord = " "
UpUserID = " "
-------------------------------------------------------------------------
--local func
-------------------------------------------------------------------------
local function printnow()
if not Compile("(.*)") then return false end
local _,ttt = What()
UpdateLog(ttt)
return true
end
local function GetLoginInfo()
local UserMail = GetUsername()
local PassWord = GetPassword():match("(.+)%-")
local UserID = GetPassword():match("%-(.+)")
return UserMail, PassWord, UserID
end
local function LoginShareMe(username, password, userid) -- Shield of Login
if not GetHtml("http://www.shareme.tw/file/FileManager.do") then return false end
if not Compile('"(I[^:]+):-du-') then return false end
local _,webuserid1 = What()
if webuserid1 then
if not userid then UpdateLog( "沒有提供使用者流水號,故不檢查帳號正確性" ) return true end
if userid:len() == 0 then UpdateLog( "沒有提供使用者流水號,故不檢查帳號正確性" ) return true end
if webuserid1 == userid then return true end
if not GetHtml("http://www.shareme.tw/member/Logout.do") then return false end
end
AddFormField("account", username)
AddFormField("password", password)
AddFormField("rememberInfo", "on")
if not PostForm("http://www.shareme.tw/member/Login.do") then return false end
if not GetHtml("http://www.shareme.tw/file/FileManager.do") then return false end
if not Compile('"(I[^:]+):-du-') then return false end
local _,webuserid2 = What()
if webuserid2 then
if not userid then UpdateLog( "沒有使用者提供流水號,故不檢查帳號正確性" ) return true end
if userid:len() == 0 then UpdateLog( "沒有提供使用者流水號,故不檢查帳號正確性" ) return true end
if webuserid2 ~= userid then UpdateLog( "提供的使用者流水號不正確" ) return false end
return true
else
UpdateLog( "登入用的使用者帳號、密碼、流水號不正確" )
UpdateLog( "帳號欄位:fdzone@shareme.seed.net.tw (只是舉例不是真的能用)" )
UpdateLog( "密碼欄位:pwfdzone-I0123456 (是下載者的使用者流水號)" )
return false
end
end
local function DownFile()
local baseurl = GetUrl()
if not GetUsername() or not GetPassword() then else
DownUserMail, DownPassWord, DownUserID = GetLoginInfo()
end
if not LoginShareMe(DownUserMail, DownPassWord, DownUserID) then return false end
if not GetHtml(baseurl) then return false end
if not Compile('location="([^"]+Download[^"]+)".*?fileInfoName">([^<]+)<') then return false end
local _, dl, fn = What()
if not fn then UpdateLog( "找不到檔名" ) return false end
if not dl then UpdateLog( "找不到連結" ) return false end
SetFilename(fn)
return GetFile("http://www.shareme.tw"..dl)
end
-------------------------------------------------------------------------
--main
-------------------------------------------------------------------------
function Download()
local url = GetUrl()
--http://shareme.seed.net.tw/UserFile.do?fileid=
--http://shareme.seed.net.tw/file/DownloadRequest.do?fid=
--http://www.shareme.tw/UserFile.do?fileid=
--http://www.shareme.tw/file/DownloadRequest.do?fid=
if url:find( "UserFile.do" ) or url:find( "DownloadRequest.do" ) then
url = url:replace("UserFile.do?fileid", "file/DownloadRequest.do?fid")
url = url:replace("shareme.seed.net.tw", "www.shareme.tw")
SetUrl(url)
return DownFile()
else
UpdateLog( "網址有誤" )
return false
end
end
function Upload()
if not GetUsername() or not GetPassword() then else
UpUserMail, UpPassWord, UpUserID = GetLoginInfo()
end
if not LoginShareMe(UpUserMail, UpPassWord, UpUserID) then return false end
if not Compile('"/nhdfiles/public", "([^"]+)"') then return false end
local _,public_folder = What()
if not public_folder then UpdateLog( "找不到公開資料夾" ) return false end
SetReferer("http://www.shareme.tw/file/FileManager.do")
if not PostForm("http://www.shareme.tw/file/UploadFilesForm.do?ot=j&fid="..public_folder:replace(":", "%3A")) then return false end
if not Compile('id_prefix = "([^"]+)".*?id_index = ([^;]+);') then return false end
local _,id_prefix,id_index = What()
if not id_prefix or not id_index then UpdateLog( "找不到id_prefix,id_index" ) return false end
local uploadUUID = id_prefix.."_"..id_index
AddFormField( "uploadid", "", false)
AddFormFile( "file")
--AddFormFile( "file", false)
--AddFormFile( "file", false)
SetReferer("http://www.shareme.tw/file/UploadFilesForm.do?ot=j&fid="..public_folder:replace(":", "%3A"))
if not UploadFile("http://www.shareme.tw/file/UploadFiles.do?folderid="..public_folder.."&uploadUUID="..uploadUUID) then return false end
if not GetHtml("http://www.shareme.tw/file/view/uploadStatusReport.jsp?uploadUUID="..uploadUUID) then return false end
if not Compile('fileName>([^<]+)</fileName') then return false end
local _, fileName = What()
if not fileName then UpdateLog( "找不到fileName" ) return false end
if not GetHtml("http://www.shareme.tw/file/GetFiles.do?fid="..public_folder) then return false end
if not Compile('<id>([^<]+)</id><name>'..fileName..'</name>') then return false end
local _,fid = What()
if not fid then UpdateLog( "找不到fid" ) return false end
SetUrl("http://www.shareme.tw/file/DownloadRequest.do?fid="..fid)
--if not GetHtml("http://www.shareme.tw/file/GetFiles.do?fid="..public_folder) then return false end
--if not Compile('<id>([^<]+)</id><name>'..GetFilename()..'</name>') then return false end
--local _,fid = What()
--if not fid then UpdateLog( "找不到fid" ) return false end
--SetUrl("http://www.shareme.tw/file/DownloadRequest.do?fid="..fid)
UpdateLog("上傳成功")
return true
end
-------------------------------------------------------------------------
--end of file
-------------------------------------------------------------------------新版本(1.2.3.4.4以上版本)複製內容到剪貼板
代碼:
MODULE_NAME = "shareme"
MODULE_VERSION = "0.0.4"
MODULE_REQUIRE_VERSION = "1.2.3.4.4"
MODULE_AUTHOR = ""
MODULE_LAST_UPDATE = "2008/07/03"
MODULE_DESCR = [[ ]]
DownUserMail = " @seed.net.tw"
DownPassWord = " "
DownUserID = " "
UpUserMail = " @seed.net.tw"
UpPassWord = " "
UpUserID = " "
-------------------------------------------------------------------------
--local func
-------------------------------------------------------------------------
local function printnow()
if not Compile("(.*)") then return false end
local _,ttt = What()
UpdateLog(ttt)
return true
end
local function GetLoginInfo()
local UserMail = GetUsername()
local PassWord = GetPassword():match("(.+)%-")
local UserID = GetPassword():match("%-(.+)")
return UserMail, PassWord, UserID
end
local function LoginShareMe(username, password, userid) -- Shield of Login
if not GetHtml("http://www.shareme.tw/file/FileManager.do") then return false end
if not Compile('"(I[^:]+):-du-') then return false end
local _,webuserid1 = What()
if webuserid1 then
if not userid then UpdateLog( "沒有提供使用者流水號,故不檢查帳號正確性" ) return true end
if userid:len() == 0 then UpdateLog( "沒有提供使用者流水號,故不檢查帳號正確性" ) return true end
if webuserid1 == userid then return true end
if not GetHtml("http://www.shareme.tw/member/Logout.do") then return false end
end
AddFormField("account", username)
AddFormField("password", password)
AddFormField("rememberInfo", "on")
if not PostForm("http://www.shareme.tw/member/Login.do") then return false end
if not GetHtml("http://www.shareme.tw/file/FileManager.do") then return false end
if not Compile('"(I[^:]+):-du-') then return false end
local _,webuserid2 = What()
if webuserid2 then
if not userid then UpdateLog( "沒有使用者提供流水號,故不檢查帳號正確性" ) return true end
if userid:len() == 0 then UpdateLog( "沒有提供使用者流水號,故不檢查帳號正確性" ) return true end
if webuserid2 ~= userid then UpdateLog( "提供的使用者流水號不正確" ) return false end
return true
else
UpdateLog( "登入用的使用者帳號、密碼、流水號不正確" )
UpdateLog( "帳號欄位:fdzone@shareme.seed.net.tw (只是舉例不是真的能用)" )
UpdateLog( "密碼欄位:pwfdzone-I0123456 (是下載者的使用者流水號)" )
return false
end
end
local function DownFile()
local baseurl = GetUrl()
if not GetUsername() or not GetPassword() then else
DownUserMail, DownPassWord, DownUserID = GetLoginInfo()
end
if not LoginShareMe(DownUserMail, DownPassWord, DownUserID) then return false end
if not GetHtml(baseurl) then return false end
if not Compile('location="([^"]+Download[^"]+)".*?fileInfoName">([^<]+)<') then return false end
local _, dl, fn = What()
if not fn then UpdateLog( "找不到檔名" ) return false end
if not dl then UpdateLog( "找不到連結" ) return false end
SetFilename(fn)
return GetFile("http://www.shareme.tw"..dl)
end
-------------------------------------------------------------------------
--main
-------------------------------------------------------------------------
function Download()
local url = GetUrl()
--http://shareme.seed.net.tw/UserFile.do?fileid=
--http://shareme.seed.net.tw/file/DownloadRequest.do?fid=
--http://www.shareme.tw/UserFile.do?fileid=
--http://www.shareme.tw/file/DownloadRequest.do?fid=
if url:find( "UserFile.do" ) or url:find( "DownloadRequest.do" ) then
url = url:replace("UserFile.do?fileid", "file/DownloadRequest.do?fid")
url = url:replace("shareme.seed.net.tw", "www.shareme.tw")
SetUrl(url)
return DownFile()
else
UpdateLog( "網址有誤" )
return false
end
end
function Upload()
if not GetUsername() or not GetPassword() then else
UpUserMail, UpPassWord, UpUserID = GetLoginInfo()
end
if not LoginShareMe(UpUserMail, UpPassWord, UpUserID) then return false end
if not Compile('"/nhdfiles/public", "([^"]+)"') then return false end
local _,public_folder = What()
if not public_folder then UpdateLog( "找不到公開資料夾" ) return false end
SetReferer("http://www.shareme.tw/file/FileManager.do")
if not PostForm("http://www.shareme.tw/file/UploadFilesForm.do?ot=j&fid="..public_folder:replace(":", "%3A")) then return false end
if not Compile('id_prefix = "([^"]+)".*?id_index = ([^;]+);') then return false end
local _,id_prefix,id_index = What()
if not id_prefix or not id_index then UpdateLog( "找不到id_prefix,id_index" ) return false end
local uploadUUID = id_prefix.."_"..id_index
AddFormField( "uploadid", "", false)
AddFormFile( "file")
--AddFormFile( "file", false)
--AddFormFile( "file", false)
SetReferer("http://www.shareme.tw/file/UploadFilesForm.do?ot=j&fid="..public_folder:replace(":", "%3A"))
if not UploadFile("http://www.shareme.tw/file/UploadFiles.do?folderid="..public_folder.."&uploadUUID="..uploadUUID) then return false end
--if not GetHtml("http://www.shareme.tw/file/view/uploadStatusReport.jsp?uploadUUID="..uploadUUID) then return false end
--if not Compile('fileName>([^<]+)</fileName') then return false end
--local _, fileName = What()
--if not fileName then UpdateLog( "找不到fileName" ) return false end
--if not GetHtml("http://www.shareme.tw/file/GetFiles.do?fid="..public_folder) then return false end
--if not Compile('<id>([^<]+)</id><name>'..fileName..'</name>') then return false end
--local _,fid = What()
--if not fid then UpdateLog( "找不到fid" ) return false end
--SetUrl("http://www.shareme.tw/file/DownloadRequest.do?fid="..fid)
if not GetHtml("http://www.shareme.tw/file/GetFiles.do?fid="..public_folder) then return false end
if not Compile('<id>([^<]+)</id><name>'..GetFilename()..'</name>') then return false end
local _,fid = What()
if not fid then UpdateLog( "找不到fid" ) return false end
SetUrl("http://www.shareme.tw/file/DownloadRequest.do?fid="..fid)
UpdateLog("上傳成功")
return true
end
-------------------------------------------------------------------------
--end of file
-------------------------------------------------------------------------