This is a follow-up to #999.
This commit adds the
<function_name>: <url>
debug message, which was previously only emitted by get_content and
post_content, to all high level utility functions with network requests
except url_size, url_save and url_save_chunked (in order not to ruin
progress bars).
Occasionally, the FFmpeg invocation fails (which could be due to bugs in
you-get; see #1558 for instance), but -loglevel quiet means nothing is
printed other than the exit status (pretty much always 1) in Python's
traceback, which is not helpful at all.
This commit restores FFmpeg's regular output (-loglevel info) when
--debug is specified. We're not using verbose, debug or trace because
those levels are mostly only useful for debugging FFmpeg itself, which
is not our goal.
Due to lack of meaningful API to access the global logging level, this
is a hack based on two assumptions:
1. When --debug is enabled, the root logger level is set to DEBUG;
2. processor.ffmpeg is lazily imported, after command line options are
parsed.
Relative paths in the concat list are considered relative to the parent
directory of the script, not the calling directory. This isn't entirely
obvious from the documentation, but it is easy to infer from the concat
demuxer's concept of "safety", and easy to test (confirmed on FFmpeg
3.2.2). See https://ffmpeg.org/ffmpeg-all.html#concat-1 for details.
This commit fixes the wrong relative paths when --output-dir is
specified and not pwd.
This commit also
- Factors out common concat list writer code;
- Slightly simplifies the code to collect FFmpeg params (on Py35+ we can
further simplify by unpacking LOGLEVEL with the star operator right in
the list literal).