mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
[facebook] use hd_src whenever possible and remove duplicates
This commit is contained in:
parent
7516028dd8
commit
e84810c4d2
@ -9,17 +9,22 @@ def facebook_download(url, output_dir='.', merge=True, info_only=False, **kwargs
|
|||||||
html = get_html(url)
|
html = get_html(url)
|
||||||
|
|
||||||
title = r1(r'<title id="pageTitle">(.+)</title>', html)
|
title = r1(r'<title id="pageTitle">(.+)</title>', html)
|
||||||
sd_urls = [
|
sd_urls = list(set([
|
||||||
unicodize(str.replace(i, '\\/', '/'))
|
unicodize(str.replace(i, '\\/', '/'))
|
||||||
for i in re.findall(r'"sd_src_no_ratelimit":"([^"]*)"', html)
|
for i in re.findall(r'"sd_src_no_ratelimit":"([^"]*)"', html)
|
||||||
]
|
]))
|
||||||
|
hd_urls = list(set([
|
||||||
|
unicodize(str.replace(i, '\\/', '/'))
|
||||||
|
for i in re.findall(r'"hd_src_no_ratelimit":"([^"]*)"', html)
|
||||||
|
]))
|
||||||
|
urls = hd_urls if hd_urls else sd_urls
|
||||||
|
|
||||||
type, ext, size = url_info(sd_urls[0], True)
|
type, ext, size = url_info(urls[0], True)
|
||||||
size = urls_size(sd_urls)
|
size = urls_size(urls)
|
||||||
|
|
||||||
print_info(site_info, title, type, size)
|
print_info(site_info, title, type, size)
|
||||||
if not info_only:
|
if not info_only:
|
||||||
download_urls(sd_urls, title, ext, size, output_dir, merge=False)
|
download_urls(urls, title, ext, size, output_dir, merge=False)
|
||||||
|
|
||||||
site_info = "Facebook.com"
|
site_info = "Facebook.com"
|
||||||
download = facebook_download
|
download = facebook_download
|
||||||
|
Loading…
Reference in New Issue
Block a user