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)