phatjk

Youtube To Mp3

Aug 25th, 2018
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.52 KB | None | 0 0
  1. #Region ;**** Make something awesome ****
  2. #AutoIt3Wrapper_Icon=icon.ico
  3. #AutoIt3Wrapper_Outfile=YoutubeToMp3.exe
  4. #AutoIt3Wrapper_Compression=0
  5. #AutoIt3Wrapper_UseX64=n
  6. #AutoIt3Wrapper_Res_Comment=My Autoit Project..
  7. #AutoIt3Wrapper_Res_Description=AutoitTutorial
  8. #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
  9. #AutoIt3Wrapper_Res_LegalCopyright=autoittutorial123@gmail.com
  10. #EndRegion ;**** Make something awesome ****
  11. #include <_httprequest.au3>
  12. #include <string.au3>
  13. $url = InputBox('YoububeToMp3','Type url video...')
  14. if @error Then Exit
  15. YoububeToMp3($url)
  16. Func YoububeToMp3($url,$dir=@ScriptDir,$type='mp3')
  17. $id = _StringBetween($url,'watch?v=','')[0]
  18. $oIE = _httprequest(2,'https://www.download-mp3-youtube.com/api/?api_key=MzQ3NzQzNDYz&format='&$type&'&video_id='&$id)
  19. $link = _StringBetween($oIE,'src="','"')[0]
  20. $oIE = _httprequest(2,$link)
  21. $name = _StringBetween($oIE,'<div class="buttonTitle">','</div>')[0]
  22. $oIE =_StringBetween($oIE,'id="downloadButton" href="','"')[0]
  23. $linkdowload = 'https://www.convertmp3.io'&$oIE
  24. ProgressOn('', 'Downloading '&$name&'.'&$type, '0%')
  25. Local $BinaryData = _HttpRequest(3, $linkdowload, '', '', '', '', '', ProgressFunc)
  26. If @error Then
  27. MsgBox(16,'Error',"Couldn't download file!!")
  28.    Exit
  29. EndIf
  30. ProgressOff()
  31. _HttpRequest_Test($BinaryData, $dir & '\'&$name&'.'&$type,Default,False)
  32. EndFunc
  33. Func ProgressFunc($NowSize, $TotalSize)
  34. $iPercent = Round(100 * $NowSize / $TotalSize, 2)
  35. ProgressSet ($iPercent, $iPercent & '%', 'Downloading...' & Round($NowSize / (1024 ^ 2), 2) & 'Mb')
  36. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment