From 621d1e6d16c76c29685626e3ef5357eeaf81f303 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Sun, 23 Jun 2024 20:26:38 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20FFhelper:=20Added=20support=20for?= =?UTF-8?q?=20SRTP/RTSPS=20in=20`is=5Fvalid=5Furl`=20function=20(Fixes=20#?= =?UTF-8?q?50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ⚡️ Enhanced `is_valid_url` to recognize and support both `rtsp` and `rtsps` protocols. - 💬 SRTP/RTSPS extends RTSP/RTP to encrypt video and audio data using the same ciphers as HTTPS, typically AES with a 128-bit key length. --- deffcode/ffhelper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deffcode/ffhelper.py b/deffcode/ffhelper.py index 0271861..084c5d6 100644 --- a/deffcode/ffhelper.py +++ b/deffcode/ffhelper.py @@ -635,8 +635,11 @@ def is_valid_url(path, url=None, verbose=False): protocols = check_sp_output([path, "-hide_banner", "-protocols"]) splitted = [x.decode("utf-8").strip() for x in protocols.split(b"\n")] supported_protocols = splitted[splitted.index("Output:") + 1 : len(splitted) - 1] - # rtsp is a demuxer somehow - supported_protocols += ["rtsp"] if "rtsp" in get_supported_demuxers(path) else [] + # RTSP is a demuxer somehow + # support both RTSP and RTSPS(over SSL) + supported_protocols += ( + ["rtsp", "rtsps"] if "rtsp" in get_supported_demuxers(path) else [] + ) # Test and return result whether scheme is supported if extracted_scheme_url and extracted_scheme_url in supported_protocols: verbose and logger.debug(