Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

3 changed files with 34 additions and 35 deletions

2
.gitignore vendored
View File

@ -12,5 +12,3 @@ pom.xml.asc
.hgignore
.hg/
.calva
.clj-kondo
.lsp

View File

@ -1,30 +0,0 @@
(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}})

View File

@ -2,14 +2,43 @@
(:gen-class))
(require '[etaoin.api :as e]
'remcon.channels)
'[etaoin.keys :as k]
'[clojure.string :as str])
; The actual map of channels is defined in remcon.channels
(refer 'remcon.channels :only ['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}
})
(defn toggle-fs [driver ch]
(e/double-click driver (:vid ch)))
(defmacro unless [pred & body]
`(if (not ~pred)
(do ~@body)))
@ -20,6 +49,7 @@
(e/wait driver 2)
(unless (:autostarts ch)
(e/click driver (:vid ch))
;(e/wait driver 3)
)
(when (:muted ch)
(if (not (:autostarts ch))
@ -37,6 +67,7 @@
(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"]})