sys.exit(); redirect_url = response.geturl() rs = re.findall('\.swf', redirect_url) if len(rs)>=1: rs = re.findall('file=(.*)', redirect_url) return fetch_request(rs[0]) return response.read() print "Starting my mission... " data = fetch_request(options.link) #rs = re.findall('swfobject\.embedSWF\("(.*)", "flashPlayerListHolder"', data) or re.findall('swfobject\.embedSWF\("(.*)", "flashPlayerHolder"', data) rs = re.findall('<param value="http://img1.nhaccuatui.com/Flash/NCTplayer31_L.swf\?file=(.*)" name="movie"/>', data) #print re.findall('<param value="http://img1.nhaccuatui.com/Flash/NCTplayer31_L.swf\?file=(.*)" name="movie"/>', data) if len(rs)>=1: xmldata = fetch_request(rs[0]) print "Get elements from Website's response" parser = FetchLocation() parser.parse(xmldata) print "We have %d items" % (len(parser.get_locations())) i = 0 for media in parser.get_locations(): r = re.findall('http://(.*).nhaccuatui.com', media) if len(r)>=1: if (media.split('.')[-1] not in ['gif','png','jpg','jpeg', 'swf']): i = i + 1 print "Downloading %d th %s " % (i, media) os.system('wget -P %s "%s"' % (options.directory, media))