mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 20:52:31 +03:00
[bilibili] fix #1436
This commit is contained in:
parent
3b3e5cfe38
commit
e2e5350e8d
@ -121,8 +121,15 @@ def bilibili_download(url, output_dir='.', merge=True, info_only=False, **kwargs
|
|||||||
|
|
||||||
if re.match(r'https?://bangumi\.bilibili\.com/', url):
|
if re.match(r'https?://bangumi\.bilibili\.com/', url):
|
||||||
# quick hack for bangumi URLs
|
# quick hack for bangumi URLs
|
||||||
url = r1(r'"([^"]+)" class="v-av-link"', html)
|
#url = r1(r'"([^"]+)" class="v-av-link"', html)
|
||||||
html = get_content(url)
|
#html = get_content(url)
|
||||||
|
import requests
|
||||||
|
episode_id = r1(r'episode-id="(\d+)"', html)
|
||||||
|
get_cid = requests.post(
|
||||||
|
'http://bangumi.bilibili.com/web_api/get_source',
|
||||||
|
data={'episode_id':episode_id},
|
||||||
|
headers=fake_headers)
|
||||||
|
html += get_cid.text.replace('"', '').replace(':', '=')
|
||||||
|
|
||||||
title = r1_of([r'<meta name="title" content="\s*([^<>]{1,999})\s*" />',
|
title = r1_of([r'<meta name="title" content="\s*([^<>]{1,999})\s*" />',
|
||||||
r'<h1[^>]*>\s*([^<>]+)\s*</h1>'], html)
|
r'<h1[^>]*>\s*([^<>]+)\s*</h1>'], html)
|
||||||
|
Loading…
Reference in New Issue
Block a user