Говнячить одноразовые скрипты на хачкиле довольно удобно получается, не хуже бидона какого-нибудь.
Захотел скачать видосы отсюда: https://www.scss.tcd.ie/Edsko.de.Vries/ct/catsters/linear.php
Prelude> page <- readFile "linear.php" (лол, HTTP-4000 не может в https)
Prelude> :m + Text.HTML.TagSoup
Prelude Text.HTML.TagSoup> let a = [x | x@(TagOpen "a" _) <- parseTags page]
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package tagsoup-0.12.8 ... linking ... done.
Prelude Text.HTML.TagSoup> let a' = filter ((TagOpen "a" xs) -> maybe False (isInfixOf "youtube") (lookup "href" xs)) a
<interactive>:5:52: Not in scope: `isInfixOf'
Prelude Text.HTML.TagSoup> :m + Data.List
Prelude Text.HTML.TagSoup Data.List> let a' = filter ((TagOpen "a" xs) -> maybe False (isInfixOf "youtube") (lookup "href" xs)) a
Prelude Text.HTML.TagSoup Data.List> let a'' = map ((TagOpen "a" xs) -> fromJust $ lookup "href" xs) a'
<interactive>:8:37: Not in scope: `fromJust'
Prelude Text.HTML.TagSoup Data.List> :m + Data.Maybe
Prelude Text.HTML.TagSoup Data.List Data.Maybe> let a'' = map ((TagOpen "a" xs) -> fromJust $ lookup "href" xs) a'
Prelude Text.HTML.TagSoup Data.List Data.Maybe> :m + System.Process
Prelude Text.HTML.TagSoup Data.List Data.Maybe System.Process> mapM_ (\u -> system $ "youtube-dl " ++ u) a''