Set process title to youtube-dl

This allows killing all youtube-dl processes with killall youtube-dl, and shows up nicer in some programs.
This commit is contained in:
Philipp Hagemeister 2013-12-16 05:04:12 +01:00
parent 8863d0de91
commit e3946f989e
2 changed files with 19 additions and 0 deletions

View file

@ -62,6 +62,7 @@ from .utils import (
MaxDownloadsReached,
preferredencoding,
SameFileError,
setproctitle,
std_headers,
write_string,
)
@ -471,12 +472,15 @@ def parseOpts(overrideArguments=None):
return parser, opts, args
def _real_main(argv=None):
# Compatibility fixes for Windows
if sys.platform == 'win32':
# https://github.com/rg3/youtube-dl/issues/820
codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None)
setproctitle(u'youtube-dl')
parser, opts, args = parseOpts(argv)
# Set user agent