[core] Modify version and info display for nightly

This commit is contained in:
dirkf 2023-07-14 15:14:32 +01:00
parent 2c0f26ffc0
commit e81fb59878
1 changed files with 11 additions and 4 deletions

View File

@ -126,6 +126,10 @@ from .postprocessor import (
get_postprocessor,
)
from .version import __version__
try:
from .version import RELEASE_GIT_HEAD
except ImportError:
RELEASE_GIT_HEAD = None
if compat_os_name == 'nt':
import ctypes
@ -2503,11 +2507,14 @@ class YoutubeDL(object):
write_string(encoding_str, encoding=None)
writeln_debug = lambda *s: self._write_string('[debug] %s\n' % (''.join(s), ))
writeln_debug('youtube-dl version ', __version__)
writeln_debug('youtube-dl version ', __version__,
' [{0}]'.format(RELEASE_GIT_HEAD[:9]) if RELEASE_GIT_HEAD else '',
(' (single file build)' if ytdl_is_updateable() else ''))
writeln_debug('** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.')
writeln_debug('** For support, visit the main site.')
if _LAZY_LOADER:
writeln_debug('Lazy loading extractors enabled')
if ytdl_is_updateable():
writeln_debug('Single file build')
writeln_debug('[debug] Lazy loading extractors enabled')
try:
sp = subprocess.Popen(
['git', 'rev-parse', '--short', 'HEAD'],