@@ -334,18 +334,23 @@ def direct_download_link(self, quality, mode) -> str:
334334 self .logger .error (f"Using direct donwload Link: { str (url )} " )
335335 return urljoin ("https://eporner.com" , str (url ))
336336
337- def download (self , quality , path , callback = None , mode = Encoding .mp4_h264 , no_title = False ):
337+ def download (self , quality , path , callback = None , mode = Encoding .mp4_h264 , no_title = False , use_workaround = False ):
338338 if not self .enable_html :
339339 raise HTML_IS_DISABLED ("HTML content is disabled! See Documentation for more details" )
340340
341- response_redirect_url = self .core .fetch (self .direct_download_link (quality , mode ),
342- allow_redirects = True , get_response = True )
343-
344341 if no_title is False :
345342 path = os .path .join (path , f"{ self .title } .mp4" )
346343
344+
345+ url = self .direct_download_link (quality , mode )
346+ if use_workaround :
347+ response_redirect_url = self .core .fetch (self .direct_download_link (quality , mode ),
348+ allow_redirects = True , get_response = True ) # Sometimes the site trolls me
349+
350+ url = response_redirect_url .url
351+
347352 try :
348- self .core .legacy_download (url = str ( response_redirect_url . url ) , callback = callback , path = path )
353+ self .core .legacy_download (url = url , callback = callback , path = path )
349354 return True
350355
351356 except Exception :
0 commit comments