Memoirs In Free Fall

November 12, 2006

Operating Opera

Filed under: Uncategorized — Tags: , , , — amit @ 6:41 am

So I got really sick of the fact that YouTube doesn’t offer the ability to prefetch a video before playing it (instead of, as often happens on my 256 kbit/s downstream, suffering stuttering and then having to play it again later), and looked for a way to steal the .flv that it plays.

I didn’t have to look long before I found YouTube to me and Google Video Getter. These are GreaseMonkey scripts. Now, GreaseMonkey’s just a Firefox extension that won’t work on Opera, right?

Not quite.

Opera, since version 8, has supported “User JavaScript”, i.e. GreaseMonkey scripts. You hit the Preferences, Advanced tab, Content category, JavaScript Options button, and specify a directory containing GreaseMonkey scripts at the bottom.

Now these scripts specified above don’t appear to work with Opera. I’m using the Flash Player 9 Update pre-release for Linux (in conjunction with libflashplayer for OSS goodness, so I can use the hardware-multiplexing NVSound driver for my onboard NForce audio), and I guess Adobe/Macromedia changed some things around so the scripts don’t work any more.

Never fear, I’ve figured out fixes to the scripts.

For YouTube-to-Me, change

var download_url = 'http://youtube.com/get_video?video_id=';

to

var download_url = 'http://www.youtube.com/get_video?video_id=';

Additionally, change

var t_id = playerDiv.src.match(/t=([^(\&|$)]*)/)[1];

to

var t_id = playerDiv.getAttribute("SRC").match(/t=([^&$]*)/)[1];

Apparently either Opera or Flash no longer allows access to the src attribute directly. getAttribute(“SRC”) works admirably well, though.

For Google Video Getter, change

var video_url = unescape(video_obj.data.match(/videoUrl=([^$)]*)/)[1]);

to

var video_url = unescape(video_obj.getAttribute("SRC").match(/videoUrl=([^$)]*)/)[1]);

A similar situation appears to apply.


I recently rented a Linux vserver for the princely sum of $6 a month. I intend to set up Apache + PHP + MySQL on it and run a CMS and some genealogy software. It’s running Centos 4.4, essentially Red Hat Enterprise Linux 4 Update 4.

Any suggestions for either the CMS or genealogy software are welcome. My restrictions are that the processor on the vserver host is a 2.53 GHz Celeron D, the memory allocation is 128MB and the disk space is 3GB, so that sort of rules out anything J2EE/JSP/Servlets or ASP.NET based.

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.