# -*- coding: utf-8 -*-
import clr
import sys
import System

sys.path.append(UI.StartupPath+'\Script\Module\dll')
clr.AddReferenceToFile("EasyScript.dll")
from EasyScript import *
EasyScript = EasyScript()

URL="http://www.speedyshare.com/"

UI.UpdateLog("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※")
UI.UpdateLog("※【免空科學研究所 　ｔｉｇｅｒｍａｘ．ｄｙｎｄｎｓ．ｏｒｇ】※")
UI.UpdateLog("※～㊣　　　　　　　　 　　傻Ｂ　　製作分享　　　　　　　㊣～※")
UI.UpdateLog("※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※")
UI.UpdateLog("【腳本更新】：2013.03.13")
UI.UpdateLog("【上傳空間】：speedyshare.com")
UI.UpdateLog("【上傳大小】：無限")
UI.UpdateLog("【砍檔時間】：未知")
UI.UpdateLog("【腳本功能】：無帳號上傳")
UI.UpdateLog("＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝",2)

HTML=HTTP.GetURL(URL)
UP_URL=EasyScript.GetstrToVariable(HTML,'index10" src="','"',1)
UP_URL_S=EasyScript.GetstrToVariable(UP_URL,'http://','/',1)
HTML=HTTP.GetURL(UP_URL)
UI.UpdateLog("開始進入上傳頁面…",2)
UP_page=EasyScript.GetstrToVariable(HTML,'ulform action="','"',1)
UP_LINK="http://"+UP_URL_S+UP_page
HTTP.AddUpParam("action","upload")
HTTP.AddFileReference("upload[]")
HTML=UI.UpFile(UP_LINK)
LINK=EasyScript.GetstrToVariable(HTML,"links(",")",1)
if LINK!=False:
	DL_ID=EasyScript.GetstrToVariable(LINK,"'",":",1)
	DL_LINK="http://speedy.sh/"+DL_ID+"/"+UI.FileName
	DE_KEY=EasyScript.GetstrToVariable(LINK,":",":",1)
	UI.UpdateLog("＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝",2)
        UI.UpdateLog("下載連結：",4)
        UI.UpdateLog(DL_LINK)
        UI.UpdateLog("刪檔密碼：",3)
        UI.UpdateLog(DE_KEY)
        UI.AddShareLink(DL_LINK)
        UI.ProceSuccess()
else:
        UI.UpdateLog("無法取得網址",3)
        UI.ProceFalse()