Archive

Archive for March, 2009

UCLA Bruincast greasemonkey link ripper

March 25th, 2009 3 comments

Just a quick post on the simple greasemonkey script that rips UCLA Bruincast video links (obviously you need access). I made it for my brother, so he can download lectures for classes he would like to save. Here’s the short greasy script. (Remember, rename the urls from “http:” to “rtsp:”). To grab the DSL links simply replace ‘LAN’ with the text of the link. Enjoy!

// ==UserScript==
// @name           BruinCastPageLinks
// @namespace      hawflakes.unoc.net
// @description    Grabs Links on a page
// @include        http://www.oid.ucla.edu/webcasts/courses/*
// ==/UserScript==
 
// Greasemonkey Script written by Jonathan Wong, Copyright 2009
// Script is freeware (Use at your own risk!).
 
Links = findXPathNodes("//a[text()='LAN']/@href");
PrintString="";
 
for(i=0;i<links .snapshotLength;i++)
{
	PrintString=PrintString+Links.snapshotItem(i).value+"\n";
}
 
GM_openInTab("data:text;charset=UTF-8," + encodeURI(PrintString).replace(/&nbsp;/g,"&amp;nbsp;"));
 
function findXPathNode(xpath, start,doc)
{
	var result = (doc == null ? document : doc).evaluate(xpath,(start == null ? document : start), null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE ,null);
	return (result.snapshotLength > 0 ? result.snapshotItem(0) : null);
}
 
function findXPathNodes(xpath, start,doc)
{
	return (doc == null ? document : doc).evaluate(xpath,(start == null ? document : start), null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE ,null);	
}
 
function elem(tagname,content)
{
	var ret = document.createElement(tagname);
	ret.innerHTML = content;
	return ret;
}
</links>
Categories: Education, Useful Apps Tags: ,

UCLA streams – Real Media (.rm)

March 25th, 2009 No comments

So apparently mencoder only seems to work for asf,wmv,avi,mpeg streams, and does not like real media streams (I think this is purely due to the fact I do not have real media codecs on this machine and therefore -ovc/-oac options would not work anyway). So I’ve defaulted back to using mplayer for ripping the real media streams. Fortunately, I had remembered seeing this, which pretty much explains what one needs to do.

For UCLA, the linked .rm file is actually just plain text that gives you the actual url. However, in the case of UCLA (like stanford), one can simply replace “http” with “rtsp”.


mplayer -noframedrop -dumpfile out.rm -dumpstream rtsp://url.rm

The most interesting piece of information is that on windows, it is possible for mplayer to rip streams even if it can’t actually play it. For example, my Windows machine (what I’m using atm) does not have real player or alternative/hacked rm codecs on it, and therefore I can’t actually play .rm. However, I was able to rip it and someone else was able to play it. This does make sense.

Windows Productivity – #1

March 13th, 2009 No comments

I’ve been busy lately with research and academia, and so I haven’t had much time to hack up some interesting pieces of code. However, because of my student computing job (where I help people connect to the residential network) I decided to look up the Start>Run command shortcuts to generally useful network troubleshooting tasks, as well as a few others. (Note: These probably only work in NT-based systems: NT, 2000, XP, 2003, Vista, etc.)

  • services.msc – Brings up the Services control window. I use this often because I don’t like running unnecessary services like Cisco VPN client, which I use only when I need to connect to certain school servers.
  • ncpa.cpl – Brings up Network Connections. This is probably useful for users who can’t don’t already have shortcuts on their computers for this.
  • appwiz.cpl – Brings up the “Add or Remove Programs” Window. Obviously great for installing and removing software.

Last of all, a tip I mentioned before for taking screenshots of applications/windows with PrintScreen is to press Alt + Printscreen on the selected window. The screenshot as usual is sent to the clipboard as usual. (I learned this trick while working as an intern while writing sample api docs.)

Categories: Uncategorized Tags: