# -*- 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.upitus.net/"

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

HTML=HTTP.GetURL(URL)
UP_LINK=EasyScript.GetstrToVariable(HTML,'form-data" action="','"',1)
sess_id=EasyScript.GetstrToVariable(HTML,'sess_id" value="','"',1)
srv_tmp_url=EasyScript.GetstrToVariable(HTML,'srv_tmp_url" value="','"',1)
UI.UpdateLog("開始進入上傳頁面…",2)
HTTP.AddUpParam("upload_type","file")
HTTP.AddUpParam("sess_id",sess_id)
HTTP.AddUpParam("srv_tmp_url",srv_tmp_url)
HTTP.AddUpParam("tos","1")
HTTP.AddFileReference("file_1")
HTML=UI.UpFile(UP_LINK)
DL_LINK=EasyScript.GetstrToVariable(HTML,"[URL=","]",1)
DE_ID=EasyScript.GetstrToVariable(HTML,DL_LINK+"?","<",1)
DE_LINK=DL_LINK+"?"+DE_ID
if DL_LINK!=False:
	UI.UpdateLog("＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝",2)
        UI.UpdateLog("下載連結：",4)
        UI.UpdateLog(DL_LINK)
        UI.UpdateLog("刪檔連結：",3)
        UI.UpdateLog(DE_LINK)
        UI.AddShareLink(DL_LINK)
        UI.ProceSuccess()
else:
        UI.UpdateLog("無法取得網址",3)
        UI.ProceFalse()