GameOveR-xD Posted March 17, 2017 Share Posted March 17, 2017 https://github.com/rg3/youtube-dl Linkteki program için küçük bir GUI yapmak istedim ama bir türlü CMD'ye komut gönderemiyorum. Program Arayüzü https://cdn.discordapp.com/attachments/256383666647859200/292310847923945473/unknown.png Arayüzdeki kodları alarak "Start Download" butonuna tıkladığımda cmd ye ilgili kodları yazıp çalıştıracak. Ama bi türlü yapamadım. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $MyGUI = GUICreate("Youtube-DL GUI", 576, 276, -1, -1) $Link = GUICtrlCreateGroup("Link", 19, 16, 537, 57) $LinkInput = GUICtrlCreateInput("", 29, 38, 521, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $ExtraCodes = GUICtrlCreateGroup("Extra Codes", 19, 81, 537, 57) $ExtraCodesInput = GUICtrlCreateInput('-o "C:\Users\X\Videos\YoutubeDLG/%(playlist)s/%(playlist_index)s. %(title)s.%(ext)s" --sub-lang en,tr --write-sub --write-auto-sub --convert-subtitles srt --continue --ignore-errors --embed-subs -f "299+bestaudio[ext=m4a]/137+bestaudio[ext=m4a]/37/298+bestaudio[ext=m4a]/22/136+bestaudio[ext=m4a]/135+bestaudio[ext=m4a]/59/78/134+bestaudio[ext=m4a]/18/133+bestaudio[ext=m4a]/160+bestaudio[ext=m4a]" --add-metadata --merge-output-format mp4', 29, 99, 521, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label1 = GUICtrlCreateLabel("Playlist Start Number : ", 24, 160, 110, 17) $PlaylistStart = GUICtrlCreateInput("", 144, 160, 100, 21) $Label2 = GUICtrlCreateLabel("Playlist End Number : ", 288, 160, 107, 17) $PlaylistEnd = GUICtrlCreateInput("", 408, 160, 100, 21) $Download = GUICtrlCreateButton("Start Download !", 92, 212, 150, 25) $PlaylistGrabber = GUICtrlCreateButton("Playlist Grabber", 328, 216, 150, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $PlaylistGrabber Shellexecute("https://fiddle.jshell.net/zw91w633/3/show/") Case $Download ShellExecute(@ComSpec,' "C:\Youtube-DL\youtube-dl.exe" ' & GUICtrlRead($LinkInput) & ' ' & GUICtrlRead($ExtraCodesInput) & ' ' & GUICtrlRead($PlaylistStart) & ' ' & GUICtrlRead($PlaylistEnd), @SystemDir, "runas") EndSwitch WEnd Quote Link to comment Share on other sites More sharing options...
Bultar Posted March 17, 2017 Share Posted March 17, 2017 ilgili kodları sanırım Case $PlaylistGrabber Shellexecute("https://fiddle.jshell.net/zw91w633/3/show/") Çok anlamasamda bu şekilde bir satırı cmd ile çalıştırmaya kalkarsan hiçbirşey elde edemezsin ki ? Zannedersem ilgili sayfada birşey çalıştırıp oradan gelecek olan cevabı yakalayıp youtube-dl.exe nin sonuna parametreler olacak şekilde aktarmaya çalışıyorsun da.. yolu bu değildir bunun.. Hiç değilse komut satırına yazacağın öyle bir satırla web sayfasından birşey elde edebilmen mümkün değildir diye düşünüyorum. Quote Link to comment Share on other sites More sharing options...
GameOveR-xD Posted March 17, 2017 Author Share Posted March 17, 2017 4 dakika önce, Bultar yazdı: ilgili kodları sanırım Case $PlaylistGrabber Shellexecute("https://fiddle.jshell.net/zw91w633/3/show/") Çok anlamasamda bu şekilde bir satırı cmd ile çalıştırmaya kalkarsan hiçbirşey elde edemezsin ki ? Zannedersem ilgili sayfada birşey çalıştırıp oradan gelecek olan cevabı yakalayıp youtube-dl.exe nin sonuna parametreler olacak şekilde aktarmaya çalışıyorsun da.. yolu bu değildir bunun.. Hiç değilse komut satırına yazacağın öyle bir satırla web sayfasından birşey elde edebilmen mümkün değildir diye düşünüyorum. Hayır o kod siteyi açmak için, ben onu farklı bir şey için yapmıştım programa ekledim. Playlistteki tüm linkleri sıralı bir şekilde çıkarabilmek için. O kod düzgün çalışıyor zaten. Beni ilgilendiren kısım şu; Case $Download GUI den aldığı kodları cmd ye girip indirme yapacak. Ben ne yaptıysam cmd ekranına yazdıramadım kodları. Örnek cmd kodu (Bunu ilgili kısımları programdaki arayüzden alıp cmd ile çalıştırmasını istiyorum); youtube-dl -o "C:\Users\X\Videos\YoutubeDLG/%(playlist)s/%(playlist_index)s. %(title)s.%(ext)s" --sub-lang en,tr --write-sub --write-auto-sub --convert-subtitles srt --continue --ignore-errors --embed-subs -f "299+bestaudio[ext=m4a]/137+bestaudio[ext=m4a]/37/298+bestaudio[ext=m4a]/22/136+bestaudio[ext=m4a]/135+bestaudio[ext=m4a]/59/78/134+bestaudio[ext=m4a]/18/133+bestaudio[ext=m4a]/160+bestaudio[ext=m4a]" --add-metadata --merge-output-format mp4 Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted March 17, 2017 Share Posted March 17, 2017 $Param = "youtube-dl -o " & '"' & "C:\Users\X\Videos\YoutubeDLG/%(playlist)s/%(playlist_index)s. %(title)s.%(ext)s" & '"' $Param &= " --sub-lang en,tr --write-sub --write-auto-sub --convert-subtitles srt --continue --ignore-errors --embed-subs " $Param &= "-f " & '"' & "299+bestaudio[ext=m4a]/137+bestaudio[ext=m4a]/37/298+bestaudio[ext=m4a]/22/136+bestaudio[ext=m4a]/135+bestaudio[ext=m4a]/59/78/134+bestaudio[ext=m4a]/18/133+bestaudio[ext=m4a]/160+bestaudio[ext=m4a]" & '"' $Param &= " --add-metadata --merge-output-format mp4" ShellExecute(@ComSpec, "/C " & $Param, @ScriptDir) 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.