mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-21 05:44:02 -07:00
[YoutubeDL] rework how the format spec is processed
The spec string is processed using 'tokenize.tokenize' to split it in words and operators, the filters are still processed using regular expressions. This should make easier to allow grouping operators with parens.
This commit is contained in:
parent
ac0474f89d
commit
67134eaba1
3 changed files with 209 additions and 121 deletions
|
@ -388,6 +388,10 @@ else:
|
|||
pass
|
||||
return _terminal_size(columns, lines)
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
from tokenize import tokenize as compat_tokenize_tokenize
|
||||
else:
|
||||
from tokenize import generate_tokens as compat_tokenize_tokenize
|
||||
|
||||
__all__ = [
|
||||
'compat_HTTPError',
|
||||
|
@ -408,6 +412,7 @@ __all__ = [
|
|||
'compat_socket_create_connection',
|
||||
'compat_str',
|
||||
'compat_subprocess_get_DEVNULL',
|
||||
'compat_tokenize_tokenize',
|
||||
'compat_urllib_error',
|
||||
'compat_urllib_parse',
|
||||
'compat_urllib_parse_unquote',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue