Sign in to follow this  
Followers 0
Gerald

Youtube Dl converter to mp3

4 posts in this topic

ok be for i start i made a simple program called Youtube Downloder [Convert to Mp3]

her is my code

#include <GUIConstants.au3>

#include <inet.au3>

#include <String.au3>

#Region ### START Koda GUI section ### Form=D:\SAVE\project code\project tubes\Form1.kxf

$Form1 = GUICreate("Youtube Downloder [Convert to Mp3]", 366, 201, 322, 255)

GUISetIcon("D:\004.ico")

GUISetBkColor(0xFFFFFF)

$GroupBox1 = GUICtrlCreateGroup("", 8, 1, 265, 169)

$Pic1 = GUICtrlCreatePic("D:\SAVE\project code\project tubes\banner.JPG", 16, 8, 252, 100)

$DwnInput = GUICtrlCreateInput(", 88, 112, 169, 21)

$Label2 = GUICtrlCreateLabel("Youtube Link:", 16, 112, 70, 17)

$Label1 = GUICtrlCreateLabel("Label1", 16, 144, 244, 17)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$start = GUICtrlCreateButton("Download", 286, 11, 75, 25, 0)

$abb = GUICtrlCreateButton("Abort", 285, 44, 75, 25, 0)

$Button3 = GUICtrlCreateButton("&Help", 285, 76, 75, 25, 0)

$Progress = GUICtrlCreateProgress(8, 176, 262, 16)

$Label3 = GUICtrlCreateLabel("", 272, 176, 92, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $start

_download_this_url()

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Func _download_this_url()

$you_url = GUICtrlRead($DwnInput)

If Not StringInStr($you_url, "youtube.com") Then Return MsgBox(0, "Error!", "The url isn't a valid youtube URL")

_getfsss()

EndFunc

Func _getfsss()

;~ Local

$dwnlink = GUICtrlRead($DwnInput)

$sCode = _INetGetSource($dwnlink)

ClipPut($sCode); just to check..

;; "t": "OEgsToPDskJOopRxreEOxLNeAGScKiLK", "plid"

;MsgBox(0,"",$sCode)

$t_code = _StringBetween($sCode, '"t": ', ' ')

If @error <> 1 Then

$t_Value = StringReplace($t_code[0], '"', "");

$t_Value = StringReplace($t_Value, ',', "");

; MsgBox(0, "", $t_Value)

EndIf

$s_v = StringMid($dwnlink, StringInStr($dwnlink, "v=") + 2)

$save = FileSaveDialog("Name of the video", "", "Flash(*.flv)", -1, $s_v)

If @error Then

MsgBox(4096,"","No File(s) chosen")

Else

$save = StringReplace($save, "|", @CRLF)

MsgBox(4096,"","You chose " & $save)

EndIf

If StringRight($save, 4) <> ".flv" Then

$save &= ".flv"

_Download("http://youtube.com/get_video?video_id=" & $s_v & "&t=" & $t_Value, $save, $Progress)

$soutput = "flv"

$c = "ffmpeg.exe -i " & '"' & $save & '"' & " -acodec " & $soutput & " -s 320x240 -b 50 -ar 22050 -ab 56 -ac 1 " & '"' & $save & ".wmv" & '"' ;

MsgBox(0, "", $c)

ClipPut($c);

RunWait($c, @ScriptDir, @SW_MAXIMIZE)

EndIf

EndFunc

;By GtaSpider

Func _Download($site, $punkt, $prog = 0)

GUICtrlSetData($Label1, "Download pls w8")

$orisize = InetGetSize($site)

InetGet($site, $punkt, 1, 1)

If $prog = 0 Then ProgressOn("Download", "")

Do

$msg = GUIGetMsg()

If $msg = $abb Then

If MsgBox(4, "Youtube Downloder [Convert to Mp3]", "Abort?") = 6 Then Exit

EndIf

$size1 = FileGetSize($punkt)

$MBsize1 = FileGetSize($punkt)

;$Prozent = $size1 / $orisize * 100

$inetget = @InetGetBytesRead

$Prozent = (100 * $inetget) / $orisize

$decimalplace = Round($Prozent)

$decimalplaceMBsize1 = Round(@InetGetBytesRead / 1024)

GUICtrlSetData($Label3, $decimalplaceMBsize1&"/Bytes")

If $prog = 0 Then

ProgressSet($Prozent, $decimalplace & "% " & "(" & $decimalplaceMBsize1 & ") Kb has been Downloaded.")

Else

GUICtrlSetData($prog, $Prozent)

EndIf

Until @InetGetActive = 0

If $prog = 0 Then ProgressOff()

Return $punkt

EndFunc ;==>_Download

my problem is the converter after download the video

still no response to convert they did not convert the .flv file

can some one help me ASAP

Share this post


Link to post
Share on other sites



What do you plan to do with the MP3 file after you convert it?

my plan after convert the flv to mp3 they will save in FileSaveDialog ex. he save on desktop also the mp3 file save in desktop read my code and add some new plss

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0