Go Back   Google Chrome Forums > Google Chrome > Chrome Plugins


http://chromeplugins.org/frwrdicon.jpg
Top Tip : Click here to Boost Your PC & Chrome Browsing Speed
Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2009, 02:46 AM
Waha's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Oregon
Posts: 604
Default Extensible Video downloader

I started this project before the YouTube one was released, I'm totally not trying to reinvent the wheel here. >< However I continued the project because I designed it to be extensible to download from almost any website without having to make an entirely new extension.
Currently the only video sites I could figure out and implemented are YouTube.com and Break.com, if you know how to get the .flv from other sites, feel free to post how! (Or write the descriptor yourself and post that.)

The descriptor isn't very simple..sorry, I tried to make it as simple as I could. The basic idea is to take a value from the page, url, javascript, a different downloaded page, etc, and use regex to truncate it (if necessary) and plop it into the final URL for the flv. ie. newurl = data.replace(regex,url);
There's a lot of options for getting the data, which are all explained in the grabber.js file for those of you daring enough to make your own.
I will explain YouTube's descriptor here to help out though:
Code:
video["*.youtube.com/watch"] = new Array(
new Array("js:swfArgs['video_id']","js:swfArgs['t']"),
new Array(/(.*)/,/(.*)/),"http://youtube.com/get_video?video_id=$1&t=$2",
"silver","id:watch-vid-title");
Firstly video is the array of descriptors.

*.youtube.com/watch is the url pattern to run this descriptor against the page (mini greasemonkey! O: ). It's excruciatingly limited and complexly built because it's an index. There is a thorough description in the .js file. But basically, the *. says it's active for all sub domains, the youtube.com says it's active on youtube.com (duh) the / says there's a specific directory this can only be run in, and watch is that directory.

The first array set are the objects, what isolates the data. You can have as many of these as necessary so long as you have a regex expression for each one (that's the second array set).

js:swfArgs['video_id'] js: denotes that we're looking at a javascrpt variable defined on the page for this data, swfArgs['video_id'] is the variable to look at. This returns the value of swfArgs['video_id']. I think you can figure out the second one.

Its matching regex is /(.*)/, which means "remember all" in regex, meaning we're going to be using the whole value in the url string.

http://youtube.com/get_video?video_id=$1&t=$2 is the url string, $1 and $2 are where the values retrieved from the data goes. $1 is the first one (js:swfArgs['video_id']) and $2 is the second (js:swfArgs['t']).

The last two are the graphical part of it, silver is the name of the button used, you can define more buttons in the buttons array, which is explained in the .js, and I won't do it here.

id:video_wrap is where it will place the button on the page, id: means video_wrap is the id of the DOM object we're appending the button child to. (Appending - which means it will be going to the end of that object, so if the swf flv player is in that same object, it will go below or to the right of the swf
flv player.)

If you have any questions, please ask. I'll be happy to help.

Download it here:
http://logicplace.com/pc/projects/ch...%20grabber.crx

UPDATE 1.1:
* Added support for: blip.tv, clipshack.com, and four AO sites.
* Improved page download and custom function support
* Bug fix: Unable to renumber a $X number in a URL if it was at position 0 in the string.
* Bug fix: Added support for default object notation (name). Should have been added in first release..
* Bug fix: RegEx is unable to easily remove unmatched data on multiple lines. All newlines replaced in all returns.
* Bug fix: "body:" now returns the contents instead of the object.
* Post 1.1: Updated crx to be compatible with 3.0.189.0
* Post 1.1 Bug fix: Fixed button images not loading.

Last edited by Waha; 06-20-2009 at 12:02 AM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 06-12-2009, 02:57 AM
Senior Member
 
Join Date: Apr 2009
Location: Qc, Canada
Posts: 495
Default

Very well done. I appreciate the loosely coupled design.

Good job, thanks for sharing this with us !
__________________

ChromeGestures
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 06-14-2009, 10:47 AM
Waha's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Oregon
Posts: 604
Default

Thanks. :]
I've updated the extension.
I have a couple more tubes I wrote descriptors for but they're 18+ sites, so I was wondering, would it be okay if I included them in the source? Or would that be tant amount to potentially corrupting a minor, since someone can open the source and see the URLs? Disclaimer perhaps?
I excluded them from the current version just in case.

I'd like to include them because they're the only ones to example "func:", plus it's more functionality. But it's not really important.

Last edited by Waha; 06-14-2009 at 10:49 AM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 06-14-2009, 02:28 PM
Moderator
 
Join Date: May 2009
Location: Orange County
Posts: 330
Default

I would say it's ok. It's not like your posting a clickable URL for people. You make your extension any way you want to.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 06-15-2009, 07:21 AM
Waha's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Oregon
Posts: 604
Default

Alright.
I forgot to take out a couple debug alerts, so I reuploaded it, heh. Also readded the 18+ stuff.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 06-19-2009, 11:59 PM
Waha's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Oregon
Posts: 604
Default

I had already updated this for 3.0.189.0, but I just noticed the images were broken, so I fixed that and reuploaded. (There was no version upgrade, so if you already had the 3.0.189.0 version installed, uninstall "Video Grabber" from chrome://extensions/ before reinstalling.)
__________________
~ Projects ~
Specialized: Carapass Auction Watcher
Libraries: bliplib
Tools: manifest syntax highlighting & snippits
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 08-02-2009, 06:43 PM
Junior Member
 
Join Date: Aug 2009
Posts: 14
Default

This extension won't work on Google Chrome 3.0.196.2 !!

Icon won't show up!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 08-02-2009, 06:44 PM
Junior Member
 
Join Date: Aug 2009
Posts: 14
Default

Btw it won't even install
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 08-02-2009, 11:46 PM
Waha's Avatar
Senior Member
 
Join Date: Apr 2009
Location: Oregon
Posts: 604
Default

Nope, it's broken right now and it will stay broken until I figure out a whole new way of retrieving JavaScript variables from the content window.
I also think I figured out a more reliable XHR method I'll give a try.
__________________
~ Projects ~
Specialized: Carapass Auction Watcher
Libraries: bliplib
Tools: manifest syntax highlighting & snippits
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 08-04-2009, 09:30 PM
Junior Member
 
Join Date: Aug 2009
Posts: 14
Default

Hey man I know you make this off your free time and stuff but can you please hurry because we need your addon like right now Thanks

Oh another thing can you also make it recognize HD videos in youtube? If I'm watching a HD video download the HD video..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
download, video

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML 5 <video> tags or the end of Flash Luc VN Chrome Tech 3 05-29-2009 07:15 PM
problems playing video in browser harbingerofdoom Chrome Plugins 3 05-21-2009 05:11 PM
Youtube video on MSN Messenger superp Chrome Tips & Tricks 0 12-27-2008 06:19 PM
usatoday.com video problem LarryI Bugs and Vulnerabilities 0 11-28-2008 01:08 AM
video slow when still loading sam2 Bugs and Vulnerabilities 0 11-18-2008 04:00 PM




Chrome Central - Chrome Talk - Chrome Tips and Tricks - Chrome Plugins - Chrome Themes - Chrome Tools - Bugs and Vulnerabilities - Chrome Tech - General Chat


All times are GMT. The time now is 05:10 AM.


Powered by vBulletin® Version 3.7.4 PL1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Google Chrome and Google™ is a Trademark of Google Inc
This site chromeplugins.org is not affiliated with or sponsored by Google Inc.
Thanks: Taree SEO Forum and John