Sunday, August 29, 2010

coding at Auckmageddon

Thanks to Vector and Orcon, A5 has a 1gbps internet connection which really craps on all the other LANs that have ever happened in NZ. We tried to come up with ways we could max it out and someone suggested I was asked to come up with a script to parse the feeds for a list of 1080p trailer URLs we could feed into wget. This is what I came up with:

from urllib2 import urlopen
from BeautifulSoup import BeautifulSoup
from json import loads

urllist = []
for t in loads(urlopen("").read()):

for u in map(lambda x: "" + x, urllist):
        h = urlopen(u+"includes/playlists/").read()
        soup = BeautifulSoup(h)
        avail = soup.findAll("li", {"class":"trailer last"})[0].findAll("li", {"class":"hd"})
        print avail[-1].findChild("a").attrs[0][1]

It turns out that not all the trailers have corresponding HTTP urls to the .mov files - some are handled through ITMS for unknown reasons.

Anyway, we still havent managed to crack much more than 200mbit, and Soundie seems a little dissapointed.

No comments:

Post a Comment