kino/app/Main.hs

21 lines
389 B
Haskell
Raw Normal View History

2021-09-05 19:30:29 +02:00
module Main where
import Request
2021-09-06 21:02:39 +02:00
import qualified JSONTypes as J
import Torrent
import qualified Data.Text as T
import System.Environment
2021-09-05 19:30:29 +02:00
main :: IO ()
2021-09-06 21:02:39 +02:00
main = do
args <- getArgs
case args of
([]) -> print =<< getMovies
(x:xs) -> do
movies <- queryMovies (T.pack x)
case movies of
(Left m) -> print m
(Right d) -> mapM_ printMagnets (J.movies d)