1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-01-05 22:41:18 +00:00
Files
yt-dlp/yt_dlp/downloader/sabr/__init__.py
2025-06-21 11:15:25 +12:00

25 lines
689 B
Python

from __future__ import annotations
from yt_dlp.dependencies import protobug
from yt_dlp.utils import DownloadError
from yt_dlp.downloader import FileDownloader
if not protobug:
class SabrFD(FileDownloader):
@classmethod
def can_download(cls, info_dict):
is_sabr = (
info_dict.get('requested_formats')
and all(
format_info.get('protocol') == 'sabr'
for format_info in info_dict['requested_formats']))
if is_sabr:
raise DownloadError('SABRFD requires protobug to be installed')
return is_sabr
else:
from ._fd import SabrFD # noqa: F401