mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[networking] Add extensions attribute to Response (#9756)
				
					
				
			CurlCFFIRH now provides an `impersonate` field in its responses' extensions Authored by: bashonly
This commit is contained in:
		| @@ -132,6 +132,16 @@ class CurlCFFIRH(ImpersonateRequestHandler, InstanceStoreMixin): | ||||
|         extensions.pop('cookiejar', None) | ||||
|         extensions.pop('timeout', None) | ||||
| 
 | ||||
|     def send(self, request: Request) -> Response: | ||||
|         target = self._get_request_target(request) | ||||
|         try: | ||||
|             response = super().send(request) | ||||
|         except HTTPError as e: | ||||
|             e.response.extensions['impersonate'] = target | ||||
|             raise | ||||
|         response.extensions['impersonate'] = target | ||||
|         return response | ||||
| 
 | ||||
|     def _send(self, request: Request): | ||||
|         max_redirects_exceeded = False | ||||
|         session: curl_cffi.requests.Session = self._get_instance( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bashonly
					bashonly