Decklin Foster: YouChoob
Russel notes a discussion of the problems with embedded media. I've
been using a Greasemonkey script for a while to linkify EMBED tags for
easier non-embedded downloading, but this doesn't help much on Flash
sites such as YouTube. I haven t installed Flash in years, but I got
sick of slinging URLs around and/or giving up and being the unpopular
kid, so I took some other Greasemonkey code I was hacking on and mushed
it all together:
http://www.red-bean.com/~decklin/userscripts/unembedtube.user.js(I get a perverse sort of nostalgia out of bringing back the "puzzle piece" for links, and mocking people with it.) YouTube embeds will appear to work like any other, but the URL is changed from the Flash wrapper to the FLV file, which can be opened in MPlayer/Totem/whatever. Since we can figure out this URL, it is also, of course, possible to make such the link back into an embed usable by mplayer-mozilla or a similar plugin. Unfortunately, I don't have time to look up how to add a configuration menu, but this line of JS does have a certain charm to it:
var evil = 0; // need to make this user-settableYou know what to do. If you want true evil, there are some pointers in the comments. For YouTube videos embedded from other sites, the best I can kludge for now is link to the video's original YouTube page. If someone would like to write a routine to snarf that page with XMLHTTPRequest and yank the necessary arguments out, I would love to add it. (Insert five-page think piece here about the lost dream of MIME and the sad fact that the rise of Web 2.0 has been driven more by the fact that native installation is irreparably broken and pointless anyway on most PCs than it is by the fact that JavaScript actually works now and the implications of this for the Free Software movement especially in light of the fact that we are still human beings who occasionally do social things like sign up for Twitter even though they're running on some proprietary code base.)
This graph shows the percentage of the total download that used HTTP
from a mirror. The optimal line shows the minimum possible (i.e. all
peers are connected), which corresponds to only one copy (the first)
of every package being downloaded using HTTP.
This verifies my previous thinking, which is that fracturing the
download population into multiple small swarms results in lots of
inefficiencies, and lots of HTTP downloading. All efforts will need
to be taken to keep the downloading populations together. (This is
especially difficult for unstable, when a new swarm could be created
twice a day due to archive updates.) Swarms of 1,000 peers or more
seem to be sufficient to minimize the HTTP downloading.
This graph shows the amount of unnecessary HTTP downloading that
occurred, which is just the difference of each line from the optimal
one in the previous plot. This shows the danger of selective
downloading, as all of this unnecessary HTTP downloading occurs
because the swarm is too big to find peers that have the desired
package (they do exist). Fortunately, this unnecessary downloading
seems to approach a maximum as the swarm size increases.
For the large swarm sizes needed to make the downloading efficient,
and assuming a reasonable number of connections of 100 (bittorrent
defaults to maintaining at least 40, and large swarms usually means
a large number of connections), we can expect to be using HTTP for
about 4% of the download. This number is surprisingly low due to the
popularity distribution of packages (only rare ones are hard to
find, but they aren't downloaded very often). I think 4% is
manageable in our situation, given that there is a backup method to
find the rare packages, though it does show the need to have that
backup method available. This is probably more of a problem for
regular bittorrent clients, in which there is no backup method.