mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
fix url_to_module
This commit is contained in:
parent
1a0ed7db44
commit
da4506c4e7
@ -66,7 +66,7 @@ def url_to_module(url):
|
||||
#TODO
|
||||
}
|
||||
if k in downloads:
|
||||
return downloads[k]
|
||||
return downloads[k], url
|
||||
else:
|
||||
import http.client
|
||||
conn = http.client.HTTPConnection(video_host)
|
||||
@ -76,20 +76,14 @@ def url_to_module(url):
|
||||
if location is None:
|
||||
raise NotImplementedError(url)
|
||||
else:
|
||||
return url_to_module(location), location
|
||||
return url_to_module(location)
|
||||
|
||||
def any_download(url, output_dir='.', merge=True, info_only=False):
|
||||
try:
|
||||
m, url = url_to_module(url)
|
||||
except:
|
||||
m = url_to_module(url)
|
||||
m.download(url, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
|
||||
def any_download_playlist(url, output_dir='.', merge=True, info_only=False):
|
||||
try:
|
||||
m, url = url_to_module(url)
|
||||
except:
|
||||
m = url_to_module(url)
|
||||
m.download_playlist(url, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
|
||||
def main():
|
||||
|
@ -8,7 +8,7 @@ from you_get.extractor.__main__ import url_to_module
|
||||
|
||||
def test_urls(urls):
|
||||
for url in urls:
|
||||
url_to_module(url).download(url, info_only = True)
|
||||
url_to_module(url)[0].download(url, info_only = True)
|
||||
|
||||
class YouGetTests(unittest.TestCase):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user