
[Enlace externo eliminado para invitados]
aca solo descarga de youtube y daylimotion
pero el programa (youtube-dl) es muy potente
codigo
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,shellapi,FileCtrl;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
ComboBox1: TComboBox;
Label2: TLabel;
Label3: TLabel;
Edit2: TEdit;
Label4: TLabel;
Button2: TButton;
SaveDialog1: TSaveDialog;
Label5: TLabel;
ComboBox2: TComboBox;
Button3: TButton;
Label6: TLabel;
Button4: TButton;
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
var
s,d:string;
begin
{IF SAVEDIALOG1.EXECUTE THEN
EDIT2.Text:=SAVEDIALOG1.FILENAME
ELSE
BEGIN
END;}
SelectDirectory('Seleccionar directorio','',s);
s:= s+'\';
d := StringReplace(s, '\\', '\',[rfReplaceAll, rfIgnoreCase]);
edit2.text:=d;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
str,file1,file2:string;
begin
str:=ExtractFilePath(Application.ExeName);
file1:=(str+'binarios\youtube-dl.exe');
if fileexists(file1) )then begin
end
else
begin
showmessage ('archivos no se encuentran'+#13#10+
'en el directorio binarios'#13#10+
'cerrando aplicacion');
Application.Terminate;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
str, calidad,parametros, file1:string;
begin
str:=ExtractFilePath(Application.ExeName);
file1:=(str+'binarios\youtube-dl.exe');
if combobox1.ItemIndex=0 then
calidad:='136';
if combobox1.ItemIndex=1 then
calidad:='137';
//el audio seria predefinido por el momento
parametros:=' -f '+calidad+'+140 '+edit1.text +' -o "'+ edit2.text+'%(title)s.%(ext)s"' ;
//showmessage(parametros);
ShellExecute(handle, 'open', pchar(file1), pchar(parametros), nil, SW_SHOWNORMAL) ;
end;
procedure TForm1.Button3Click(Sender: TObject);
var
str, calidad,parametros, file1:string;
begin
str:=ExtractFilePath(Application.ExeName);
file1:=(str+'binarios\youtube-dl.exe');
if combobox2.ItemIndex=0 then
calidad:='240';
if combobox2.ItemIndex=1 then
calidad:='380';
if combobox2.ItemIndex=2 then
calidad:='480';
if combobox2.ItemIndex=3 then
calidad:='720';
//el audio seria predefinido por el momento
parametros:=' -f '+calidad+' '+edit1.text +' -o "'+ edit2.text+'%(title)s.%(ext)s"' ;
//showmessage(parametros);
ShellExecute(handle, 'open', pchar(file1), pchar(parametros), nil, SW_SHOWNORMAL) ;
end;
end.