0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-12-29 01:51:06 +00:00

[generic] If the url doesn't specify the protocol, then try to extract prepending 'http://'

This commit is contained in:
Jaime Marquínez Ferrándiz 2013-09-06 18:39:35 +02:00
parent a490fda746
commit a7130543fa

View file

@ -109,6 +109,11 @@ def http_error_405(self, req, fp, code, msg, headers):
return new_url
def _real_extract(self, url):
parsed_url = compat_urlparse.urlparse(url)
if not parsed_url.scheme:
self._downloader.report_warning('The url doesn\'t specify the protocol, trying with http')
return self.url_result('http://' + url)
try:
new_url = self._test_redirect(url)
if new_url: