support other types of streams such as rtmp
This commit is contained in:
parent
2a95c597cc
commit
462d06e84a
@ -4,5 +4,5 @@ pkgs.python3Packages.buildPythonApplication {
|
|||||||
pname = "radio";
|
pname = "radio";
|
||||||
src = self;
|
src = self;
|
||||||
version = "0.1";
|
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 ];
|
||||||
}
|
}
|
||||||
|
2
radio.py
2
radio.py
@ -29,7 +29,7 @@ class Radio(object):
|
|||||||
info = downloader.getVideoInfo(self.playingUrl)
|
info = downloader.getVideoInfo(self.playingUrl)
|
||||||
if info is None:
|
if info is None:
|
||||||
return self.play()
|
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)
|
self.downloader = downloader.DirectDownloader(self.playingUrl, self.downloadFinished)
|
||||||
else:
|
else:
|
||||||
self.downloader = downloader.YtdlpDownloader(self.playingUrl, self.downloadFinished)
|
self.downloader = downloader.YtdlpDownloader(self.playingUrl, self.downloadFinished)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user