mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
[universal] support site-relative path
This commit is contained in:
parent
018cfde604
commit
c34c0af6a4
@ -99,6 +99,14 @@ def universal_download(url, output_dir='.', merge=True, info_only=False, **kwarg
|
|||||||
for rel_url in rel_urls:
|
for rel_url in rel_urls:
|
||||||
urls += [ r1(r'(.*/)', url) + rel_url ]
|
urls += [ r1(r'(.*/)', url) + rel_url ]
|
||||||
|
|
||||||
|
# site-relative path
|
||||||
|
rel_urls = []
|
||||||
|
rel_urls += re.findall(r'href="(/[^"]+\.jpe?g)"', page, re.I)
|
||||||
|
rel_urls += re.findall(r'href="(/[^"]+\.png)"', page, re.I)
|
||||||
|
rel_urls += re.findall(r'href="(/[^"]+\.gif)"', page, re.I)
|
||||||
|
for rel_url in rel_urls:
|
||||||
|
urls += [ r1(r'(https?://[^/]+)', url) + rel_url ]
|
||||||
|
|
||||||
# MPEG-DASH MPD
|
# MPEG-DASH MPD
|
||||||
mpd_urls = re.findall(r'src="(https?://[^"]+\.mpd)"', page)
|
mpd_urls = re.findall(r'src="(https?://[^"]+\.mpd)"', page)
|
||||||
for mpd_url in mpd_urls:
|
for mpd_url in mpd_urls:
|
||||||
|
Loading…
Reference in New Issue
Block a user