mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	[cleanup] Upgrade syntax
Using https://github.com/asottile/pyupgrade 1. `__future__` imports and `coding: utf-8` were removed 2. Files were rewritten with `pyupgrade --py36-plus --keep-percent-format` 3. f-strings were cherry-picked from `pyupgrade --py36-plus` Extractors are left untouched (except removing header) to avoid unnecessary merge conflicts
This commit is contained in:
		| @@ -1,11 +1,8 @@ | ||||
| #!/usr/bin/env python3 | ||||
| # coding: utf-8 | ||||
| 
 | ||||
| f'You are using an unsupported version of Python. Only Python versions 3.6 and above are supported by yt-dlp'  # noqa: F541 | ||||
| 
 | ||||
| __license__ = 'Public Domain' | ||||
| 
 | ||||
| import io | ||||
| import itertools | ||||
| import os | ||||
| import random | ||||
| @@ -67,13 +64,12 @@ def get_urls(urls, batchfile, verbose): | ||||
|                     'Ctrl+Z' if compat_os_name == 'nt' else 'Ctrl+D')) | ||||
|                 batchfd = sys.stdin | ||||
|             else: | ||||
|                 batchfd = io.open( | ||||
|                     expand_path(batchfile), | ||||
|                     'r', encoding='utf-8', errors='ignore') | ||||
|                 batchfd = open( | ||||
|                     expand_path(batchfile), encoding='utf-8', errors='ignore') | ||||
|             batch_urls = read_batch_urls(batchfd) | ||||
|             if verbose: | ||||
|                 write_string('[debug] Batch file urls: ' + repr(batch_urls) + '\n') | ||||
|         except IOError: | ||||
|         except OSError: | ||||
|             sys.exit('ERROR: batch file %s could not be read' % batchfile) | ||||
|     _enc = preferredencoding() | ||||
|     return [ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan