diff --git a/.gitignore b/.gitignore index 900b7a5..b2b0037 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ pom.xml.asc .hgignore .hg/ .calva +.clj-kondo +.lsp diff --git a/src/remcon/channels.clj b/src/remcon/channels.clj new file mode 100644 index 0000000..d22859b --- /dev/null +++ b/src/remcon/channels.clj @@ -0,0 +1,30 @@ +(ns remcon.channels) + +(defn make-general [addr] + {:address addr + ;:vid {:class "yayin-alani"} + :vid {:class "media"} + :autostarts true + :muted true}) + + +(def channels {"trt-muzik" (make-general "https://tv.canlitv.ing/trtmuzikcanli") + "tv8" {:address "https://www.tv8.com.tr/canli-yayin" + :vid {:id "AcunnPlayerContainer"} + :muted true + :autostarts true} + "show" (make-general "https://tv.canlitv.ing/show-tv-canli") + "star" (make-general "https://tv.canlitv.ing/startvcanli") + "kanald" {:address "https://www.kanald.com.tr/canli-yayin" + :vid {:id "playerArea"} + :muted true + :autostarts true} + "atv" {:address "https://www.atv.com.tr/canli-yayin" + :vid {:id "live"} + :muted true + :autostarts false} + "cn" (make-general "https://tv.canlitv.ing/cartoon-network") + "trt1" {:address "https://www.tabii.com/tr/watch/live/trt1" + :vid {:class "_Ehgxv"} + :muted false + :autostarts true}}) \ No newline at end of file diff --git a/src/remcon/core.clj b/src/remcon/core.clj index 13c7f5b..81c0342 100644 --- a/src/remcon/core.clj +++ b/src/remcon/core.clj @@ -2,43 +2,14 @@ (:gen-class)) (require '[etaoin.api :as e] - '[etaoin.keys :as k] - '[clojure.string :as str]) + 'remcon.channels) -(defn make-general [addr] - {:address addr - ;:vid {:class "yayin-alani"} - :vid {:class "media"} - :autostarts true - :muted true}) - -(def channels { - "trt-muzik" (make-general "https://tv.canlitv.ing/trtmuzikcanli") - "tv8" {:address "https://www.tv8.com.tr/canli-yayin" - :vid {:id "AcunnPlayerContainer"} - :muted true - :autostarts true} - "show" (make-general "https://tv.canlitv.ing/show-tv-canli") - "star" (make-general "https://tv.canlitv.ing/startvcanli") - "kanald" {:address "https://www.kanald.com.tr/canli-yayin" - :vid {:id "playerArea"} - :muted true - :autostarts true} - "atv" {:address "https://www.atv.com.tr/canli-yayin" - :vid {:id "live"} - :muted true - :autostarts false} - "cn" (make-general "https://tv.canlitv.ing/cartoon-network") - "trt1" {:address "https://www.tabii.com/tr/watch/live/trt1" - :vid {:class "_Ehgxv"} - :muted false - :autostarts true} - }) +; The actual map of channels is defined in remcon.channels +(refer 'remcon.channels :only ['channels]) (defn toggle-fs [driver ch] (e/double-click driver (:vid ch))) - (defmacro unless [pred & body] `(if (not ~pred) (do ~@body))) @@ -49,7 +20,6 @@ (e/wait driver 2) (unless (:autostarts ch) (e/click driver (:vid ch)) - ;(e/wait driver 3) ) (when (:muted ch) (if (not (:autostarts ch)) @@ -67,7 +37,6 @@ (toggle-fs d (get channels chname))) (defn -main - "I don't do a whole lot ... yet." [& args] (let [driver (if (= (first args) "ch") (e/chrome {:args ["start-maximized" "--no-sandbox" "--disable-dev-shm-usage"]})