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 .hgignore
.hg/ .hg/
.calva .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)) (:gen-class))
(require '[etaoin.api :as e] (require '[etaoin.api :as e]
'[etaoin.keys :as k] 'remcon.channels)
'[clojure.string :as str])
(defn make-general [addr] ; The actual map of channels is defined in remcon.channels
{:address addr (refer 'remcon.channels :only ['channels])
;: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] (defn toggle-fs [driver ch]
(e/double-click driver (:vid ch))) (e/double-click driver (:vid ch)))
(defmacro unless [pred & body] (defmacro unless [pred & body]
`(if (not ~pred) `(if (not ~pred)
(do ~@body))) (do ~@body)))
@ -49,7 +20,6 @@
(e/wait driver 2) (e/wait driver 2)
(unless (:autostarts ch) (unless (:autostarts ch)
(e/click driver (:vid ch)) (e/click driver (:vid ch))
;(e/wait driver 3)
) )
(when (:muted ch) (when (:muted ch)
(if (not (:autostarts ch)) (if (not (:autostarts ch))
@ -67,7 +37,6 @@
(toggle-fs d (get channels chname))) (toggle-fs d (get channels chname)))
(defn -main (defn -main
"I don't do a whole lot ... yet."
[& args] [& args]
(let [driver (if (= (first args) "ch") (let [driver (if (= (first args) "ch")
(e/chrome {:args ["start-maximized" "--no-sandbox" "--disable-dev-shm-usage"]}) (e/chrome {:args ["start-maximized" "--no-sandbox" "--disable-dev-shm-usage"]})