Skip to content

Commit

Permalink
Merge branch 'qq_redirect' of https://github.com/rosynirvana/you-get
Browse files Browse the repository at this point in the history
…into rosynirvana-qq_redirect (fix #1908)
  • Loading branch information
soimort committed May 6, 2017
2 parents f64b349 + 398845f commit 9d39517
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/you_get/extractors/qq.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,13 @@ def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
if 'v.qq.com/page' in url:
# for URLs like this:
# http://v.qq.com/page/k/9/7/k0194pwgw97.html
content = get_html(url)
url = match1(content,r'window\.location\.href="(.*?)"')
new_url = url_locations([url])[0]
if url == new_url:
#redirect in js?
content = get_content(url)
url = match1(content,r'window\.location\.href="(.*?)"')
else:
url = new_url

if 'kuaibao.qq.com' in url or re.match(r'http://daxue.qq.com/content/content/id/\d+', url):
content = get_html(url)
Expand Down

0 comments on commit 9d39517

Please sign in to comment.