Wow

So for any one wanting to Download off YouTube here is some code.
I have an addon in Firefox that grabs the video automatically from the page when I click a button :-D
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
So for any one wanting to Download off YouTube here is some code.
I have an addon in Firefox that grabs the video automatically from the page when I click a button :-D

whats the addon ? I have IE7, FireFox and Opera on my system so I could use this.

stil it was interesting looking for a way to DO THIS :)
 
Ivan

You can do anything. I was in your sight that brought me here to get the code to download youtube. I get errors. I don't know why but, it happens alot. Maybe you can have a sample file. I really would love to make this work but I can't figure it out. Please Ivan Helpppp Meeeee

Set objIE = New InternetExplorer 'user-defined type not defined

READYSTATE_COMPLETE 'variable not defined.

Loop .loop without Do

Replace(strVideoUrl, "amp;", "", 1) 'Sub or Function not defined

strVideoUrl = "http://youtube.com/get_video?video_id=" & 'Replace(strVideoUrl, "amp;", "", 1) 'Syntax error.
 
Re: Ivan

You can do anything. I was in your sight that brought me here to get the code to download youtube. I get errors. I don't know why but, it happens alot. Maybe you can have a sample file. I really would love to make this work but I can't figure it out. Please Ivan Helpppp Meeeee

Set objIE = New InternetExplorer 'user-defined type not defined

READYSTATE_COMPLETE 'variable not defined.

Loop .loop without Do

Replace(strVideoUrl, "amp;", "", 1) 'Sub or Function not defined

strVideoUrl = "http://youtube.com/get_video?video_id=" & 'Replace(strVideoUrl, "amp;", "", 1) 'Syntax error.

Hi gsouza

PM me, it's easier and I'll email the workbook ......

Basically you need a reference to

"Microsoft Internet Controls" = SHDOCVW.DLL
and
"Microsoft HTML Object Library" = MSHTML.tlb

Excel 2003 on Win XP
 
I had a problem with Ivan's code. This line:

PosLastID = InStr(1, strCode, "&sk=")

returned 0 for PosLastID, because "&sk=" isn't present in the innerHTML of the page (I checked). Instead I used this:

Code:
    '// Find position of VideoID
    PosVideoID = InStr(1, strCode, "amp;video_id")
    
    '// Find position of end of videoID
    PosLastID = InStr(PosVideoID, strCode, "&")

and eventually I got a strVideoURL of
http://youtube.com/get_video?video_id=7SJGDG5GZ2c

but I got an error message that IE couldn't download the video from youtube. Does this look like the right form of strVideoURL?

Note: clicking on the link above to strVideoURL led to "HTTP 404 Not Found".
 
Kristy.. Finally got around to watching it... I admit it's quite good, but I have to say... That is a sound that should NEVER come from a man.
 

Forum statistics

Threads
1,222,690
Messages
6,167,666
Members
452,130
Latest member
IRSHAD07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top