Skip to content

Commit

Permalink
修复课程名含非法字符的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
AuYang261 committed Nov 5, 2023
1 parent c8e3006 commit 71b1659
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def main():
os.mkdir('output/')
for i in index:
c = videoList[i]
name = course.json()['data']['name_zh'] + '-' + course.json()['data']['professors'][0]['name'] + '-' + c['title']
name = course.json()['data']['name_zh'].strip() + '-' + course.json()['data']['professors'][0]['name'] + '-' + c['title']
print(name)
if vga == "2":
print("Downloading screen...")
m3u8dl.M3u8Download(c['videos'][0]['vga'], 'output\\' + course.json()['data']['name_zh'] + ('-screen' if vga == '2' else '-video'), name)
m3u8dl.M3u8Download(c['videos'][0]['vga'], 'output\\' + course.json()['data']['name_zh'].strip() + ('-screen' if vga == '2' else '-video'), name)
else:
print("Downloading video...")
m3u8dl.M3u8Download(c['videos'][0]['main'], 'output\\'+ course.json()['data']['name_zh'] + ('-screen' if vga == '2' else '-video'), name)
m3u8dl.M3u8Download(c['videos'][0]['main'], 'output\\'+ course.json()['data']['name_zh'].strip() + ('-screen' if vga == '2' else '-video'), name)


if __name__ == '__main__':
Expand Down
1 change: 1 addition & 0 deletions pack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pyinstaller -F main.py

0 comments on commit 71b1659

Please sign in to comment.