Skip to content

Commit

Permalink
✨ FFhelper: Added support for SRTP/RTSPS in is_valid_url function (F…
Browse files Browse the repository at this point in the history
…ixes #50)

- ⚡️ 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.
  • Loading branch information
abhiTronix committed Jun 23, 2024
1 parent 494b17d commit 621d1e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions deffcode/ffhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 621d1e6

Please sign in to comment.