mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[core] sleep-subtitles fix
This commit is contained in:
		@@ -364,11 +364,12 @@ class FileDownloader(object):
 | 
				
			|||||||
                        else '%.2f' % sleep_interval))
 | 
					                        else '%.2f' % sleep_interval))
 | 
				
			||||||
                time.sleep(sleep_interval)
 | 
					                time.sleep(sleep_interval)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            sleep_interval_sub = self.params.get('sleep_interval_subtitles')
 | 
					            if self.params.get('sleep_interval_subtitles') > 0:
 | 
				
			||||||
            self.to_screen(
 | 
					                sleep_interval_sub = self.params.get('sleep_interval_subtitles')
 | 
				
			||||||
                '[download] Sleeping %s seconds...' % (
 | 
					                self.to_screen(
 | 
				
			||||||
                    int(sleep_interval_sub)))
 | 
					                    '[download] Sleeping %s seconds...' % (
 | 
				
			||||||
            time.sleep(sleep_interval_sub)
 | 
					                        sleep_interval_sub))
 | 
				
			||||||
 | 
					                time.sleep(sleep_interval_sub)
 | 
				
			||||||
        return self.real_download(filename, info_dict)
 | 
					        return self.real_download(filename, info_dict)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def real_download(self, filename, info_dict):
 | 
					    def real_download(self, filename, info_dict):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -582,7 +582,7 @@ def parseOpts(overrideArguments=None):
 | 
				
			|||||||
            'along with --min-sleep-interval.'))
 | 
					            'along with --min-sleep-interval.'))
 | 
				
			||||||
    workarounds.add_option(
 | 
					    workarounds.add_option(
 | 
				
			||||||
        '--sleep-subtitles',
 | 
					        '--sleep-subtitles',
 | 
				
			||||||
        dest='sleep_interval_subtitles', action='store_true', default=0,
 | 
					        dest='sleep_interval_subtitles', default=0, type=int,
 | 
				
			||||||
        help='Enforce sleep interval on subtitles as well')
 | 
					        help='Enforce sleep interval on subtitles as well')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')
 | 
					    verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user