Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Use Delphi to get YouTube url (or t parameter)

Posted on 2008-06-20
4
Medium Priority
?
2,507 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

604 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