From e81fb598785be073daaa9422e322e80a431522a8 Mon Sep 17 00:00:00 2001 From: dirkf Date: Fri, 14 Jul 2023 15:14:32 +0100 Subject: [PATCH] [core] Modify version and info display for nightly --- youtube_dl/YoutubeDL.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 6a12f91e4..8a6bc6eb8 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -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'],