sys.stdout defaults to text mode, we need to use the underlying buffer
instead when writing binary data.
Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com>
In order to be more consistent with different subtitle formats.
From:
* --write-srt to --write-sub
* --only-srt to --only-sub
* --all-srt to --all-subs
* --srt-lang to --sub-lang'
Refactored also all the mentions of srt for sub in all the source code.
When a query results of 0 items, the key items is not present in the
api_response dictionary, raising a KeyError.
Intead, look for the key and call trouble if it's not present.
When using youtube-dl from another python script with the quiet option
on, and a post procesor for extract the audio. The message of deleting
video shows in the first script logs (as it goes to stderr).
There is no way to keep this quiet as it's treated as an error, even if,
for me, it's not.
Improved option '--srt-lang'
- it shows the argument in case of missing subtitles
- added language suffix for non-english languages (e.g. video.it.srt)