From f1ed97c500ef566714640c00369f801e7c01e22d Mon Sep 17 00:00:00 2001 From: "Lee, Donggu" Date: Tue, 8 Oct 2013 14:00:00 +0000 Subject: [PATCH] flash link can be downloaded --- src/you_get/extractor/sohu.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/you_get/extractor/sohu.py b/src/you_get/extractor/sohu.py index dcaac7eb..c364917f 100644 --- a/src/you_get/extractor/sohu.py +++ b/src/you_get/extractor/sohu.py @@ -36,9 +36,11 @@ def sohu_download(url, output_dir = '.', merge = True, info_only = False): assert data['clipsURL'][0].endswith('.mp4') else: - # my.tv link doesn't include clip info anymore, below block is useless - vid = r1('vid\s*=\s*\'(\d+)\'', get_html(url)) - data = json.loads(get_decoded_html('http://my.tv.sohu.com/videinfo.jhtml?m=viewnew&vid=%s' % vid)) + if re.match(r'http://share.vrs.sohu.com', url): + vid = r1('id=(\d+)', url) + else: + vid = r1('vid\s*=\s*\'(\d+)\'', get_html(url)) + data = json.loads(get_decoded_html('http://my.tv.sohu.com/play/videonew.do?vid=%s&referer=http://my.tv.sohu.com' % vid)) host = data['allot'] prot = data['prot'] urls = []