YouTube Video Download

By rossy! Last update Jan 10, 2013 — Installed 1,252,489 times.

Doesn't work in 'Cosmic Panda'

in
Subscribe to Doesn't work in 'Cosmic Panda' 10 posts, 7 voices



Delian Entchev User
ChromeWindows

This script doesn't work in Youtube's experimental version, which is a concern since this will most likely be implemented into Youtube soon:

www.youtube.com/cosmicpanda

 
Fofer User
SafariMacintosh

Yep, I came here to post the same thing. Would love to see this excellent script work in the Cosmic Panda version of YouTube… it's a much nicer way to interface with YouTube.

 
Kharg Scriptwright
ChromeWindows

It works for me =)

 
rossy! Script's Author
FirefoxWindows

It's been working in Cosmic Panda for me. Not on the channel pages yet, but it works fine on the watch pages.

 
BASiQ Scriptwright
FirefoxWindows

http://www.youtube.com/watch?v=WWhRNQPBXZg

gives me this
http://img37.imageshack.us/img37/8154/unledqli.png

BUT, the download function works just fine. Never had an issue there

Using Cosmic panda. Many pages give me this, annoying as hell, but as always, a free userscript means no complaining, just informing you of what I see =)

 
QuHno User
OperaWindows

That could be related to http://userscripts.org/topics/94662

 
SBscripts Scriptwright
FirefoxWindows

Tech speak warning: some parts of this message might be confusing for outsiders - check here for an instant solution :-)
I know what the problem is about: YT dynamically creates an iframe pointing to a javascript: url, in which it attempts to display an ad. Since web pages never get assigned javascript: urls as their location.href, but always the URL of the referring page, the script runs in the frame as well, breaking because - of course - there is no video in this <iframe></iframe>.

Screenshot


I've solved it with this code:Youtube Video Download script Insert this code below the function inject (after the } closing bracket, replace the first if statement with the one at the end of this code.
try{
	if(window.parent&&window.parent!==window&&window.location.href===window.parent.location.href){
		var is_no_frame=false;
	}else throw "";
}catch(ex){
	var is_no_frame=true;
}

if (host.substr(host.length - 11) == "youtube.com" && host != "m.youtube.com"&&is_no_frame) inject(function() {
This will stop the error from occurring.
 
QuHno User
OperaWindows

@SBscripts: Good catch. Applied the patch and it works fine. :)

 
SBscripts Scriptwright
FirefoxWindows

I've packed my fixes together and uploaded them to Dropbox, so if you don't want the hassle of fixing this yourself: download the script here.

 
BASiQ Scriptwright
FirefoxWindows

Thanks SB! Works gr8!