raise a manual exception when youtube-dl extract_info returns no data to trigger backoffs, increase backoff retry and timers, resolves #66
This commit is contained in:
		
							parent
							
								
									86068790ed
								
							
						
					
					
						commit
						db651e16b9
					
				| 
						 | 
					@ -46,6 +46,11 @@ def get_media_info(url):
 | 
				
			||||||
            response = y.extract_info(url, download=False)
 | 
					            response = y.extract_info(url, download=False)
 | 
				
			||||||
        except youtube_dl.utils.DownloadError as e:
 | 
					        except youtube_dl.utils.DownloadError as e:
 | 
				
			||||||
            raise YouTubeError(f'Failed to extract_info for "{url}": {e}') from e
 | 
					            raise YouTubeError(f'Failed to extract_info for "{url}": {e}') from e
 | 
				
			||||||
 | 
					    if not response:
 | 
				
			||||||
 | 
					        raise YouTubeError(f'Failed to extract_info for "{url}": No metadata was '
 | 
				
			||||||
 | 
					                           f'returned by youtube-dl, check for error messages in the '
 | 
				
			||||||
 | 
					                           f'logs above. This task will be retried later with an '
 | 
				
			||||||
 | 
					                           f'exponential backoff.')
 | 
				
			||||||
    return response
 | 
					    return response
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -128,7 +128,7 @@ HEALTHCHECK_FIREWALL = True
 | 
				
			||||||
HEALTHCHECK_ALLOWED_IPS = ('127.0.0.1',)
 | 
					HEALTHCHECK_ALLOWED_IPS = ('127.0.0.1',)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MAX_ATTEMPTS = 10                           # Number of times tasks will be retried
 | 
					MAX_ATTEMPTS = 15                           # Number of times tasks will be retried
 | 
				
			||||||
MAX_RUN_TIME = 1800                         # Maximum amount of time in seconds a task can run
 | 
					MAX_RUN_TIME = 1800                         # Maximum amount of time in seconds a task can run
 | 
				
			||||||
BACKGROUND_TASK_RUN_ASYNC = True            # Run tasks async in the background
 | 
					BACKGROUND_TASK_RUN_ASYNC = True            # Run tasks async in the background
 | 
				
			||||||
BACKGROUND_TASK_ASYNC_THREADS = 1           # Number of async tasks to run at once
 | 
					BACKGROUND_TASK_ASYNC_THREADS = 1           # Number of async tasks to run at once
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue