Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloading a selection of videos from the same publisher #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions bilibili_video_download_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def combine_video(title_list):
# https://www.bilibili.com/video/av46958874/?spm_id_from=333.334.b_63686965665f7265636f6d6d656e64.16
start_url = 'https://api.bilibili.com/x/web-interface/view?aid=' + re.search(r'/av(\d+)/*', start).group(1)

first = input("please enter the first video number: ")
last = input("please enter the last video number: ")

# 视频质量
# <accept_format><![CDATA[flv,flv720,flv480,flv360]]></accept_format>
# <accept_description><![CDATA[高清 1080P,高清 720P,清晰 480P,流畅 360P]]></accept_description>
Expand All @@ -196,6 +199,9 @@ def combine_video(title_list):
# 单独下载分P视频中的一集
p = re.search(r'\?p=(\d+)',start).group(1)
cid_list.append(data['pages'][int(p) - 1])
elif first != 0 and last != 0 and last >= first:
for i in range(int(first), int(last)):
cid_list.append(data['pages'][i-1])
else:
# 如果p不存在就是全集下载
cid_list = data['pages']
Expand Down