[tudou] fix #925

This commit is contained in:
Mort Yao 2016-02-18 15:50:14 +01:00
parent ef8cc3dba1
commit aabf30641b

View File

@ -9,12 +9,11 @@ def tudou_download_by_iid(iid, title, output_dir = '.', merge = True, info_only
data = json.loads(get_decoded_html('http://www.tudou.com/outplay/goto/getItemSegs.action?iid=%s' % iid))
temp = max([data[i] for i in data if 'size' in data[i][0]], key=lambda x:sum([part['size'] for part in x]))
vids, size = [t["k"] for t in temp], sum([t["size"] for t in temp])
urls = [[n.firstChild.nodeValue.strip()
for n in
parseString(
get_html('http://ct.v2.tudou.com/f?id=%s' % vid))
.getElementsByTagName('f')][0]
for vid in vids]
urls = []
for vid in vids:
for i in parseString(get_html('http://ct.v2.tudou.com/f?id=%s' % vid)).getElementsByTagName('f'):
urls.append(i.firstChild.nodeValue.strip())
ext = r1(r'http://[\w.]*/(\w+)/[\w.]*', urls[0])