1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-02 12:02:52 -05: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:
Jaime Marquínez Ferrándiz
2015-06-28 22:08:29 +02:00
parent ac0474f89d
commit 67134eaba1
3 changed files with 209 additions and 121 deletions

View File

@ -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',