diff --git a/yt_downloader/vpn.py b/yt_downloader/vpn.py index e99faeb..84bf0d5 100644 --- a/yt_downloader/vpn.py +++ b/yt_downloader/vpn.py @@ -62,7 +62,13 @@ def iface_name(cfg) -> str: def conf_path(cfg) -> Path: - return Path(cfg.vpn_wireguard).expanduser() + wg = getattr(cfg, "vpn_wireguard", None) + if not wg: + raise RuntimeError( + "no WireGuard config configured: set [vpn] wireguard in the config " + "(run 'yt-downloader init' and edit the file)" + ) + return Path(wg).expanduser() def _host_link(iface: str) -> str: