mirror of
https://github.com/soimort/you-get.git
synced 2025-04-13 02:42:30 +03:00
[acfun] change bangumi URL first (see #2820)
This commit is contained in:
parent
c2ca0b5831
commit
f878b4fb9a
@ -125,14 +125,14 @@ def acfun_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||
if 'playInfos' in currentVideoInfo:
|
||||
m3u8_url = currentVideoInfo['playInfos'][0]['playUrls'][0]
|
||||
elif 'ksPlayJson' in currentVideoInfo:
|
||||
ksPlayJson = json.loads( currentVideoInfo['ksPlayJson'] )
|
||||
ksPlayJson = json.loads( currentVideoInfo['ksPlayJson'] )
|
||||
representation = ksPlayJson.get('adaptationSet').get('representation')
|
||||
reps = []
|
||||
for one in representation:
|
||||
reps.append( (one['width']* one['height'], one['url'], one['backupUrl']) )
|
||||
m3u8_url = max(reps)[1]
|
||||
|
||||
elif re.match("https?://[^\.]*\.*acfun\.[^\.]+/bangumi/ab(\d+)", url):
|
||||
|
||||
elif re.match("https?://[^\.]*\.*acfun\.[^\.]+/bangumi/aa(\d+)", url):
|
||||
html = get_content(url, headers=fake_headers)
|
||||
tag_script = match1(html, r'<script>window\.pageInfo([^<]+)</script>')
|
||||
json_text = tag_script[tag_script.find('{') : tag_script.find('};') + 1]
|
||||
|
Loading…
x
Reference in New Issue
Block a user