Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
bufix for issue如果url链接无效好像就会导致报错 #6
Browse files Browse the repository at this point in the history
  • Loading branch information
GDDG08 committed Apr 3, 2024
1 parent 116ed9e commit 6efea67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ https://pypi.org/project/yanhekt/

<img src="assets/image-20240403163924034.png" width="250px"/>

- 扔进链接或者courseID(可Ctrl-C V)
- 扔进链接或者courseID(可Ctrl-C V
- 获取课程信息
- 随意选择课时(Ctrl、Shift、鼠标拖拽都可多选)
- 设置一些参数,比如要下载什么视频
Expand Down
6 changes: 3 additions & 3 deletions yanhekt.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Author : GDDG08
Date : 2022-11-08 02:07:44
LastEditors : GDDG08
LastEditTime : 2024-04-03 16:03:17
LastEditTime : 2024-04-03 23:12:54
'''
import requests
from m3u8dl import M3u8Download
Expand Down Expand Up @@ -96,7 +96,7 @@ def download(self, callback=None, callback_prog=None):
videos = video['videos'][0]
# 下载投影录屏
if self.vga or self.dual:
if 'vga' in videos: # 检查是否存在vga链接
if 'vga' in videos and videos['vga']: # 检查是否存在vga链接
if self.skip and os.path.exists(f"{dirName}/{fileName}-VGA.mp4"):
print(f"VGA seems already done. Skipping...")
else:
Expand All @@ -107,7 +107,7 @@ def download(self, callback=None, callback_prog=None):

# 下载视频
if self.video or self.dual:
if 'main' in videos: # 检查是否存在main链接
if 'main' in videos and videos['main']: # 检查是否存在main链接
if self.skip and os.path.exists(f"{dirName}/{fileName}-Video.mp4"):
print(f"Video seems already done. Skipping...")
else:
Expand Down

0 comments on commit 6efea67

Please sign in to comment.