?
Solved

Use Delphi to get YouTube url (or t parameter)

Posted on 2008-06-20
4
Medium Priority
?
2,491 Views
Last Modified: 2012-06-27
Hello everyone


Is there a way to get YouTube redirect video url

for example:
http://www.youtube.com/v/V3BsjxDZJM0

Above URL is used in YouTube embed-code. It is basically a server-side redirection that points to YouTube Player (.swf). Above redirects (server-side) to following URL:-

http://www.youtube.com/p.swf?video_id=V3BsjxDZJM0&eurl=&iurl=http%3A//sjc-
static12.sjc.youtube.com/vi/V3BsjxDZJM0/2.jpg&t=OEgsToPDskKzlTMEFZ1jOh40Xc3qOxzQ

Is it possible to get t parameter OEgsToPDskKzlTMEFZ1jOh40Xc3qOxzQ using Delphi?

Thanks

ZW
0
Comment
Question by:interdev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Alex earned 1000 total points
ID: 21837272
Use this function:

function GetUrl(Browser:String): String;
var
DdeClientConv:TDdeClientConv;
Temp :string;
URL :string;
Title :string;
begin
DdeClientConv:=TDdeClientConv.Create(Form1);
with DdeClientConv do
  begin
  // ConnectMode := ddeManual;

   if SetLink(Browser, 'WWW_GetWindowInfo' )then
         Temp:=RequestData('0xFFFFFFFF,sURL,sTitle');
    while Pos('"',Temp) > 0 do //(Single Double Single quotes)
         Delete(Temp,Pos('"',Temp),1); //Remove the quotes(Single Double Single quotes)

    URL:=Copy(Temp,1,Pos(',',Temp)-1); //Get URL
    Title:=Copy(Temp,Pos(',',Temp)+1,Length(Temp)); //Get title
    end;

DdeClientConv.Free;
Result := URL;
end;


... and then drop an editbox and a button and to button's click event paste this

 edit1.Text:=GetURL('IExplore');

if you are using firefox write:  edit1.Text:=GetURL('Firefox');
0
 
LVL 9

Expert Comment

by:Alex
ID: 21837279
This will give you the whole link that address bar has and then you can split the link after the "="
 character and get that you want.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This article will show, step by step, how to integrate R code into a R Sweave document
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question