Skip to content

Commit

Permalink
fix cid match
Browse files Browse the repository at this point in the history
The old regex is broken, fix it with new one.
  • Loading branch information
driverCzn authored Jun 24, 2018
1 parent ebbe13e commit 52e6a74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/you_get/extractors/bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def entry(self, **kwargs):
log.w('This page contains a playlist. (use --playlist to download all videos.)')

try:
cid = re.search(r'cid=(\d+)', self.page).group(1)
page_list = json.loads(re.search(r'"pages":(\[.*?\])', self.page).group(1))
index_id = int(re.search(r'index_(\d+)', self.url).group(1))
cid = page_list[index_id-1]['cid'] # change cid match rule
except:
cid = re.search(r'"cid":(\d+)', self.page).group(1)
if cid is not None:
Expand Down

0 comments on commit 52e6a74

Please sign in to comment.