Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Make something awesome ****
- #AutoIt3Wrapper_Icon=icon.ico
- #AutoIt3Wrapper_Outfile=YoutubeToMp3.exe
- #AutoIt3Wrapper_Compression=0
- #AutoIt3Wrapper_UseX64=n
- #AutoIt3Wrapper_Res_Comment=My Autoit Project..
- #AutoIt3Wrapper_Res_Description=AutoitTutorial
- #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
- #AutoIt3Wrapper_Res_LegalCopyright=autoittutorial123@gmail.com
- #EndRegion ;**** Make something awesome ****
- #include <_httprequest.au3>
- #include <string.au3>
- $url = InputBox('YoububeToMp3','Type url video...')
- if @error Then Exit
- YoububeToMp3($url)
- Func YoububeToMp3($url,$dir=@ScriptDir,$type='mp3')
- $id = _StringBetween($url,'watch?v=','')[0]
- $oIE = _httprequest(2,'https://www.download-mp3-youtube.com/api/?api_key=MzQ3NzQzNDYz&format='&$type&'&video_id='&$id)
- $link = _StringBetween($oIE,'src="','"')[0]
- $oIE = _httprequest(2,$link)
- $name = _StringBetween($oIE,'<div class="buttonTitle">','</div>')[0]
- $oIE =_StringBetween($oIE,'id="downloadButton" href="','"')[0]
- $linkdowload = 'https://www.convertmp3.io'&$oIE
- ProgressOn('', 'Downloading '&$name&'.'&$type, '0%')
- Local $BinaryData = _HttpRequest(3, $linkdowload, '', '', '', '', '', ProgressFunc)
- If @error Then
- MsgBox(16,'Error',"Couldn't download file!!")
- Exit
- EndIf
- ProgressOff()
- _HttpRequest_Test($BinaryData, $dir & '\'&$name&'.'&$type,Default,False)
- EndFunc
- Func ProgressFunc($NowSize, $TotalSize)
- $iPercent = Round(100 * $NowSize / $TotalSize, 2)
- ProgressSet ($iPercent, $iPercent & '%', 'Downloading...' & Round($NowSize / (1024 ^ 2), 2) & 'Mb')
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment