mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 00:33:58 +03:00
[w56] partly solved #720
This commit is contained in:
parent
2c7aa3b161
commit
0fbeffb949
@ -12,20 +12,20 @@ def w56_download_by_id(id, title = None, output_dir = '.', merge = True, info_on
|
||||
assert title
|
||||
hd = info['hd']
|
||||
assert hd in (0, 1, 2)
|
||||
type = ['normal', 'clear', 'super'][hd]
|
||||
files = [x for x in info['rfiles'] if x['type'] == type]
|
||||
hd_types = [['normal', 'qvga'], ['clear', 'vga'], ['super', 'dvga']][hd]
|
||||
files = [x for x in info['rfiles'] if x['type'] in hd_types]
|
||||
assert len(files) == 1
|
||||
size = int(files[0]['filesize'])
|
||||
url = files[0]['url']
|
||||
ext = r1(r'\.([^.]+)\?', url)
|
||||
assert ext in ('flv', 'mp4')
|
||||
ext = 'mp4'
|
||||
|
||||
print_info(site_info, title, ext, size)
|
||||
if not info_only:
|
||||
download_urls([url], title, ext, size, output_dir = output_dir, merge = merge)
|
||||
|
||||
def w56_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):
|
||||
id = r1(r'http://www.56.com/u\d+/v_(\w+).html', url)
|
||||
id = r1(r'http://www.56.com/u\d+/v_(\w+).html', url) or \
|
||||
r1(r'http://www.56.com/.*vid-(\w+).html', url)
|
||||
w56_download_by_id(id, output_dir = output_dir, merge = merge, info_only = info_only)
|
||||
|
||||
site_info = "56.com"
|
||||
|
Loading…
Reference in New Issue
Block a user