pgdl 6.6 → 6.7
raw patch · 4 files changed
+15/−16 lines, 4 filesdep +Cabal
Dependencies added: Cabal
Files
- README +0/−3
- README.md +7/−0
- pgdl.cabal +3/−7
- src/PlayVid.hs +5/−6
− README
@@ -1,3 +0,0 @@-# pgdl-a terminal user interface program that downloads a video from html and plays immediately.-
+ README.md view
@@ -0,0 +1,7 @@+# pgdl+a terminal user interface program that downloads a video from html and plays immediately.(Calling vlc)++Only for Linux and MACOSX.++It parses a remote html file which has link tag & filename tag in the same line.+
pgdl.cabal view
@@ -1,13 +1,13 @@ name: pgdl-version: 6.6+version: 6.7 license: PublicDomain license-file: LICENSE author: sifmelcara maintainer: sifmelcara category: Network build-type: Simple-extra-source-files: README+extra-source-files: README.md cabal-version: >=1.10 description: a terminal user interface program that downloads a video from html and plays immediately.(Calling vlc) .@@ -25,16 +25,12 @@ hs-source-dirs: src main-is: Main.hs other-modules: Beaut, Chkcfg, FetchHtml, Getconfig, Log, PlayVid, PrsVid, Search, Video - -- other-extensions: build-depends: base == 4.* , split, process, directory, http-conduit >= 2.0.0, bytestring, transformers, resourcet, tagsoup, vty, text, vty-ui >= 1.8, configurator >= 0.3.0.0,- filepath, binary >= 0.7.0.0+ filepath, binary >= 0.7.0.0, Cabal ghc-options: -threaded -O2- if !os(linux)- CC-Options: "-D__MACOSX__"- -- hs-source-dirs: default-language: Haskell2010
src/PlayVid.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE CPP #-} module PlayVid where @@ -13,6 +12,7 @@ import System.IO import Video import System.Exit+import Distribution.System playVid :: Video -> IO () playVid vid = do@@ -30,11 +30,10 @@ runCommand $ "nohup curl " ++ addq url ++ " -o " ++ addq localloc ++ "&>/dev/null &" let checkFile = doesFileExist localloc >>= \ready -> unless ready checkFile checkFile-#if __MACOSX__- runCommand $ "open " ++ addq localloc ++ " -a vlc"-#else- runCommand $ "nohup vlc -f " ++ addq localloc ++ " &>/dev/null &"-#endif+ case buildOS of+ OSX -> runCommand $ "open " ++ addq localloc ++ " -a vlc"+ Linux -> runCommand $ "nohup vlc -f " ++ addq localloc ++ " &>/dev/null &"+ _ -> error "OS unsupported!" exitSuccess where vn = T.unpack . vidName $ vid vu = T.unpack . vidLink $ vid