Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
fix(open_163):修复了由于某些视频链接无法解析导致程序整体崩溃的问题
Browse files Browse the repository at this point in the history
Fixes: Foair#24
  • Loading branch information
SigureMo committed Dec 13, 2018
1 parent 33796d7 commit 2bd6151
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mooc/open_163.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ def update_hex_urls(node, hex_urls):
if hex_urls.get(sp):
if hex_urls[sp].get(ext):
hex_url = hex_urls[sp][ext]
break

video_url = open_decrypt(hex_url, encrypt)
ext = '.' + video_url.split('.')[-1] # 对扩展名进行修正,有的课程从mp4中解析出来的仍为flv
video_url = open_decrypt(hex_url, encrypt)
ext = video_url.split('.')[-1] # 对扩展名进行修正,有的课程从mp4中解析出来的仍为flv
if ext in formats:
ext = '.' + ext
break

res_print(file_name + ext)
FILES['renamer'].write(re.search(r'(\w+\%s)'% ext, video_url).group(1), file_name, ext)
Expand Down

0 comments on commit 2bd6151

Please sign in to comment.