mirror of
https://github.com/soimort/you-get.git
synced 2025-02-09 11:42:30 +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
|
assert title
|
||||||
hd = info['hd']
|
hd = info['hd']
|
||||||
assert hd in (0, 1, 2)
|
assert hd in (0, 1, 2)
|
||||||
type = ['normal', 'clear', 'super'][hd]
|
hd_types = [['normal', 'qvga'], ['clear', 'vga'], ['super', 'dvga']][hd]
|
||||||
files = [x for x in info['rfiles'] if x['type'] == type]
|
files = [x for x in info['rfiles'] if x['type'] in hd_types]
|
||||||
assert len(files) == 1
|
assert len(files) == 1
|
||||||
size = int(files[0]['filesize'])
|
size = int(files[0]['filesize'])
|
||||||
url = files[0]['url']
|
url = files[0]['url']
|
||||||
ext = r1(r'\.([^.]+)\?', url)
|
ext = 'mp4'
|
||||||
assert ext in ('flv', 'mp4')
|
|
||||||
|
|
||||||
print_info(site_info, title, ext, size)
|
print_info(site_info, title, ext, size)
|
||||||
if not info_only:
|
if not info_only:
|
||||||
download_urls([url], title, ext, size, output_dir = output_dir, merge = merge)
|
download_urls([url], title, ext, size, output_dir = output_dir, merge = merge)
|
||||||
|
|
||||||
def w56_download(url, output_dir = '.', merge = True, info_only = False, **kwargs):
|
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)
|
w56_download_by_id(id, output_dir = output_dir, merge = merge, info_only = info_only)
|
||||||
|
|
||||||
site_info = "56.com"
|
site_info = "56.com"
|
||||||
|
Loading…
Reference in New Issue
Block a user