Using Greasemonkey scripts to download flash video
Does anyone know about Greasemonkey? Today I was just surfing for some new Firefox addons and came across Greasemonkey 0.8.20090123.1. According to the site, it says it allows you to customize the way a webpage displays using small JavaScript. So does that mean that I can download flash videos safely from Youtube kind of sites? If yes then can you provide me some script that works for me?
Re: Using Greasemonkey scripts to download flash video
Greasemonkey is a Firefox add-on that allows users to install scripts that make changes to most HTML-based web pages. As Greasemonkey scripts are persistent, the changes made to the web pages are executed every time the page is opened, making them effectively permanent for the user running the script. Greasemonkey can be used for adding new functions to web pages, fixing rendering bugs, combining data from multiple webpages, and numerous other purposes.
Greasemonkey user scripts are written in JavaScript with limitations and manipulate the contents of a web page using the Document Object Model interface. Scripts are site-specific and written by hand. Writing a Greasemonkey script is similar to writing JavaScript for a web page, with some additional restrictions imposed by the security provisions of Mozilla's XPCNativeWrappers.
Source: wikipedia
Re: Using Greasemonkey scripts to download flash video
The Greasemonkey script given below creates a hyperlink on the top of the webpage to save YouTube and other online video's on local machine. Just follow the below steps:
1. Install Greasemonkey Extension for Firefox.
2. Go to Website for which you want to download the video.
3. Install this script:
Code:
// ==UserScript==
var download_url = 'http://website_name/link_of_video';
var playerDiv = document.getElementById('movie_player');
var t_id = playerDiv.src.match(/t=([^(\&|$)]*)/)[1];
var url_vars = window.location.href.split("?")[1];
var video_id = url_vars.match(/v=([^(\&|$)]*)/)[1];
var video_url = download_url + video_id + '&t=' + t_id;
// add banner with download link
var my_banner = document.createElement("div");
my_banner.innerHTML = '<div style="border-bottom: 1px solid #CCCCCC; margin-bottom: 10px; font-size: small; background-color: #FF0000; color: #FFFFFF;">' +
'<p style="margin:0px;padding: 5px;text-align:center;">' +
'<a href="' + video_url + '" style="color:#FFFFFF; font-weight:bold; font-size:10px;">"Save As" to download Flash video</a>' +
'</p></div>';
document.body.insertBefore(my_banner, document.body.firstChild);
document.body.style.margin = '0px';
4. Refresh web browser page to see "Save As" link
Re: Using Greasemonkey scripts to download flash video
Hey thanks deveritt for that script. It works great. Many a times I came across some cool videos on YouTube and many other streaming sites which attracted me to download them on my computer. I have tried your script with YouTube and it worked very great. I was able to download some awesome videos from YouTube and was able to share it with my friends. Thanks a lot.
Re: Using Greasemonkey scripts to download flash video
Deveritt,
This appears to work, as in the installed script says it's running in the greasemonkey drop down. but the save as link does not appear. Where is it meant to be on the page?
Re: Using Greasemonkey scripts to download flash video
Quote:
Originally Posted by
Ojaybee
Deveritt,
This appears to work, as in the installed script says it's running in the greasemonkey drop down. but the save as link does not appear. Where is it meant to be on the page?
Which browser are ou using? You need to install Greasemonkey Extension for Firefox and then go to the YouTube and use the above script. After that right click on the script link, and click Install User Script and lastly reload YouTube Video page, you should see the save as link on the top of the page. Hope that helps.