summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-06-05 22:36:18 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-06-05 22:36:18 -0700
commitcc49f58b0e702b62f938fd661df7f7e8abd15346 (patch)
tree8d912b6a1511ddfdb06c3b3989b244a9a2ebe5a1
parent660b894b8616e10839db87282d65b2ef3efec1c2 (diff)
remove dyafk related, dyafk useless, not count as watch time
-rw-r--r--Makefile2
-rwxr-xr-xsh/dyafk27
2 files changed, 1 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index 2c6a0bb..7310bd9 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@
# For a command not to echo itself, prefix @ to the command
# https://unix.stackexchange.com/a/740226/459013
-SH = alarm backlight bell ccgp cfg chmodef curlqb dateft dirnameall gita gitfork gitmetap gitmetar gitpu grrc il lastarg loop lsp mll mmi mpra mpva mpvy mvln mvtr mvtu news o orgext pa pq px qg qw rate reco rfp sbar ta time-uuid topa upd vinfo wh wtr xmq prp vip vpn dnd cgm ggm ccp u dyafk
+SH = alarm backlight bell ccgp cfg chmodef curlqb dateft dirnameall gita gitfork gitmetap gitmetar gitpu grrc il lastarg loop lsp mll mmi mpra mpva mpvy mvln mvtr mvtu news o orgext pa pq px qg qw rate reco rfp sbar ta time-uuid topa upd vinfo wh wtr xmq prp vip vpn dnd cgm ggm ccp u
PACMAN_HOOKS = setcap-intel_gpu_top.hook setcap-iotop-c.hook setcap-nethogs.hook
PREFIX = /usr/local
diff --git a/sh/dyafk b/sh/dyafk
deleted file mode 100755
index caf1c66..0000000
--- a/sh/dyafk
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-# DouYu AFK
-
-# maybe another way: https://open.douyu.com/source
-
-pid=
-while :; do
- # credit: MIT licensed https://github.com/DIYgod/RSSHub/blob/master/lib/routes/douyu/room.ts
- if [ "$(curl -s https://www.douyu.com/betard/9640128 | jq '.room.show_status')" -eq 1 ]; then
- if ! pidof -q firefox; then
- firefox --headless --profile "$HOME/.mozilla/firefox/dyafk" https://www.douyu.com/9640128 &
- # assign previous background process to pid variable
- pid=$!
- fi
- else
- if [ "$pid" ]; then
- # seems need to only SIGTERM kill the parent firefox process, else firefox will prompt me firefox closed unexpectedly warning which cause firefox not actually open the url
- # https://www.reddit.com/r/firefox/comments/fq1mhi/kill_firefox_gracefully_via_terminal_headless/
- # firefox seems now can handle SIGTERM on linux? https://bugzilla.mozilla.org/show_bug.cgi?id=1837907
- kill "$pid"
- pid=
- fi
- fi
- # open.douyu.com AUP for api request seems very high, about 6k/min per api? see https://open.douyu.com/source/api/5
- # although I don't use open.douyu.com api but can be used as a reference, so I think 1 request per minute is ok
- sleep 60
-done