mirror of
https://github.com/darkzoul5/YoutubePlaylistSync.git
synced 2026-11-04 23:47:56 +02:00
fix: resolve core utility lint errors
This commit is contained in:
1 parent
b8acce7623
commit
b6fb314571
3 files changed
+7
-5
No files matched your search
@@ -28,7 +28,7 @@ def get_yt_dlp_version() -> str | None:
|
||||
|
||||
# yt-dlp exposes version in different places depending on install
|
||||
return getattr(yt_dlp, "__version__", None) or getattr(getattr(yt_dlp, "version", None), "__version__", None)
|
||||
except Exception:
|
||||
except (ImportError, AttributeError, TypeError):
|
||||
return None
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ def ensure_ffmpeg_available(ffmpeg_hint: str | None) -> tuple[str, str]:
|
||||
"""
|
||||
ffmpeg_exe = "ffmpeg.exe" if sys.platform.startswith("win") else "ffmpeg"
|
||||
|
||||
ffmpeg_path, ffmpeg_dir = _resolve_tool_paths(ffmpeg_hint, ffmpeg_exe)
|
||||
ffmpeg_path, _ = _resolve_tool_paths(ffmpeg_hint, ffmpeg_exe)
|
||||
if not ffmpeg_path:
|
||||
raise DependencyError("ffmpeg not found. Install ffmpeg or set 'ffmpeg_path' in config.")
|
||||
|
||||
|
||||
@@ -17,9 +17,11 @@ def _read_text(path: Path) -> str | None:
|
||||
if path.exists():
|
||||
text = path.read_text(encoding="utf-8").strip()
|
||||
return text or None
|
||||
except Exception:
|
||||
pass
|
||||
except (OSError, UnicodeError):
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def get_app_version() -> str:
|
||||
"""
|
||||
Returns the packaged app version.
|
||||
|
||||
@@ -10,5 +10,5 @@ def extract_playlist_id(url: str) -> str | None:
|
||||
if "list" in qs and qs.get("list"):
|
||||
return qs.get("list", [None])[0]
|
||||
return None
|
||||
except Exception:
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
Reference in new issue
Block a user