def pptv_download_by_id(id, merge=True):
	xml = get_html('http://web-play.pptv.com/webplay3-151-%s.xml' % id)
	xml = xml.decode('utf-8')
	host = r1(r'<sh>([^<>]+)</sh>', xml)
	port = 8080
	st = r1(r'<st>([^<>]+)</st>', xml)
	key = hashlib.md5(st).hexdigest() # FIXME: incorrect key
	rids = re.findall(r'rid="([^"]+)"', xml)
	rid = r1(r'rid="([^"]+)"', xml)
	title = r1(r'nm="([^"]+)"', xml)
	pieces = re.findall('<sgm no="(\d+)".*fs="(\d+)"', xml)
	numbers, fs = zip(*pieces)
	urls = ['http://%s:%s/%s/%s?key=%s' % (host, port, i, rid, key) for i in numbers]
	urls = ['http://pptv.vod.lxdns.com/%s/%s?key=%s' % (i, rid, key) for i in numbers]
	total_size = sum(map(int, fs))
	assert rid.endswith('.mp4')
	download_urls(urls, title, 'mp4', total_size=total_size, merge=merge)
dataset/ETHPy150Open iambus/youku-lixian/pptv.py/pptv_download_by_id/original