Juno_okyo

Get link Youtube by Juno_okyo

Oct 21st, 2014
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 2.11 KB | None | 0 0
  1. #region
  2. #AutoIt3Wrapper_UseUpx=Y
  3. #AutoIt3Wrapper_Compression=4
  4. #AutoIt3Wrapper_Icon=E:\wamp\www\favicon.ico
  5. #AutoIt3Wrapper_Res_Comment=Coded by Juno_okyo
  6. #AutoIt3Wrapper_Res_Description=Coded by Juno_okyo
  7. #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
  8. #AutoIt3Wrapper_Res_ProductVersion=1.0.0.0
  9. #AutoIt3Wrapper_Res_LegalCopyright=(c) 2014 by Juno_okyo's Blog
  10. #AutoIt3Wrapper_Res_Field=ProductName|Juno_okyo's Production
  11. #AutoIt3Wrapper_Res_Field=ProductVersion|1.0.0.0
  12. #AutoIt3Wrapper_Res_Field=CompanyName|J2TeaM
  13. #endregion
  14.  
  15. ; Includes
  16. #include <Misc.au3>
  17. #include <ButtonConstants.au3>
  18. #include <EditConstants.au3>
  19. #include <GUIConstantsEx.au3>
  20. #include <StaticConstants.au3>
  21. #include <WindowsConstants.au3>
  22. #include <Inet.au3>
  23.  
  24. ; Only One Instance
  25. _Singleton(@ScriptName)
  26.  
  27. ; Options
  28. #NoTrayIcon
  29. Opt('WinTitleMatchMode', 2)
  30. Opt('GUIOnEventMode', 1)
  31. Opt('GUICloseOnESC', 0)
  32.  
  33. ; Script Start - Add your code below here
  34. Global Const $API = 'http://fb-elly.rhcloud.com/youtube.php?v='
  35.  
  36. #Region ### START Koda GUI section ### Form=
  37. Global $FormMain = GUICreate("Get link Youtube by Juno_okyo", 423, 45, -1, -1)
  38. GUISetFont(12, 400, 0, "Arial")
  39. GUISetOnEvent($GUI_EVENT_CLOSE, "FormMainClose")
  40. Global $Label1 = GUICtrlCreateLabel("Video URL:", 5, 11, 85, 22)
  41. Global $Input1 = GUICtrlCreateInput("", 95, 8, 262, 26, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
  42. Global $Button1 = GUICtrlCreateButton("GET", 365, 8, 50, 25)
  43. GUICtrlSetCursor(-1, 0)
  44. GUICtrlSetOnEvent(-1, "Button1Click")
  45. GUISetState(@SW_SHOW)
  46. #EndRegion ### END Koda GUI section ###
  47.  
  48. While 1
  49.     Sleep(100)
  50. WEnd
  51.  
  52. Func Button1Click()
  53.     Local $videoID = GUICtrlRead($Input1)
  54.  
  55.     ;=> Check for Full URL
  56.     Local $test = StringRegExp($videoID, 'https?://(www\.)?youtube\.com/watch\?v=([A-z0-9]{10,12})', 1)
  57.     If Not @error Then $videoID = $test[1]
  58.  
  59.     Local $data = _INetGetSource($API & $videoID)
  60.     $data = StringSplit($data, @CRLF)
  61.     For $i = 1 To $data[0]
  62.         If $data[$i] = '' Then ContinueLoop
  63.         ConsoleWrite(@CRLF)
  64.         Local $temp = StringSplit($data[$i], '|')
  65.         ConsoleWrite($temp[1] & ' => ' & $temp[2] & @CRLF)
  66.     Next
  67. EndFunc
  68.  
  69. Func FormMainClose()
  70.     Exit
  71. EndFunc
Add Comment
Please, Sign In to add comment