Patrick, a quick note on this (not sending to list).
If I'm not mistaken, this quote from the YouTube TOS explicitly forbids
downloading videos unless there's a download link there, provided by
YouTube (as opposed to by a Greasemonkey script, for example):
> You may access User Submissions for your information and personal use
> solely as intended through the provided functionality of the YouTube
> Website. You shall not copy or download any User Submission unless you
> see a “download” or similar link displayed by YouTube on the YouTube
> Website for that User Submission.
So I suggest you avoid this sort of (apparently) unethical behavior.
On 2009-10-27 22:47, patrick wrote:
> Hi,
>
> I had a script that I got from openjs for downloading youtube videos,
> and it stopped working recently.. It appears that youtube changed
> their code a bit... I did some poking around and found the data that
> I need, and it all works fine----- in the console, not in
> greasemonkey.
>
> It's hard to tell exactly what youtube is doing, but I am suspecting
> they are doing their own sort of 'window.onload' event that happens
> after the actual window onload event, and creates their 'yt' class
> which holds the parameters that I am looking for. So, basically if I
> go to youtube, and in firebug I type:
>
> yt.config_.SWF_ARGS
>
> I get the params I need...
>
> But, if I put that same thing in a greasemonkey script, it says yt is
> undefined...
>
> So, I am just wondering, is there a way around this? I tried putting
> a timeout in the greasemonkey script, but that didn't help... Anyway,
> here is the code.
>
> (function() {
>
> setTimeout(function() { get_video() }, 5000);
>
> get_video = function() {
> console.log('yes');
> var swfArgs = yt.config_.SWF_ARGS;
> if (swfArgs) {
> var keys = ["video_id", "sk", "t"];
> var params = keys.map(function(k) { return k + "=" +
> swfArgs
> [k]; }).join("&");
>
> //Create the link
> var link = document.createElement('a');
> link.href= "http://www.youtube.com/get_video?" + params;
> var txt = document.createTextNode("Download this
> Video");
> link.appendChild(txt);
>
> document.getElementById('watch-player-div').appendChild(link);
> }
> }
>
> })();
> >
>
> ____________________________________________________________________________________
> The Best Rates on Insurance - Compare the Best Rates on Insurance in Less
> than 3 Mins. Get Insurance Quotes, Compare Plans, and Save Today! Type in
> Your Zip Code and We Will Match You With the Best Rates on Insurance.
> http://click.lavabit.com/?r=Nzk1NA==
> ____________________________________________________________________________________
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---