mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 04:32:27 +03:00
fix downloading failure of "http://v.ent.163.com/video/2017/12/9/V/VD5BG8P9V.html"
This commit is contained in:
parent
cd77aad47c
commit
cb2e31080b
@ -131,6 +131,20 @@ def netease_download(url, output_dir = '.', merge = True, info_only = False, **k
|
||||
url = get_location(url)
|
||||
if "music.163.com" in url:
|
||||
netease_cloud_music_download(url, output_dir, merge, info_only, **kwargs)
|
||||
elif "v.ent.163.com/video" in url:
|
||||
# Parse and download video pages like:
|
||||
# http://v.ent.163.com/video/2017/12/9/V/VD5BG8P9V.html
|
||||
html = get_decoded_html(url)
|
||||
|
||||
title = r1(r'<h1[^>]*?><span[^>]*?>([^<]*?)</span></h1>', html)
|
||||
title = title.strip() if title else ''
|
||||
video_url = r1(r'"url_mp4": "([^"]*?)"', html)
|
||||
if video_url:
|
||||
_, ext, size = url_info(video_url)
|
||||
print_info(site_info, title, ext, size)
|
||||
|
||||
if not info_only:
|
||||
download_urls([video_url], title, ext, size, output_dir=output_dir, merge=merge)
|
||||
else:
|
||||
html = get_decoded_html(url)
|
||||
|
||||
|
@ -9,6 +9,7 @@ from you_get.extractors import (
|
||||
yixia,
|
||||
bilibili,
|
||||
douyin,
|
||||
netease,
|
||||
)
|
||||
|
||||
|
||||
@ -53,6 +54,12 @@ class YouGetTests(unittest.TestCase):
|
||||
info_only=True
|
||||
)
|
||||
|
||||
def test_netease(self):
|
||||
netease.download(
|
||||
'http://v.ent.163.com/video/2017/12/9/V/VD5BG8P9V.html',
|
||||
info_only=True
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user