Compare commits

..

1 Commits
v0.1.0 ... main

3 changed files with 35 additions and 34 deletions

2
.gitignore vendored
View File

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

30
src/remcon/channels.clj Normal file
View File

@ -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}})

View File

@ -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"]})