mirror of
				https://github.com/ytdl-org/youtube-dl.git
				synced 2025-11-01 09:26:45 -07:00 
			
		
		
		
	[http] Use the YoutubeDL.urlopen method
				
					
				
			This commit is contained in:
		@@ -49,7 +49,7 @@ class HttpFD(FileDownloader):
 | 
			
		||||
        while count <= retries:
 | 
			
		||||
            # Establish connection
 | 
			
		||||
            try:
 | 
			
		||||
                data = compat_urllib_request.urlopen(request)
 | 
			
		||||
                data = self.ydl.urlopen(request)
 | 
			
		||||
                break
 | 
			
		||||
            except (compat_urllib_error.HTTPError, ) as err:
 | 
			
		||||
                if (err.code < 500 or err.code >= 600) and err.code != 416:
 | 
			
		||||
@@ -59,7 +59,7 @@ class HttpFD(FileDownloader):
 | 
			
		||||
                    # Unable to resume (requested range not satisfiable)
 | 
			
		||||
                    try:
 | 
			
		||||
                        # Open the connection again without the range header
 | 
			
		||||
                        data = compat_urllib_request.urlopen(basic_request)
 | 
			
		||||
                        data = self.ydl.urlopen(basic_request)
 | 
			
		||||
                        content_length = data.info()['Content-Length']
 | 
			
		||||
                    except (compat_urllib_error.HTTPError, ) as err:
 | 
			
		||||
                        if err.code < 500 or err.code >= 600:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user