Commit Graph

50 Commits (b41631c4e6e56afb2427513c84df1b13681cf4c8)

Author SHA1 Message Date
Jaime Marquínez Ferrándiz ae37338e68 [compat] compat_etree_fromstring: clarify comment
Jaime Marquínez Ferrándiz f78546272c [compat] compat_etree_fromstring: also decode the text attribute
Deletes parse_xml from utils, because it also does it.
Jaime Marquínez Ferrándiz 387db16a78 [compat] compat_etree_fromstring: only decode bytes objects
Jaime Marquínez Ferrándiz 36e6f62cd0 Use a wrapper around xml.etree.ElementTree.fromstring in python 2.x ()
Attributes aren't unicode objects, so they couldn't be directly used in info_dict fields (for example '--write-description' doesn't work with bytes).
Yen Chi Hsuan 0a67a3632b [compat] Add compat_urllib_request_DataHandler
Sergey M․ f2dbc54066 [compat] Fix wrong lines/columns order
stty size is rows x columns
Philipp Hagemeister 4810c48d6d [compat] Do not compare None <= 0
The result is meaningless (and it emits a warning in cpython2 when called with -3), so handle None before making integer comparisons.
Yen Chi Hsuan 13118a50b8 [compat] Allow overriding by only COLUMNS or LINES in compat_get_terminal_size
Now the semantic of this function is identical to
shutil.get_terminal_size() in Python 3.3+. The new behavior also
corresponds to the old get_term_width(), which is removed in
003c69a84b
Philipp Hagemeister 953fed280f [compat] Do not use unicode
If the code ever runs on 3.x, it would fail. Even if it never does, the unicode name confuses Python 3 code analysis tools.
Sergey M․ 8df5ae15d1 [compat] Fix python version check for compat_shlex_split
Sergey M․ 51f579b635 [compat] Add compat shlex.split
Jaime Marquínez Ferrándiz 03950c90f7 Merge remote-tracking branch 'jaimemf/format_spec_groups' (closes )
remitamine 799207e838 [viewster] extract the api auth token
Closes .
Sergey M․ 22603348aa [compat] Fix _asciire
Sergey M․ 3cc8b4c327 [compat] Fix missing _asciire on python 2.6
Sergey M․ 4d08161ac2 [compat] Mention unquote_plus
Sergey M․ aa99aa4e85 [compat] Add compat_urllib_parse_unquote_plus
Sergey M․ 5513967926 [compat] Simplify and use latest cpython 3 code
fnord 593b77064c Don't forget trailing '%'
fnord 9fefc88656 fix TestCompat test_all_present
fnord a0f28f90fa remove kebab
fnord 851229a01f remove debugprint
fnord c9c854cea7 replace old compat_urllib_parse_unquote with backport from python3's function
* required unquote_to_bytes function ported as well
    (uses .decode('hex') instead of dynamically populated _hextobyte global)
  * required implicit conversion to bytes and/or unicode in places due to
    differing type assumptions in p3
fnord e37c932fca compat_urllib_parse_unquote: crash fix: only decode valid hex
on python 2 the following has a { "crash_rate": "100%" } of the time
as it tries to parse '" ' as hex.
Yen Chi Hsuan a0e060ac1e [compat] Add compat_itertools_count
'step' parameter is added in Python 2.7
Jaime Marquínez Ferrándiz 67134eaba1 [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.
Jaime Marquínez Ferrándiz 2ddcd88129 Remove code that was only used by the Grooveshark extractor
Jaime Marquínez Ferrándiz 70a1165b32 Don't use bare 'except:'
They catch any exception, including KeyboardInterrupt, we don't want to catch it.
Jaime Marquínez Ferrándiz 003c69a84b Use shutil.get_terminal_size for getting the terminal width if it's available (python >= 3.3)
Philipp Hagemeister 0196149c5b [compat] Correct compat_basestring definition
Philipp Hagemeister 8f9312c387 Appease pyflakes8-3
Philipp Hagemeister 83fda3c000 Add a test for --no-check-certificate
Philipp Hagemeister 8ad6b5ed9f [compat] Correct socket error class reference
Sergey M․ 987493aef3 [test_compat] Fix alphabetic order to make test_all_present pass
Philipp Hagemeister be4a824d74 Add new option --source-address
Closes , fixes , fixes , fixes , closes .
Philipp Hagemeister c6973bd412 [compat] Simplify kwarg detection code
This enables nuitka to compile youtube-dl.
Philipp Hagemeister e2f89ec7aa Revert "[utils] Work around PyPy stupidity with Windows DLLs (Fixes )"
This reverts commit 16040f46d6.
Philipp Hagemeister 16040f46d6 [utils] Work around PyPy stupidity with Windows DLLs (Fixes )
Jaime Marquínez Ferrándiz 83e865a370 Fix PEP8 issue E713
Philipp Hagemeister b061ea6e9f [compat] Beautify assertion
Jouke Waleson 9e1a5b8455 PEP8: applied even more rules
Jouke Waleson 5f6a1245ff PEP8 applied
Philipp Hagemeister 7d4111ed14 Provide guidance when called with a YouTube ID starting with a dash.
Reported at https://news.ycombinator.com/item?id=8648121
Philipp Hagemeister b244b5c3f9 remove unused imports
Philipp Hagemeister 07e378fa18 [compat] correct OptionGroup invocation for Python 3 (fixes )
Philipp Hagemeister e07e931375 Work around 2.7.0 deficencies (Fixes )
Philipp Hagemeister c7b0add86f [compat] Work around kwargs bugs in old 2.6 Python releases (Fixes )
Philipp Hagemeister 451948b28c [compat] Modernize
Philipp Hagemeister baa708036c [compat] Fix imports
Philipp Hagemeister 8c25f81bee [util] Move compatibility functions out of util
utils is large enough without these compatibility functions.

Everything that is present in newer versions of Python (i.e. with dev Python it's just an import) goes into compat.py .
Everything else (i.e. youtube-dl-specific helpers) goes into utils.py .