Allows you to search for videos on youtube and automatically add the audio URLs to an MPD playlist
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

21 lines
609 B

module Playlists where
import qualified Data.Text as TIO
import System.Process (readProcess)
import Utils
getUrl :: TIO.Text -> IO String
-- Gets a direct url using youtube-dl
-- (if it is installed, otherwise we might fallback to some shitty code)
getUrl yourl = readProcess "youtube-dl"
["-g",
"-f",
"bestaudio",
TIO.unpack yourl,
"--no-cache-dir"] ""
downUrl yourl = readProcess "youtube-dl"
["-f",
"bestaudio",
TIO.unpack yourl,
"--no-cache-dir"] ""