vincelwt / RaspberryCast

:tv: Transform your Raspberry Pi into a streaming device. Videos can be sent from mobile devices or computers (Chrome extension).
MIT License
869 stars 141 forks source link

[enhancement] Add streamlink as a alternative to youtube-dl #69

Open jiahaoliang opened 6 years ago

jiahaoliang commented 6 years ago

streamlink is similar to youtube-dl in many different ways.

Although the video sources they supported are mostly the same, there are still some plugins available in streamlink that is missing in youtube-dl (live stream from douyu.com or 1080p from youtube for example). Also it's always a good thing to add a duplicate extractor in case youtube-dl is broken in any way.

On Raspberry Pi, I can simply pipe streamlink and omxplayer to make it work # streamlink -p "omxplayer --timeout 20" https://www.youtube.com/watch?v=QMDf5MSE0LQ best

[console][info] Found matching plugin youtube for URL https://www.youtube.com/watch?v=QMDf5MSE0LQ [console][info] Available streams: audio_mp4, audio_webm, 144p (worst), 180p, 360p, 720p, 1080p (best) [console][info] Opening stream: 1080p (muxed-stream) [console][info] Creating pipe streamlinkpipe-23988 [console][info] Starting player: omxplayer --timeout 20 ....(omxplayer plays it as expected)

Interested in exploring how to add streamlink as a secondary extractor as well as a general framework to integrate other extractors in the future.

Hints and guidelines are always appreciated.

mheine commented 6 years ago

Looks interesting! I've have some trouble with stuttering playback from livestreams on twitch.tv, so this might be another option. My suggestion would be to add a configuration option that sets the extractor to streamlink (but where the default would still be youtube-dl)

jarondl commented 6 years ago

Seems like @vincelwt started something in the past (in c4f76b9cc60bb63a1dc0cc5849f3c873b577b765 livestreamer is the predecessor of streamlink).

This seems like a great idea, but I would try to use their Python API instead of calling the cli.