YouTube Ve Delphi

Delphi'de kod yazma ile ilgili sorularınızı bu foruma yazabilirsiniz.
Cevapla
esrehmaan

YouTube Ve Delphi

Mesaj gönderen esrehmaan »

Merhabalar arkadaşlar,


Delphide direk olarak youtubeye video yollamam lazım

Böyle bir açıklama var http://code.google.com/intl/tr-TR/apis/ ... ading.html

bide

Kod: Tümünü seç

function UploadVideoFile1(strAuth, strTtitle, strDescription, strCateqory, strUsername,
  strKeyWords, strFilename, strSourcefile: String): Boolean; //上传视频
var
  ssRet, ssTmp, ssTmpp: TStringStream;
  fsTmp, fsTmpp: TFileStream;
  ihTmp: TIdHTTP;
  iisTmp: TIdSSLIOHandlerSocket;
  slTmp, slTmpp: TStringList;
  I: Integer;
  msTmp: TMemoryStream;
begin
  iisTmp := TIdSSLIOHandlerSocket.Create(nil);
  ssRet := TStringStream.Create('');
  ssTmp := TStringStream.Create('');
  ssTmpp := TStringStream.Create('');
  msTmp := TMemoryStream.Create;
  ihTmp := TIdHTTP.Create(nil);
  slTmpp := TStringList.Create;
  try
  iisTmp.SSLOptions.Method := sslvSSLv3;

  with ssTmp do
  begin
  WriteString('POST /feeds/api/users/default/uploads HTTP/1.1');
  WriteString('Host: uploads.gdata.youtube.com');
  WriteString('Authorization: GoogleLogin auth=' + strAuth);
  WriteString(GdataClient);
  WriteString(GdataKey);
  WriteString('Slug: ' + ExtractFileName(strSourcefile));
  WriteString('Content-Type: multipart/related; boundary=--f93dcbA3');
  WriteString('Content-Length: ' + IntToStr(FileSizeByName(strSourcefile) * 8));

  WriteString('--f93dcbA3');
  WriteString('Content-Type: application/atom+xml; charset=UTF-8');
  end;
  fsTmp := TFileStream.Create(ExtractFilePath(Application.ExeName) + 'test.xml', fmOpenRead);
  slTmpp.LoadFromFile(ExtractFilePath(Application.ExeName) + 'b-t.txt');
  with ssTmpp do
  begin
  WriteString('--f93dcbA3');
  WriteString('Content-Type: video/3gp');
  WriteString('Content-Transfer-Encoding: binary');
  //AddObject(strSourcefile, nil);
  WriteString(slTmpp.Text);
  WriteString('--f93dcbA3--');
  //WriteString('Connection: close');
  WriteString('Connection: keep-alive');
  end;
  //msTmp.LoadFromStream(ssTmp);
  with msTmp do
  begin
  LoadFromStream(ssTmp);
  LoadFromStream(fsTmp);
  LoadFromStream(ssTmpp);
  //CopyFrom(fsTmp, fsTmp.Size);
  // CopyFrom(ssTmpp, ssTmpp.Size);
  end;

  try
  ihTmp.IOHandler := iisTmp;
  ihTmp.ProtocolVersion := pv1_1;
  ihTmp.ReadTimeout := 15000;
  ihTmp.Post('http://uploads.gdata.youtube.com/feeds/api/users/' + strUsername + '/uploads', msTmp, ssRet);
  except
  On E: Exception do
  begin
  ShowMessage(E.Message);
  end;
  end;

  I := ihTmp.ResponseCode;
  finally
  ShowMessage(IntToStr(I));
  ShowMessage(ssRet.DataString);
  ihTmp.Disconnect;
  ihTmp.Free;
  iisTmp.Free;
  ssRet.Free;
  ssTmp.Free;
  ssTmpp.Free;
  msTmp.Free;
  slTmpp.Free;
  end;
end;

böyle bir kod buldum ama ne yazıkki çalıştıramadım yardımcı olabilirmisiniz ?
bocek
Üye
Mesajlar: 25
Kayıt: 01 May 2011 07:51
Konum: İstanbul, Antalya

Re: YouTube Ve Delphi

Mesaj gönderen bocek »

Youtube Data Api Burada mevcut.

http://code.google.com/intl/tr-TR/apis/ ... ading.html

Kaynak kodları karşılaştırınız.
esrehmaan

Re: YouTube Ve Delphi

Mesaj gönderen esrehmaan »

Hocam bende vermiştim verdiğiniz linki ama bir türlü beceremedim.
Cevapla