From 462d06e84ab12b5690dbfd37e27bc5fc71bbaeee Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Wed, 8 Sep 2021 21:21:46 -0400 Subject: [PATCH] support other types of streams such as rtmp --- default.nix | 2 +- radio.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index a5ea8c2..cf81d8b 100644 --- a/default.nix +++ b/default.nix @@ -4,5 +4,5 @@ pkgs.python3Packages.buildPythonApplication { pname = "radio"; src = self; version = "0.1"; - propagatedBuildInputs = with pkgs.python3Packages; [ pip ffmpeg-python flask requests pkgs.ffmpeg pkgs.rtmpdump ]; + propagatedBuildInputs = with pkgs.python3Packages; [ pip ffmpeg-python flask requests pkgs.ffmpeg ]; } diff --git a/radio.py b/radio.py index 04c1332..9b1c023 100644 --- a/radio.py +++ b/radio.py @@ -29,7 +29,7 @@ class Radio(object): info = downloader.getVideoInfo(self.playingUrl) if info is None: return self.play() - elif "direct" in info and info["direct"] == True: + elif ("direct" in info and info["direct"] == True) or ("format_id" in info and info["format_id"] == "rtmp"): # stdout for rtmp in ytdl is broken self.downloader = downloader.DirectDownloader(self.playingUrl, self.downloadFinished) else: self.downloader = downloader.YtdlpDownloader(self.playingUrl, self.downloadFinished)