Jump to content
Son zamanlarda artan kullanıcı hesap hırsızlıkları sebebiyle tüm kullanıcılara şifre sıfırlama maili gönderilmiştir. Lütfen güveli şifreler seçiniz. Mevcut e-mail adresinize erişemiyorsanız, en aşağıdaki destek linkinden bize ulaşınız. ×

Shellexecute Ile Cmd Komut çalıştırma


GameOveR-xD
 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 

 

 

Link to comment
Share on other sites

$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)

 

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...