mirror of
https://gitlab.com/dstftw/youtube-dl.git
synced 2020-11-16 09:42:26 +00:00
[phantomjs] add exe version to debug info
This commit is contained in:
parent
c89267d31a
commit
feee8d32e4
|
@ -86,6 +86,7 @@ from .utils import (
|
||||||
write_string,
|
write_string,
|
||||||
YoutubeDLCookieProcessor,
|
YoutubeDLCookieProcessor,
|
||||||
YoutubeDLHandler,
|
YoutubeDLHandler,
|
||||||
|
PhantomJSwrapper,
|
||||||
)
|
)
|
||||||
from .cache import Cache
|
from .cache import Cache
|
||||||
from .extractor import get_info_extractor, gen_extractor_classes, _LAZY_LOADER
|
from .extractor import get_info_extractor, gen_extractor_classes, _LAZY_LOADER
|
||||||
|
@ -2146,6 +2147,7 @@ class YoutubeDL(object):
|
||||||
|
|
||||||
exe_versions = FFmpegPostProcessor.get_versions(self)
|
exe_versions = FFmpegPostProcessor.get_versions(self)
|
||||||
exe_versions['rtmpdump'] = rtmpdump_version()
|
exe_versions['rtmpdump'] = rtmpdump_version()
|
||||||
|
exe_versions['phantomjs'] = PhantomJSwrapper._version()
|
||||||
exe_str = ', '.join(
|
exe_str = ', '.join(
|
||||||
'%s %s' % (exe, v)
|
'%s %s' % (exe, v)
|
||||||
for exe, v in sorted(exe_versions.items())
|
for exe, v in sorted(exe_versions.items())
|
||||||
|
|
|
@ -3895,6 +3895,10 @@ class PhantomJSwrapper(object):
|
||||||
|
|
||||||
_TMP_FILE_NAMES = ['script', 'html', 'cookies']
|
_TMP_FILE_NAMES = ['script', 'html', 'cookies']
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _version():
|
||||||
|
return get_exe_version('phantomjs', version_re=r'([0-9.]+)')
|
||||||
|
|
||||||
def __init__(self, extractor, required_version=None, timeout=10000):
|
def __init__(self, extractor, required_version=None, timeout=10000):
|
||||||
self.exe = check_executable('phantomjs', ['-v'])
|
self.exe = check_executable('phantomjs', ['-v'])
|
||||||
if not self.exe:
|
if not self.exe:
|
||||||
|
@ -3905,7 +3909,7 @@ class PhantomJSwrapper(object):
|
||||||
self.extractor = extractor
|
self.extractor = extractor
|
||||||
|
|
||||||
if required_version:
|
if required_version:
|
||||||
version = get_exe_version(self.exe, version_re=r'([0-9.]+)')
|
version = self._version()
|
||||||
if is_outdated_version(version, required_version):
|
if is_outdated_version(version, required_version):
|
||||||
self.extractor._downloader.report_warning(
|
self.extractor._downloader.report_warning(
|
||||||
'Your copy of PhantomJS is outdated, update it to version '
|
'Your copy of PhantomJS is outdated, update it to version '
|
||||||
|
|
Loading…
Reference in a new issue