aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp
diff options
context:
space:
mode:
authorRobert Geislinger <mail@crpykng.de>2022-11-11 08:43:08 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-11-11 15:48:29 +0530
commit7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78 (patch)
tree46969d7a58f67b81c2670d667fc0be40626b1ee9 /yt_dlp
parent8522226d2fea04d48802a9ef402438ff79227fe4 (diff)
downloadhypervideo-pre-7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78.tar.lz
hypervideo-pre-7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78.tar.xz
hypervideo-pre-7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78.zip
[cleanup] Misc
Closes #5471, Closes #5312 Authored by: pukkandan, Alienmaster
Diffstat (limited to 'yt_dlp')
-rw-r--r--yt_dlp/__main__.py2
-rw-r--r--yt_dlp/extractor/slideslive.py1
-rw-r--r--yt_dlp/extractor/testurl.py2
-rw-r--r--yt_dlp/postprocessor/ffmpeg.py2
-rw-r--r--yt_dlp/update.py8
-rw-r--r--yt_dlp/utils.py4
6 files changed, 9 insertions, 10 deletions
diff --git a/yt_dlp/__main__.py b/yt_dlp/__main__.py
index ff5d71d3c..78701df8d 100644
--- a/yt_dlp/__main__.py
+++ b/yt_dlp/__main__.py
@@ -5,7 +5,7 @@
import sys
-if __package__ is None and not hasattr(sys, 'frozen'):
+if __package__ is None and not getattr(sys, 'frozen', False):
# direct call of __main__.py
import os.path
path = os.path.realpath(os.path.abspath(__file__))
diff --git a/yt_dlp/extractor/slideslive.py b/yt_dlp/extractor/slideslive.py
index 72ca56057..87d0fec32 100644
--- a/yt_dlp/extractor/slideslive.py
+++ b/yt_dlp/extractor/slideslive.py
@@ -9,6 +9,7 @@ from ..utils import (
class SlidesLiveIE(InfoExtractor):
_VALID_URL = r'https?://slideslive\.com/(?P<id>[0-9]+)'
+ _WORKING = False
_TESTS = [{
# video_service_name = YOUTUBE
'url': 'https://slideslive.com/38902413/gcc-ia16-backend',
diff --git a/yt_dlp/extractor/testurl.py b/yt_dlp/extractor/testurl.py
index 2bce3b239..dccca1004 100644
--- a/yt_dlp/extractor/testurl.py
+++ b/yt_dlp/extractor/testurl.py
@@ -21,7 +21,7 @@ class TestURLIE(InfoExtractor):
matching_extractors = [e for e in gen_extractor_classes() if rex.search(e.IE_NAME)]
if len(matching_extractors) == 0:
- raise ExtractorError('No extractors matching {extractor_id!r} found', expected=True)
+ raise ExtractorError(f'No extractors matching {extractor_id!r} found', expected=True)
elif len(matching_extractors) > 1:
try: # Check for exact match
extractor = next(
diff --git a/yt_dlp/postprocessor/ffmpeg.py b/yt_dlp/postprocessor/ffmpeg.py
index 7d55373e1..67890fc31 100644
--- a/yt_dlp/postprocessor/ffmpeg.py
+++ b/yt_dlp/postprocessor/ffmpeg.py
@@ -137,7 +137,7 @@ class FFmpegPostProcessor(PostProcessor):
path = self._paths.get(prog)
if path in self._version_cache:
return self._version_cache[path], self._features_cache.get(path, {})
- out = _get_exe_version_output(path, ['-bsfs'], to_screen=self.write_debug)
+ out = _get_exe_version_output(path, ['-bsfs'])
ver = detect_exe_version(out) if out else False
if ver:
regexs = [
diff --git a/yt_dlp/update.py b/yt_dlp/update.py
index 6208aad8a..ac3e28057 100644
--- a/yt_dlp/update.py
+++ b/yt_dlp/update.py
@@ -30,13 +30,13 @@ API_URL = f'https://api.github.com/repos/{REPOSITORY}/releases'
@functools.cache
def _get_variant_and_executable_path():
"""@returns (variant, executable_path)"""
- if hasattr(sys, 'frozen'):
+ if getattr(sys, 'frozen', False):
path = sys.executable
if not hasattr(sys, '_MEIPASS'):
return 'py2exe', path
- if sys._MEIPASS == os.path.dirname(path):
+ elif sys._MEIPASS == os.path.dirname(path):
return f'{sys.platform}_dir', path
- if sys.platform == 'darwin':
+ elif sys.platform == 'darwin':
machine = '_legacy' if version_tuple(platform.mac_ver()[0]) < (10, 15) else ''
else:
machine = f'_{platform.machine().lower()}'
@@ -288,7 +288,7 @@ class Updater:
# There is no sys.orig_argv in py < 3.10. Also, it can be [] when frozen
if getattr(sys, 'orig_argv', None):
return sys.orig_argv
- elif hasattr(sys, 'frozen'):
+ elif getattr(sys, 'frozen', False):
return sys.argv
def restart(self):
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 4c44f4845..04a0956c9 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -2698,9 +2698,7 @@ def check_executable(exe, args=[]):
return exe
-def _get_exe_version_output(exe, args, *, to_screen=None):
- if to_screen:
- to_screen(f'Checking exe version: {shell_quote([exe] + args)}')
+def _get_exe_version_output(exe, args):
try:
# STDIN should be redirected too. On UNIX-like systems, ffmpeg triggers
# SIGTTOU if yt-dlp is run in the background.