From 2a95c597ccc7160228b66eac1dda1944568cc2e9 Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Wed, 8 Sep 2021 21:09:31 -0400 Subject: [PATCH] support other types of streams such as rtmp --- default.nix | 2 +- radio.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index cf81d8b..a5ea8c2 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 ]; + propagatedBuildInputs = with pkgs.python3Packages; [ pip ffmpeg-python flask requests pkgs.ffmpeg pkgs.rtmpdump ]; } diff --git a/radio.py b/radio.py index ad5d248..04c1332 100644 --- a/radio.py +++ b/radio.py @@ -27,7 +27,9 @@ class Radio(object): def play(self): self.playingUrl = self.queue.get() info = downloader.getVideoInfo(self.playingUrl) - if info is None or ("direct" in info and info["direct"] == True): + if info is None: + return self.play() + elif "direct" in info and info["direct"] == True: self.downloader = downloader.DirectDownloader(self.playingUrl, self.downloadFinished) else: self.downloader = downloader.YtdlpDownloader(self.playingUrl, self.downloadFinished)