lnt900

FsharEd.au3

Mar 11th, 2013
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 17.44 KB | None | 0 0
  1. #cs
  2. FsharEd
  3. ************** Infos *****************
  4. Version : 0.3 BETA
  5. Author : lnt900@gmail.com
  6. Source and Build : https://github.com/lnt900/Fshar-Ed
  7. Changelogs : https://github.com/lnt900/Fshar-Ed/commits/master
  8. *******************************************
  9. #ce
  10. #include <GUIListBox.au3>
  11. #include <WindowsConstants.au3>
  12. #include <File.au3>
  13. #include <Array.au3>
  14. #include <GuiListView.au3>
  15. #include <GUIConstants.au3>
  16. #include <GuiButton.au3>
  17.  
  18. Global $version = "0.3 BETA"
  19. Global $hListBox,$origHWND,$lastCopied='',$WM_CLIPUPDATE=0x031D
  20. Local $hGUI, $linklist, $dllist, $listviewcontrols, $username, $password, $retry = 0, $loggedin = 0, $cookies[1][2] = [["", ""]], $f = "account.txt"
  21.  
  22. ; GUI
  23. $hGUI = GUICreate("FsharEd " & $version, 800, 600)
  24. ;GUISetIcon(@SystemDir & "\mspaint.exe", 0)
  25.  
  26. ;Clipboard monitor
  27. $origHWND = DLLCall("user32.dll","int","AddClipboardFormatListener","hwnd",$hGUI)
  28. $origHWND = $origHWND[0]
  29. GUIRegisterMsg($WM_CLIPUPDATE,"OnClipBoardChange")
  30. Func OnClipBoardChange($hWnd, $Msg, $wParam, $lParam)
  31.     ; do what you need when clipboard changes
  32.     CBmonitor(ClipGet())
  33. EndFunc
  34.  
  35. ; Input link box
  36. GUICtrlCreateLabel("Fshare links (Đưa link fshare vào đây, phân cách bởi xuống dòng hoặc space)" & @CRLF & "Nếu có mật khẩu thì thêm vào sau link kèm theo ký tự | (vd : link|matkhau) Nếu không nhập mật khẩu cùng link, tool sẽ tự động hỏi.", 5, 3)
  37. $LinkInput = GUICtrlCreateEdit("", 5, 40, 500, 185)
  38.  
  39. ; LIST VIEW
  40. Local $iListView = GUICtrlCreateListView("", 5, 235, 790,180)
  41. _GUICtrlListView_AddColumn($iListView, "Fshare Link", 200)
  42. _GUICtrlListView_AddColumn($iListView, "Download Link", 530)
  43. _GUICtrlListView_AddColumn($iListView, "Size", 55)
  44.  
  45. ;buttons
  46. $btnGetLink = GUICtrlCreateButton ("Lấy Link Download  >>>", 520,  40, 250, 40)
  47. $btnClearlinks = GUICtrlCreateButton ("Xóa danh sách download", 520,  420, 180, 45)
  48. _GUICtrlButton_Enable($btnClearlinks, False)
  49. $btnSendToIDM = GUICtrlCreateButton ("Gửi link sang IDM", 520,  475, 180, 45)
  50. _GUICtrlButton_Enable($btnSendToIDM, False)
  51. $btnCopy = GUICtrlCreateButton ("Copy links download", 520,  530, 180, 45)
  52. _GUICtrlButton_Enable($btnCopy, False)
  53.  
  54. ;checkbox
  55. ;GUICtrlCreateCheckbox("Xóa list cũ", 710, 20, 80, 20)
  56. ;GUICtrlSetState(-1, $GUI_CHECKED)
  57.  
  58. ; Listbox Progress
  59. $hListBox = _GUICtrlListBox_Create($hGUI, "", 5, 420, 500, 170, BitOR($LBS_NOSEL, $WS_VSCROLL, $WS_HSCROLL, $LBS_HASSTRINGS))
  60. GUISetState(@SW_SHOW)
  61. _GUICtrlListBox_ResetContent($hListBox)
  62. ;_GUICtrlListBox_InitStorage($hListBox, 100, 4096)
  63. addText("Fshare Get " & $version & ' Started ...',$hListBox);
  64. addText("[Info] Open Source Project founded by lnt900 @ HDVietnam forum",$hListBox)
  65. addText("----------------------------------------------------------------------------------------",$hListBox)
  66.  
  67.  
  68. ;function to add text and scroll listbox to bottom
  69. Func addText($txt,$listBox)
  70.      _GUICtrlListBox_InsertString($listBox, $txt, -1)
  71.      $num = _SendMessage($hListBox, 0x18B, 0, 0)
  72.     _GUICtrlListBox_SetCurSel($listBox, $num -1)
  73. EndFunc
  74.  
  75. ;account info
  76. Dim $aRecords
  77. If Not _FileReadToArray($f, $aRecords) Then
  78.     $username = ""
  79.     $password = ""
  80. ElseIf $aRecords[0] > 1 Then
  81.     $username = $aRecords[1]
  82.     $password = $aRecords[2]
  83.     addText("[Account] Sử dụng tài khoản " & $username & " ...",$hListBox)
  84. EndIf
  85.  
  86. ; GROUP / Input fshare account
  87. GUICtrlCreateGroup("Thông tin Fshare Account", 520, 80,250,145)
  88. GUICtrlCreateLabel("Email :", 540, 100)
  89. $txtAccEmail = GUICtrlCreateInput($username, 540, 115, 210, 22)
  90. GUICtrlCreateLabel("Mật khẩu :", 540, 140)
  91. $txtAccPassword = GUICtrlCreateInput($password, 540, 155, 210, 22, 0x0020)
  92. $btnSaveAccInfo = GUICtrlCreateButton ("Lưu lại", 600,  185, 100, 25)
  93. GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group
  94.  
  95. ;function to save account to tzt file
  96. Func saveAcc($usr, $pw,$file)
  97.     $usrx = GUICtrlRead($usr)
  98.     $pwx = GUICtrlRead($pw)
  99.     FileDelete($file)
  100.     $fxx = FileOpen($file, 1)
  101.     FileSetPos($fxx,0,0)
  102.     FileFlush($fxx)
  103.     FileWrite($fxx, $usrx & @CRLF)
  104.     FileWrite($fxx, $pwx & @CRLF)
  105.     FileClose($fxx)
  106.     addText("[Account] Đã lưu thông tin tài khoản fshare ...",$hListBox)
  107. EndFunc
  108.  
  109. ;function logout of fshare
  110. Func logoutF()
  111.     addText("[Fshare] Logout khỏi fshare ...",$hListBox)
  112.     $res = getHTTP("http://www.fshare.vn/logout.php", mkCookies())
  113.     $res = getHTTP("http://www.fshare.vn/", mkCookies(), 'http://www.fshare.vn/logout.php')
  114.     If StringInStr($res[2], "login.php") <> 0 Then
  115.         addText("  -> Đã thoát.",$hListBox)
  116.         $loggedin = 0
  117.     Else
  118.         addText("[Lỗi] chưa thoát được khỏi fshare !",$hListBox)
  119.     EndIf
  120. EndFunc
  121.  
  122. ;Function Login to Fshare
  123. Func loginF()
  124.     $user = GUICtrlRead($txtAccEmail)
  125.     $pword = GUICtrlRead($txtAccPassword)
  126.     addText("[Fshare] Đăng nhập vào Fshare ...",$hListBox)
  127.     $res = getHTTP("https://www.fshare.vn/login.php?url_refe=https%3A%2F%2Fwww.fshare.vn%2Findex.php&login_useremail=" & URLEncode($user) & '&login_password=' & URLEncode($pword), mkCookies(),"https://www.fshare.vn/login.php",0, 1, 0)
  128.     $res = getHTTP("http://www.fshare.vn/", mkCookies())
  129.     If StringInStr($res[2], "logout.php") <> 0 Then
  130.         addText("  -> Đăng nhập thành công !",$hListBox)
  131.         If StringInStr($res[2], "VIP.gif") <> 0 Then
  132.             addText("  -> Tài khoản VIP ... OK !",$hListBox)
  133.             $loggedin = 1
  134.         Else
  135.             addText("  -> Không phải tài khoản VIP. Thoát khỏi Fshare ...",$hListBox)
  136.             logoutF()
  137.         EndIf
  138.  
  139.     Else
  140.         addText("  -> Đăng nhập thất bại, kiểm tra lại tk fshare",$hListBox)
  141.     EndIf
  142. EndFunc
  143.  
  144. ;function to parse links input
  145. Func parseLinks($input, $loggoutthen = 1)
  146.     ;$links = GUICtrlRead($input)
  147.     $links = StringReplace($input, @CRLF, " ")
  148.     $links = StringReplace($links, @TAB, " ")
  149.     $aLink = StringSplit($links, " ")
  150.     $hasfsharelinks = StringRegExp($links,'http:/(.*?)fshare.vn/(.*?)')
  151.  
  152.     If $hasfsharelinks = 1 Then
  153.         _GUICtrlButton_Enable($btnGetLink, False)
  154.         If $loggedin = 0 Then
  155.             ;Login to Fshare
  156.             loginF()
  157.         EndIf
  158.  
  159.         If $loggedin = 1 Then
  160.             For $x=1 To $aLink[0]
  161.                 If $loggedin = 1 Then
  162.                     $retry = 0
  163.                     parseLink($aLink[$x])
  164.                 EndIf
  165.             Next
  166.         EndIf
  167.  
  168.         If $loggoutthen = 1 And $loggedin = 1 Then
  169.             logoutF()
  170.         EndIf
  171.  
  172.         If $retry < 4 Then
  173.             addText("[OK] Đã xử lý xong tất cả các links !",$hListBox)
  174.         Else
  175.             addText("[Lỗi] trùng phiên đăng nhập quá 4 lần, vui lòng thử lại sau vài phút !",$hListBox)
  176.             $retry = 0
  177.         EndIf
  178.         _GUICtrlButton_Enable($btnGetLink, True)
  179.     Else
  180.         addText("[Lỗi] Không có link fshare trong danh sách link !",$hListBox)
  181.     EndIf
  182. EndFunc
  183.  
  184. ;function to get fshare download link
  185. Func parseLink($lnk)
  186.     $validLink = StringRegExp($lnk,'http:/(.*?)fshare.vn/file(.*?)')
  187.     $isfolder = StringRegExp($lnk,'http:/(.*?)fshare.vn/folder(.*?)')
  188.     If $validLink = 1 Then
  189.  
  190.  
  191.         If StringInStr($lnk, '|') <> 0 Then
  192.             ;$lnk = StringReplace($lnk, '*', '|')
  193.             $plink = StringSplit($lnk, '|')
  194.             $lnk = $plink[1]
  195.             $dlpw = $plink[2]
  196.         Else
  197.             $dlpw = ''
  198.         EndIf
  199.  
  200.         If StringInStr($lnk, '?') <> 0 Then
  201.             $plink = StringSplit($lnk, '?')
  202.             $slink = $plink[1]
  203.             addText("[Fshare] Lấy link cho file " & $slink & " ...",$hListBox)
  204.             $res = getHTTP($lnk, mkCookies(), $slink, 1, 1)
  205.         Else
  206.             $slink = $lnk
  207.             addText("[Fshare] Lấy link cho file " & $slink & " ...",$hListBox)
  208.             $res = getHTTP($lnk, mkCookies(), '', 1)
  209.         EndIf
  210.  
  211.  
  212.         If (StringInStr($res[2], "logout.php") <> 0) Or ($res[1] = 1) Then
  213.             $filesize = "unknown"
  214.             If $res[1] = 1 Then
  215.                 ;GUICtrlSetData($LinkInput,GUICtrlRead($LinkInput) & @CRLF & "Có redir đến " & $res[0])
  216.                 $size = InetGetSize($res[0])
  217.                 If $size > 1000000000 Then
  218.                         $filesize = Round($size/(1024^3),2) & " GB"
  219.                     ElseIf $size > 1000000 Then
  220.                         $filesize = Round($size/(1024^2),2) & " MB"
  221.                     ElseIf $size > 1000 Then
  222.                         $filesize = Round($size/(1024),2) & " KB"
  223.                     EndIf
  224.                 $listviewcontrols = arradd($listviewcontrols, GUICtrlCreateListViewItem($slink & "|" & $res[0] & "|" & $filesize, $iListView))
  225.                 $linklist = arradd($linklist, $res[0])
  226.                 $dllist = arradd($dllist, $slink)
  227.                 _GUICtrlButton_Enable($btnClearlinks, True)
  228.                 _GUICtrlButton_Enable($btnCopy, True)
  229.                 _GUICtrlButton_Enable($btnSendToIDM, True)
  230.                 addText("  -> Done.",$hListBox)
  231.             ElseIf StringInStr($res[2], "vip_package_bt.png") <> 0 AND StringInStr($res[2], "fshare.vn/vip") <> 0 Then
  232.                 $arr = StringRegExp($res[2], '<form action="(.*?)" method="post" name="frm_download">', 3)
  233.                 If UBound($arr) > 0 Then
  234.                     ;GUICtrlSetData($LinkInput,GUICtrlRead($LinkInput) & @CRLF & "Lấy được link download " & $arr[0])
  235.                     $size = InetGetSize($arr[0])
  236.                     If $size > 1000000000 Then
  237.                         $filesize = Round($size/(1024^3),2) & " GB"
  238.                     ElseIf $size > 1000000 Then
  239.                         $filesize = Round($size/(1024^2),2) & " MB"
  240.                     ElseIf $size > 1000 Then
  241.                         $filesize = Round($size/(1024),2) & " KB"
  242.                     EndIf
  243.                     $listviewcontrols = arradd($listviewcontrols, GUICtrlCreateListViewItem($slink & "|" & $arr[0] & "|" & $filesize, $iListView))
  244.                     $linklist = arradd($linklist, $arr[0])
  245.                     $dllist = arradd($dllist, $slink)
  246.                     _GUICtrlButton_Enable($btnClearlinks, True)
  247.                     _GUICtrlButton_Enable($btnCopy, True)
  248.                     _GUICtrlButton_Enable($btnSendToIDM, True)
  249.                     addText("  -> Done.",$hListBox)
  250.                 EndIf
  251.             ElseIf StringInStr($res[2], "vip_package_bt.png") <> 0 AND StringInStr($res[2], '<input type="text" name="link_file_pwd_dl"/>') <> 0 Then
  252.                 addText("  -> Link Download có mật khẩu ...",$hListBox)
  253.                 If StringInStr($res[2], '<ul class="message-error">') <> 0 Then
  254.                     $announce = 'Mật khẩu không đúng. Nhập lại ?'
  255.                 Else
  256.                     $announce = 'File này yêu cầu nhập mật khẩu để tải.'
  257.                 EndIf
  258.  
  259.                 if $dlpw = '' Then
  260.                     $filename = StringRegExp($res[2], '<p><b>(.*?):</b>(.*?)</p>', 3)
  261.                     $pos = WinGetPos($hGUI)
  262.                     $dlpw = InputBox("Mật khẩu", $slink & @CRLF & '-> ' & $filename[1] & @CRLF & @CRLF & $announce & ' Bỏ trống hoặc Cancel để bỏ qua link này. Nếu không nhập mật khẩu sau 15 giây sẽ tự động bỏ qua', '', '', - 1, 240, $pos[0]+200, $pos[1]+200, 15)
  263.                     If $dlpw = '' Then
  264.                         $err = '[Fshare] Bỏ qua link ' & $slink & ' -> unknown error !'
  265.                         Select
  266.                             Case @error = 0
  267.                                 $err = '[Fshare] Bỏ qua link ' & $slink & ' -> bởi người dùng'
  268.                             Case @error = 1
  269.                                 $err = '[Fshare] Bỏ qua link ' & $slink & ' -> bởi người dùng'
  270.                             Case @error = 2
  271.                                 $err = '[Fshare] Bỏ qua link ' & $slink & ' -> Timeout 15s'
  272.                         EndSelect
  273.                     EndIf
  274.                 EndIf
  275.  
  276.                 If $dlpw = '' Then
  277.                     addText($err ,$hListBox)
  278.                 Else
  279.                     $fileid = StringRegExp($res[2], '<input type="hidden" name="file_id" value="(.*?)"/>', 3)
  280.                     $newlnk = $lnk & '?action=download_file&file_id=' & $fileid[0] & '&link_file_pwd_dl=' & URLEncode($dlpw)
  281.                     parseLink($newlnk)
  282.                 EndIf
  283.             ElseIf StringInStr($res[2], '<ul class="message-error">') <> 0 Then
  284.                 addText("[Fshare][Lỗi] Có thể đang trùng phiên đăng nhập với người khác !",$hListBox)
  285.                 logoutF()
  286.                 addText(" -> Đợi xử lý lại sau 1 phút ...",$hListBox)
  287.                 $retry += 1
  288.                 If $retry < 4 Then
  289.                     Sleep(60000)
  290.                     loginF()
  291.                     parseLink($lnk)
  292.                 EndIf
  293.             Else
  294.                 addText("[Fshare] Error: No Download Link !",$hListBox)
  295.             EndIf
  296.         EndIf
  297.         Sleep(200)
  298.     ElseIf $isfolder = 1 Then
  299.         addText("[Fshare] Link " & $lnk & " là thư mục !",$hListBox)
  300.         $res = getHTTP($lnk, mkCookies(), '', 1)
  301.         If StringInStr($res[2], "fshare.vn/file/") <> 0 Then
  302.             $arr = StringRegExp($res[2], '<a href="(.*?)" target="_blank"><span class="filename">', 3)
  303.             addText("[Fshare] Có " & UBound($arr) & " file trong thư mục ...",$hListBox)
  304.             ;parseLinks(_ArrayToString($arr, " "), 0)
  305.             For $i = 0 To UBound($arr) - 1
  306.                 parseLink($arr[$i])
  307.             Next
  308.         Else
  309.             addText("[Fshare] Thư mục trống !",$hListBox)
  310.         EndIf
  311.     EndIf
  312. EndFunc
  313.  
  314. ;function to get/post http links
  315. Func getHTTP($lnk, $cookie = '', $refer = '', $ignorecookies = 0, $post = 0, $redir = 0)
  316.     $method = "GET"
  317.     $weblink = StringSplit($lnk, '?')
  318.     ;addText($weblink[2],$hListBox)
  319.     If $post = 1 Then
  320.         $method = "POST"
  321.         $linklink = $weblink[1]
  322.         $poststring = $weblink[2]
  323.     Else
  324.         $linklink = $lnk
  325.     EndIf
  326.  
  327.     $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
  328.     If $redir = 0 Then
  329.         $oHTTP.Option(6) = False
  330.     EndIf
  331.     $oHTTP.Open($method, $linklink , False)
  332.     $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0")
  333.     If StringLen($refer)>1 Then
  334.         $oHTTP.SetRequestHeader("Referer", $refer)
  335.     EndIf
  336.     If StringLen($cookie)>1 Then
  337.         $oHTTP.SetRequestHeader("Cookie", $cookie)
  338.     EndIf
  339.     If $post = 1 Then
  340.         $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  341.         $oHTTP.SetRequestHeader("Content-Length", StringLen($poststring))
  342.         $oHTTP.Send($poststring)
  343.     Else
  344.         $oHTTP.Send()
  345.     EndIf
  346.     $oHTTP.WaitForResponse
  347.     $HeaderResponses = $oHTTP.GetAllResponseHeaders()
  348.  
  349.     If $ignorecookies = 0 Then
  350.         ; Handle Cookies
  351.         $array = StringRegExp($HeaderResponses, 'Set-Cookie: (.+)\r\n', 3)
  352.         ;$cookies = ''
  353.         for $i = 0 to UBound($array) - 1
  354.             ; Add all cookies to a single string, and then clean it up.
  355.             $cook = $array[$i] & ';'
  356.             ; Removing parts we do not use..
  357.             $cook = StringRegExpReplace($cook, "( path| domain| expires)=[^;]+", "")
  358.             $cook = StringRegExpReplace($cook, " HttpOnly", "")
  359.             $cook = StringRegExpReplace($cook, "[;]{2,}", ";")
  360.  
  361.             $cook1 = StringSplit($cook,";")
  362.             For $k=1 To $cook1[0]
  363.                 If StringInStr($cook1[$k],"=") Then
  364.                     $cook2 = StringSplit(StringReplace($cook1[$k]," ", ""),"=")
  365.                     if $cookies[0][0] == "" Then
  366.                         $cookies[0][0] = $cook2[1]
  367.                         $cookies[0][1] = $cook2[2]
  368.                     Else
  369.                         $inserted = 0
  370.                         for $j = 0 to UBound($cookies) - 1
  371.                             If $cook2[1] == $cookies[$j][0] Then
  372.                                 $cookies[$j][1] = $cook2[2]
  373.                                 $inserted = 1
  374.                             ElseIf ($j == (UBound($cookies) - 1)) And ($inserted == 0) Then
  375.                                 ReDim $cookies[UBound($cookies) + 1][2]
  376.                                 $cookies[UBound($cookies) - 1][0] = $cook2[1]
  377.                                 $cookies[UBound($cookies) - 1][1] = $cook2[2]
  378.  
  379.                             EndIf
  380.                         Next
  381.                     EndIf
  382.                 EndIf
  383.             Next
  384.  
  385.         Next
  386.     EndIf
  387.  
  388.     Dim $ret[4]
  389.     If StringInStr($HeaderResponses, "Location:") <> 0 Then
  390.         $ret["0"] = $oHTTP.GetResponseHeader("Location")
  391.         $ret["1"] = 1
  392.     Else
  393.         $ret["0"] = ""
  394.         $ret["1"] = 0
  395.     EndIf
  396.     $ret["2"] = $oHTTP.Responsetext
  397.     ;$ret["method"] = $method
  398.     $ret["3"] = $oHTTP.GetAllResponseHeaders()
  399.  
  400.     Return $ret
  401. EndFunc
  402.  
  403. ;function to encode url for websurfing
  404. Func URLEncode($urlText)
  405.     $url = ""
  406.     For $i = 1 To StringLen($urlText)
  407.         $acode = Asc(StringMid($urlText, $i, 1))
  408.         Select
  409.             Case ($acode >= 48 And $acode <= 57) Or _
  410.                     ($acode >= 65 And $acode <= 90) Or _
  411.                     ($acode >= 97 And $acode <= 122)
  412.                 $url = $url & StringMid($urlText, $i, 1)
  413.             Case $acode = 32
  414.                 $url = $url & "+"
  415.             Case Else
  416.                 $url = $url & "%" & Hex($acode, 2)
  417.         EndSelect
  418.     Next
  419.     Return $url
  420. EndFunc
  421.  
  422. ;function to make cookies from array
  423. Func mkCookies()
  424.     $rt = ""
  425.     for $j = 0 to UBound($cookies) - 1
  426.         $rt = $rt & $cookies[$j][0] & "=" & $cookies[$j][1]
  427.         If $j <> (UBound($cookies) - 1) Then
  428.             $rt = $rt & "; "
  429.         EndIf
  430.     Next
  431.     Return $rt
  432. EndFunc
  433.  
  434. ;function to add element to array ( fuck autoit )
  435. Func arradd($array, $value)
  436.     If IsArray($array) Then
  437.         _ArrayAdd($array, $value)
  438.         Return $array
  439.     Else
  440.         Dim $rt[1] = [$value]
  441.         Return $rt
  442.     EndIf
  443. EndFunc
  444.  
  445. ;function to clear links list
  446. Func ClearLinks()
  447.     $linklist = 0
  448.     $dllist = 0
  449.     GUICtrlSetData($LinkInput,'')
  450.     For $i = 0 to UBound($listviewcontrols) - 1
  451.         GUICtrlDelete($listviewcontrols[$i])
  452.     Next
  453.     $listviewcontrols = 0
  454.     _GUICtrlButton_Enable($btnClearlinks, False)
  455.     _GUICtrlButton_Enable($btnCopy, False)
  456.     _GUICtrlButton_Enable($btnSendToIDM, False)
  457. EndFunc
  458.  
  459. ;function to send download links to IDM
  460. Func SendToIDM()
  461.     If UBound($linklist) > 0 Then
  462.         $clsid = "{AC746233-E9D3-49CD-862F-068F7B7CCCA4}"
  463.         $idd = "{4BD46AAE-C51F-4BF7-8BC0-2E86E33D1873}"
  464.         $desc = "SendLinkToIDM hresult(bstr;bstr;bstr;bstr;bstr;bstr;bstr;bstr;long);"
  465.         $idm = ObjCreateInterface($clsid,$idd,$desc)
  466.         For $i = 0 to UBound($linklist) - 1
  467.             $idm.SendLinkToIDM($linklist[$i], $dllist[$i], '', '', '', '','', '', 2)
  468.         Next
  469.         addText("[IDM] Đã gửi link download sang IDM",$hListBox)
  470.     EndIf
  471. EndFunc
  472.  
  473. ;function executing when clipboard changed
  474. Func CBmonitor($data)
  475.     If $data<>$lastCopied Then
  476.         $lastCopied=$data
  477.         $isfsharelink = StringRegExp($data,'http://(.*?)fshare.vn/file(.*?)')
  478.         $isfsharefolder = StringRegExp($data,'http://(.*?)fshare.vn/folder(.*?)')
  479.         If $isfsharelink = 1 Or $isfsharefolder = 1 Then
  480.             addText("[Clipboard Monitor] Đã lấy link fshare từ clipboard",$hListBox)
  481.             $ctb = GUICtrlRead($LinkInput)
  482.             If StringLen($ctb)>0 Then
  483.                 $ctb = $ctb & @CRLF
  484.             EndIf
  485.             GUICtrlSetData($LinkInput,$ctb & $data)
  486.         EndIf
  487.     EndIf
  488. EndFunc
  489.  
  490. ; GUI MESSAGE LOOP
  491. While 1
  492.     $msg = GUIGetMsg()
  493.     Select
  494.         Case $msg = $GUI_EVENT_CLOSE
  495.             ExitLoop
  496.         Case $msg = $btnGetLink
  497.             parseLinks(GUICtrlRead($LinkInput))
  498.         Case $msg = $btnClearlinks
  499.             ClearLinks()
  500.         Case $msg = $btnSendToIDM
  501.             SendToIDM()
  502.         Case $msg = $btnCopy
  503.             ;_ArrayToClip($linklist);
  504.             ClipPut(_ArrayToString($linklist, @CRLF))
  505.             addText("[Clipboard Monitor] Đã Copy Link vào clipboard",$hListBox)
  506.         Case $msg = $btnSaveAccInfo
  507.             saveAcc($txtAccEmail, $txtAccPassword,$f)
  508.     EndSelect
  509. WEnd
Add Comment
Please, Sign In to add comment