README 🥚

⎗
✓
# Install (はじめに)
- 「JAYA」を「ダウンロード」
- 「JAYA」を「ドキュメント」へ
> sudo install -v -m 0755 jaya* /usr/local/bin

# Jayachk (オプション)
> cd ~/ドキュメント && sh -x jayachk
- シェルの構文チェックや差分をチェック。

# Jayakit (オプション)
> sudo jayakit
- システム設定、既知の脆弱性、Rootkitの検査。

# Jayauns (オプション)
> env NET=1 jayauns firefox
- Root、Networkが使えない、隔離された環境の構築。

# Jayamac (オプション)
> sudo jayamac
- リース履歴を消去し、MACアドレスをランダム化します。

# Jayadns (オプション)
> sudo jayadns
- DNSの設定と、「Cloudflare DoH Onion」を構築します。

# Jayanta (最初に一度だけ実行)
> sudo jayanta debian-tor privoxy
- コアシステム。TOR透過プロキシとRAWプロキシの構築。
- ホストから出るHTTP{S}通信がTorを経由するようになります。

# Jayaraw (アプリケーション起動の際)
> sudo L='ja_JP.UTF-8' jayaraw dbus-run-session env ROOT=1 NET=1 jayauns sh -c 'home='/tmp/.jaraw'; mkdir -p "$home"; [ -f "$HOME/.Xauthority" ] && cp "$HOME/.Xauthority" "$home"; mount --bind "$home" "$HOME"; cd; firefox'
- RAW強制空間。(DNSもWebRTCも全てを許可する。)
- 隔離空間を作りその空間内から出る通信は、生IPで通信を行います。

# Jayator (アプリケーション起動の際)
> sudo L='ja_JP.UTF-8' jayator dbus-run-session env ROOT=1 NET=1 jayauns sh -c 'home='/tmp/.jator'; mkdir -p "$home"; [ -f "$HOME/.Xauthority" ] && cp "$HOME/.Xauthority" "$home"; mount --bind "$home" "$HOME"; cd; firefox'
- TOR強制空間。(IPリークは論理的に不可能です。)
- Jayatorは、Root権限奪取や、FWリセットなどを想定して設計されています。

CONFIG 🐣

⎗
✓
# yt-dlp

pipx install yt-dlp

nvim ~/.config/yt-dlp/config

-S res:480
--js-runtimes node
--remote-components ejs:github
-f 'bv+ba[language=ja]/bestvideo+bestaudio/best'

# sudoers

su -c 'gpasswd -a "$USER" wheel'
su -c 'nvim /etc/sudoers.d/jayanta'

Defaults env_keep += "A L"
%wheel ALL=(ALL:ALL) NOPASSWD: /usr/local/bin/jayaraw
%wheel ALL=(ALL:ALL) NOPASSWD: /usr/local/bin/jayator

JAYACHK 🪶

⎗
✓
#!/bin/sh

# PROJECT: Jayachk
# UPDATES: 2026-07-22 12:03:01 JST
# LICENSE: The Unlicense (unlicense.org)

PATH='/usr/sbin:/usr/bin:/sbin:/bin'
type shellcheck || exit 1; cd "$HOME/ドキュメント" || exit 2

for f in jaya*; do
  [ -f "$f" ] || exit 3
  shellcheck "$f" || exit 4
  diff -u "/usr/local/bin/$f" "$f"; case $? in 0|1) ;; *) exit 5 ;; esac
done

JAYAKIT 🪽

⎗
✓
1
2
3
4
5
6
7
8
9
#!/bin/sh

# PROJECT: Jayakit
# UPDATES: 2026-08-19 19:17:17 JST
# LICENSE: The Unlicense (unlicense.org)

PATH='/usr/sbin:/usr/bin:/sbin:/bin'; export TMPDIR='/var/tmp'
[ "$(id -u)" -eq 0 ] || exit 1; type lynis trivy rkhunter chkrootkit || exit 2; install -d -m 1777 /var/tmp || exit 3
lynis audit system; trivy rootfs / --scanners vuln; rkhunter --update; rkhunter --sk --check; chkrootkit 2>/dev/null | grep --color='always' -E 'Warning|INFECTED'

JAYAUNS 🐓

⎗
✓
1
2
3
4
5
6
7
8
9
#!/bin/sh

# PROJECT: Jayauns
# UPDATES: 2026-09-25 17:24:23 JST
# LICENSE: The Unlicense (unlicense.org)

PATH='/usr/sbin:/usr/bin:/sbin:/bin'; [ "${ROOT:-0}" = "0" ] || map='--map-root-user'; [ "${NET:-0}" = "0" ] || net='--'
[ "$(id -u)" -ne 0 ] || exit 1; type unshare || exit 2; [ "$(readlink /proc/self/ns/user)" != "$(readlink /proc/1/ns/user)" ] || exit 3
exec unshare --uts --ipc --pid --fork --time --cgroup --kill-child --user "${map:---map-current-user}" --mount --mount-proc --propagation private "${net:---net}" setpriv --no-new-privs env 'PATH=/usr/local/bin:/usr/bin:/bin' sh -c 'printf "\033]12;#6666ff\007"; "$@"; sleep 1; printf "\033]112\007"' sh "${@:-bash}"

JAYAMAC 🦉

⎗
✓
#!/bin/sh

# PROJECT: Jayamac
# UPDATES: 2026-07-12 13:21:39 JST
# LICENSE: The Unlicense (unlicense.org)

PATH='/usr/sbin:/usr/bin:/sbin:/bin'
[ "$(id -u)" -eq 0 ] || exit 1; type macchanger || exit 2
rm -rfv -- /var/db/dhcp* /var/lib/dhcp* /var/lib/NetworkManager || exit 3

for f in /sys/class/net/*; do
  i="${f##*/}"
  [ "$i" != "lo" ] || continue
  [ -e "$f/device" ] || continue
  ip link set dev "$i" down || continue

  {
    ip addr flush dev "$i" &&
    ip neigh flush dev "$i"
  } || echo "fail: ip: $i" >&2

  macchanger -A "$i" || echo "fail: mac: $i" >&2
  ip link set dev "$i" up && echo "good: up: $i"
done

JAYADNS 🐦‍🔥

⎗
✓
#!/bin/sh

# PROJECT: Jayadns
# UPDATES: 2026-10-01 13:17:21 JST
# LICENSE: The Unlicense (unlicense.org)

PATH='/usr/sbin:/usr/bin:/sbin:/bin'; DNS='127.0.0.1'; RAW='1.1.1.1'; TOR='198.18.3.0'
[ "$(id -u)" -eq 0 ] || exit 1; type tor dnsmasq dnscrypt-proxy || exit 2; mkdir -pv /etc/netns/jaraw /etc/netns/jator || exit 3

echo "nameserver $DNS" > /etc/resolv.conf; cat /etc/resolv.conf
echo "nameserver $RAW" > /etc/netns/jaraw/resolv.conf; cat /etc/netns/jaraw/resolv.conf
echo "nameserver $TOR" > /etc/netns/jator/resolv.conf; cat /etc/netns/jator/resolv.conf

{
  echo "server=/onion/127.0.0.1#9053"
  echo "server=127.0.0.1#5053"
  echo "listen-address=127.0.0.1"
  echo "bind-interfaces"
  echo "proxy-dnssec"
  echo "no-resolv"
  echo "port=53"
} > /etc/dnsmasq.conf; cat /etc/dnsmasq.conf
{ sv restart dnsmasq || service dnsmasq restart || systemctl restart dnsmasq || rc-service dnsmasq restart; } >/dev/null 2>&1

{
  echo "listen_addresses = ['127.0.0.1:5053']"
  echo "server_names = ['cloudflare']"
  echo "proxy = 'socks5://127.0.0.1:9050'"
  echo "force_tcp = true"
  echo "[static]"
  echo "[static.cloudflare]"
  echo "stamp = 'sdns://AgcAAAAAAAAAAAA-ZG5zNHRvcnBubGZzMmlmdXoyczJ5ZjNmYzdyZG1zYmhtNnJ3NzVldWozNXBhYzZhcDI1emdxYWQub25pb24KL2Rucy1xdWVyeQ'"
} > /etc/dnscrypt-proxy/dnscrypt-proxy.toml; cat /etc/dnscrypt-proxy/dnscrypt-proxy.toml
{ sv restart dnscrypt-proxy || service dnscrypt-proxy restart || systemctl restart dnscrypt-proxy || rc-service dnscrypt-proxy restart; } >/dev/null 2>&1

JAYANTA 🐦‍⬛

⎗
✓
#!/bin/sh

# PROJECT: Jayanta
# UPDATES: 2026-10-01 08:36:02 JST
# LICENSE: The Unlicense (unlicense.org)

PATH='/usr/sbin:/usr/bin:/sbin:/bin'
TOR="${1:-tor}"; RAW="${2:-privoxy}"; NNS="$(ip netns identify)"

[ "$(id -u)" -eq 0 ] || exit 1; type nft tor conntrack || exit 2
[ -z "$NNS" ] || exit 3; ln -sfv /usr/share/zoneinfo/Etc/UTC /etc/localtime || exit 4
( id "$TOR" && id "$RAW" ) || { echo 'sudo sh jayanta [debian-]tor[anon] priv[tinypr]oxy'; exit 5; }
sysctl net.ipv4.ip_forward=0 net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 || exit 6

for t in nat filter; do nft add table inet $t; nft flush table inet $t; done
nft add chain inet nat output '{ type nat hook output priority dstnat; policy accept; }'
for c in input output forward; do nft add chain inet filter $c "{ type filter hook $c priority filter; policy drop; }"; done; conntrack -F expect; conntrack -F
nft add set inet nat reserved '{ type ipv4_addr; flags interval; elements = { 0.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.88.99.0/24, 192.168.0.0/16, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 240.0.0.0/4 }; }'

nft add rule inet nat output ip daddr != 127.0.0.1 udp dport 53 redirect to 9053
nft add rule inet nat output ip daddr 10.192.0.0/10 tcp dport '{ 80, 443 }' tcp flags syn / fin,syn,rst,ack redirect to 9040
nft add rule inet nat output skuid != "{ $TOR, $RAW }" oifname != "lo" ip daddr != @reserved tcp dport '{ 80, 443 }' tcp flags syn / fin,syn,rst,ack redirect to 9040

nft add rule inet filter input ct state vmap '{ invalid : drop, established : accept }'
nft add rule inet filter input ct state new iifname "lo" ip daddr 127.0.0.1 accept

nft add rule inet filter output ct state vmap '{ invalid : drop, established : accept }'
nft add rule inet filter output ct state new ip daddr 127.0.0.1 meta l4proto . th dport vmap '{ udp . 9053 : accept, tcp . 9040 : accept, tcp . 9050 : accept }'
nft add rule inet filter output ct state new tcp dport 443 tcp flags syn / fin,syn,rst,ack skuid "{ $TOR, $RAW }" accept
nft add rule inet filter output ct state new oifname "lo" ip daddr 127.0.0.1 accept; nft list ruleset

{
  echo "SafeSocks 1"
  echo "ReachableAddresses *:443"
  echo "User $TOR"
  echo "DataDirectory /var/lib/tor"
  echo "DNSPort 9053"
  echo "AutomapHostsOnResolve 1"
  echo "AutomapHostsSuffixes .onion"
  echo "VirtualAddrNetworkIPv4 10.192.0.0/10"
  echo "TransPort 9040 IsolateClientAddr IsolateClientProtocol IsolateDestAddr IsolateDestPort"
  echo "SocksPort 9050 IsolateClientAddr IsolateClientProtocol IsolateDestAddr IsolateDestPort"
} > /etc/tor/torrc; cat /etc/tor/torrc
{ sv restart tor || service tor restart || systemctl restart tor || rc-service tor restart; } >/dev/null 2>&1

JAYARAW 🕊️

⎗
✓
#!/bin/sh

# PROJECT: Jayaraw
# UPDATES: 2026-09-25 17:23:55 JST
# LICENSE: The Unlicense (unlicense.org)

set -eu; stty sane
PATH='/usr/sbin:/usr/bin:/sbin:/bin'; USR="${SUDO_USER:-${DOAS_USER:-}}"; NNS="$(ip netns identify)"
case "$USR" in ''|root) exit 1 ;; esac; type nft || exit 2
[ -z "$NNS" ] || exit 3; ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime || exit 4
printf '\033[31m█\033[0m Leak IP [Yes/no]: '; read -r YN; case "$YN" in [Yy]*) ;; *) exit 5 ;; esac
sysctl -q net.ipv4.ip_forward=0 net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 || exit 6

ip netns list | grep -qw jaraw || ip netns add jaraw
ip -n jaraw link show raw-veth1 >/dev/null 2>&1 || {
  ip link add raw-veth0 type veth peer name raw-veth1
  ip link set raw-veth1 netns jaraw
}
ip addr replace 198.18.1.0/31 dev raw-veth0
ip link set lo up; ip link set raw-veth0 up
ip -n jaraw addr replace 198.18.1.1/31 dev raw-veth1
ip -n jaraw link set lo up; ip -n jaraw link set raw-veth1 up
ip -n jaraw route replace default via 198.18.1.0 dev raw-veth1

nft add table inet nat
nft add chain inet nat postrouting '{ type nat hook postrouting priority srcnat; policy accept; }'
nft flush chain inet nat postrouting
nft add rule inet nat postrouting iifname "raw-veth0" ip saddr 198.18.1.1 masquerade

nft add table inet filter
nft add chain inet filter forward '{ type filter hook forward priority filter; policy drop; }'
nft flush chain inet filter forward
nft add rule inet filter forward ct state vmap '{ invalid : drop, established : accept }'
nft add rule inet filter forward ct state new iifname "raw-veth0" ip saddr 198.18.1.1 accept

[ "${A:-0}" = "0" ] || adm='--'
CAPS='-bpf,-net_raw,-net_admin,-sys_rawio,-sys_admin,-sys_ptrace,-sys_module'; IM='fcitx'
for i in all default lo raw-veth1; do ip netns exec jaraw sysctl -q net.ipv6.conf.$i.disable_ipv6=1 || exit 7; done; sysctl -q net.ipv4.conf.raw-veth0.rp_filter=1 net.ipv4.conf.raw-veth0.forwarding=1 net.ipv4.conf."$(ip route get 1.1.1.1 | awk '{print $5; exit}')".forwarding=1 || exit 8
exec ip netns exec jaraw setpriv --inh-caps="$CAPS" --ambient-caps="$CAPS" --bounding-set="$CAPS" "${adm:---no-new-privs}" runuser -u "$USR" -- env "LANG=${L:-en_US.UTF-8}" "GTK_IM_MODULE=$IM" "QT_IM_MODULE=$IM" "XMODIFIERS=@im=$IM" "XDG_RUNTIME_DIR=/run/user/$(id -u "$USR")" 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' sh -c 'printf "\033]10;#ff6666\007"; "$@"; sleep 1; printf "\033]110\007"' sh "${@:-bash}"

JAYATOR 🦅

⎗
✓
#!/bin/sh

# PROJECT: Jayator
# UPDATES: 2026-09-25 17:23:59 JST
# LICENSE: The Unlicense (unlicense.org)

set -eu; stty sane
PATH='/usr/sbin:/usr/bin:/sbin:/bin'; USR="${SUDO_USER:-${DOAS_USER:-}}"; NNS="$(ip netns identify)"
case "$USR" in ''|root) exit 1 ;; esac; type nft tor || exit 2
[ -z "$NNS" ] || exit 3; ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime || exit 4
printf '\033[32m█\033[0m Hide IP [Yes/no]: '; read -r YN; case "$YN" in ''|[Yy]*) ;; *) exit 5 ;; esac
sysctl -q net.ipv4.ip_forward=0 net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 || exit 6

ip rule list |
grep -Eq 'iif tor-veth0.*blackhole' ||
ip rule add pref 1 iif tor-veth0 blackhole

ip netns list | grep -qw jator || ip netns add jator
ip -n jator link show tor-veth1 >/dev/null 2>&1 || {
  ip link add tor-veth0 type veth peer name tor-veth1
  ip link set tor-veth1 netns jator
}
ip addr replace 198.18.3.0/31 dev tor-veth0
ip link set lo up; ip link set tor-veth0 up
ip -n jator addr replace 198.18.3.1/31 dev tor-veth1
ip -n jator link set lo up; ip -n jator link set tor-veth1 up
ip -n jator route replace default via 198.18.3.0 dev tor-veth1

nft add table inet nat
nft add chain inet nat prerouting '{ type nat hook prerouting priority dstnat; policy accept; }'
nft flush chain inet nat prerouting
nft add rule inet nat prerouting iifname "tor-veth0" ip saddr 198.18.3.1 udp dport 53 dnat ip to 198.18.3.0:9053
nft add rule inet nat prerouting iifname "tor-veth0" ip saddr 198.18.3.1 tcp dport '{ 80, 443 }' tcp flags syn / fin,syn,rst,ack dnat ip to 198.18.3.0:9040

nft add table inet filter
for c in input forward; do nft add chain inet filter $c "{ type filter hook $c priority filter; policy drop; }"; done
nft flush chain inet filter input
nft add rule inet filter input ct state vmap '{ invalid : drop, established : accept }'
nft add rule inet filter input ct state new iifname "tor-veth0" ip saddr 198.18.3.1 ip daddr 198.18.3.0 meta l4proto . th dport vmap '{ udp . 9053 : accept, tcp . 9040 : accept, tcp . 9050 : accept }'
nft add rule inet filter input ct state new iifname "lo" ip daddr 127.0.0.1 accept

while IFS= read -r line; do grep -Fqx -- "$line" /etc/tor/torrc || echo "$line" >> /etc/tor/torrc
done <<'EOF'
SafeSocks 1
DNSPort 198.18.3.0:9053
TransPort 198.18.3.0:9040 IsolateClientAddr IsolateClientProtocol IsolateDestAddr IsolateDestPort
SocksPort 198.18.3.0:9050 IsolateClientAddr IsolateClientProtocol IsolateDestAddr IsolateDestPort
EOF
{ sv restart tor || service tor restart || systemctl restart tor || rc-service tor restart; } >/dev/null 2>&1

[ "${A:-0}" = "0" ] || adm='--'
CAPS='-bpf,-net_raw,-net_admin,-sys_rawio,-sys_admin,-sys_ptrace,-sys_module'; IM='fcitx'
for i in all default lo tor-veth1; do ip netns exec jator sysctl -q net.ipv6.conf.$i.disable_ipv6=1 || exit 7; done; sysctl -q net.ipv4.conf.tor-veth0.rp_filter=1 net.ipv4.conf.tor-veth0.forwarding=0 net.ipv4.conf."$(ip route get 1.1.1.1 | awk '{print $5; exit}')".forwarding=1 || exit 8
exec ip netns exec jator setpriv --inh-caps="$CAPS" --ambient-caps="$CAPS" --bounding-set="$CAPS" "${adm:---no-new-privs}" runuser -u "$USR" -- env "LANG=${L:-en_US.UTF-8}" "GTK_IM_MODULE=$IM" "QT_IM_MODULE=$IM" "XMODIFIERS=@im=$IM" "XDG_RUNTIME_DIR=/run/user/$(id -u "$USR")" 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' sh -c 'printf "\033]10;#66ff66\007"; "$@"; sleep 1; printf "\033]110\007"' sh "${@:-bash}"

JAYAYTD 🦩

⎗
✓
#!/bin/sh

# PROJECT: Jayaytd
# UPDATES: 2026-08-06 18:35:11 JST
# LICENSE: The Unlicense (unlicense.org)

PATH="$HOME/.local/bin:$PATH"; pipe="$(printf '\037')"; mode='search'; type fzf mpv curl chafa ffmpeg yt-dlp || exit 1
printf 'query: '; read -r query; [ -n "$query" ] || exit 2; default="$query"; channel=''; line="${1:-20}"; page=1

while :; do
  case "$mode" in
    videos) src="$query/videos" ;;
    shorts) src="$query/shorts" ;;
    stream) src="$query/streams" ;;
    releas) src="$query/releases" ;;
    podcas) src="$query/podcasts" ;;
    playls) src="$query/playlists" ;;
    search) src="ytsearch$((page * line)):$query" ;;
  esac

  ytd="$(yt-dlp --no-warnings --skip-download --flat-playlist --playlist-end "$((page * line))" --extractor-args 'youtube:lang=ja' --print "%(id)s${pipe}%(title)s${pipe}%(channel)s${pipe}%(channel_url)s${pipe}%(thumbnails.-1.url)s" "$src")" || { [ "$mode" = "search" ] && exit 3; query="$default"; mode='search'; continue; }; [ -n "$ytd" ] || exit 4
  fzf="$(printf '%s' "$ytd" | fzf --with-nth=2 --layout='reverse' --delimiter="$pipe" --prompt="yt[$mode][$page]> " --expect='esc,left,right,ctrl-a,ctrl-d,ctrl-v,ctrl-c,ctrl-s,ctrl-r,ctrl-q,ctrl-f' --preview="[ {3} != NA ] && echo {3}; [ {5} != NA ] && thumb={5} && curl -s https://\${thumb#*//} | chafa")" || continue

  key="$(printf '%s' "$fzf" | head -n1)"
  row="$(printf '%s' "$fzf" | tail -n1)"
  vid="$(printf '%s' "$row" | cut -d"$pipe" -f1)"
  url="$(printf '%s' "$row" | cut -d"$pipe" -f4)"
  [ -n "$url" ] && [ "$url" != "NA" ] && channel="$url"

  case "$key" in
        '') case "$vid" in UC*) query="$channel"; mode='videos' ;; *) mpv -- "ytdl://$vid" ;; esac ;;
       esc) [ "$mode" != "search" ] && { query="$default"; mode='search'; } || exit 0 ;;
      left) [ "$page" -gt 1 ] && page="$((page - 1))" ;;
     right) page="$((page + 1))" ;;
    ctrl-a) yt-dlp -f bestaudio -x --audio-format='mp3' -- "$vid" ;;
    ctrl-d) yt-dlp -- "$vid" ;;
    ctrl-v) query="$channel"; mode='videos' ;;
    ctrl-c) query="$channel"; mode='shorts' ;;
    ctrl-s) query="$channel"; mode='stream' ;;
    ctrl-r) query="$channel"; mode='releas' ;;
    ctrl-q) query="$channel"; mode='podcas' ;;
    ctrl-f) query="$channel"; mode='playls' ;;
  esac
done

JAYATWD 🦚

⎗
✓
1
2
3
4
5
6
7
8
9
#!/bin/sh

# PROJECT: Jayatwd
# UPDATES: 2026-07-28 20:14:41 JST
# LICENSE: The Unlicense (unlicense.org)

PATH="$HOME/.local/bin:$PATH"; pipe="$(printf '\037')"
type fzf mpv ffmpeg yt-dlp || exit 1; printf 'id: '; read -r id; [ -n "$id" ] || exit 2
yt-dlp --no-warnings --skip-download --flat-playlist "https://twitch.tv/$id/videos" --print "%(title)s${pipe}%(url)s" | fzf --with-nth=1 --layout='reverse' --delimiter="$pipe" | cut -d"$pipe" -f2 | xargs -r mpv

JAYATVD 🦃

⎗
✓
#!/bin/sh

# PROJECT: Jayatvd
# UPDATES: 2026-08-06 16:47:57 JST
# LICENSE: The Unlicense (unlicense.org)

PATH="$HOME/.local/bin:$PATH"; pipe="$(printf '\037')"; mode='search'; type jq fzf mpv curl chafa ffmpeg yt-dlp || exit 1; printf 'query: '; read -r query; [ -n "$query" ] || exit 2
KEYS="$(curl -s -X POST --data 'device_type=pc' -H 'user-agent: Mozilla/5.0' 'https://platform-api.tver.jp/v2/api/platform_users/browser/create')"; UID="$(printf '%s' "$KEYS" | jq -r '.result.platform_uid')"; TOKEN="$(printf '%s' "$KEYS" | jq -r '.result.platform_token')"; [ -n "$UID" ] && [ -n "$TOKEN" ] || exit 3

while :; do
  case "$mode" in
    series) ep="$(curl -sG "https://platform-api.tver.jp/service/api/v1/callSeriesEpisodes/$sid" -H 'user-agent: Mozilla/5.0' -H 'origin: https://tver.jp' -H 'referer: https://tver.jp/' -H 'x-tver-platform-type: web' --data-urlencode "platform_uid=$UID" --data-urlencode "platform_token=$TOKEN")" || exit 4 ;;
    search) ep="$(curl -sG 'https://platform-api.tver.jp/service/api/v2/callKeywordSearch' -H 'user-agent: Mozilla/5.0' -H 'origin: https://tver.jp' -H 'referer: https://tver.jp/' -H 'x-tver-platform-type: web' --data-urlencode "keyword=$query" --data-urlencode "platform_uid=$UID" --data-urlencode "platform_token=$TOKEN")" || exit 5 ;;
  esac

  epl="$(printf '%s' "$ep" | jq -r --arg pipe "$pipe" '.result.contents[] | (.contents[]? // .) | select(.type=="episode") | .content | [ .id, .title, .seriesID, .seriesTitle, .thumbnailPath, .broadcasterName ] | join($pipe)')"; [ -n "$epl" ] || exit 6
  fzf="$(printf '%s' "$epl" | fzf --with-nth=2 --layout='reverse' --delimiter="$pipe" --prompt="tv[$mode]> " --expect='esc,ctrl-s' --preview="echo {4} {6}; thumb={5}; curl -s https://image-cdn.tver.jp/w=400\${thumb} | chafa")" || { mode='search'; continue; }

  key="$(printf '%s' "$fzf" | head -n1)"
  row="$(printf '%s' "$fzf" | tail -n1)"
  eid="$(printf '%s' "$row" | cut -d"$pipe" -f1)"
  sid="$(printf '%s' "$row" | cut -d"$pipe" -f3)"

  case "$key" in
        '') mpv -- "https://tver.jp/episodes/$eid" ;;
       esc) [ "$mode" != "search" ] && mode='search' || exit 0 ;;
    ctrl-s) [ "$mode" != "series" ] && [ -n "$sid" ] && mode='series' ;;
  esac
done

JAYAMCL ⛏️

⎗
✓
#!/bin/sh

# PROJECT: Jayamcl
# UPDATES: 2026-09-17 20:43:33 JST
# LICENSE: The Unlicense (unlicense.org)

set -eux

PATH='/usr/sbin:/usr/bin:/sbin:/bin'
JOBS="$(command -v nproc >/dev/null 2>&1 && nproc || echo 2)"
MC_DIR="$HOME/.minecraft"; MANIFEST_URL='https://piston-meta.mojang.com/mc/game/version_manifest_v2.json'

download() {
  url="$1"; path="$2"

  [ -f "$path" ] && return 0

  mkdir -p "$(dirname "$path")"; curl -fsSL -o "$path" "$url"
}

worker_library() {
  mc_dir="$1"; url="$2"; path="$3"

  download "$url" "$mc_dir/libraries/$path"
}

worker_asset() {
  mc_dir="$1"; hash="$2"; dir="${hash%"${hash#??}"}"

  download "https://resources.download.minecraft.net/$dir/$hash" "$mc_dir/assets/objects/$dir/$hash"
}

download_version() {
  version_json="$MC_DIR/versions/$version/$version.json"
  client_jar="$MC_DIR/versions/$version/$version.jar"
  manifest_json="$MC_DIR/version_manifest.json"

  download "$MANIFEST_URL" "$manifest_json"

  version_url="$(jq -r --arg v "$version" '.versions[] | select(.id == $v) | .url' "$manifest_json")"
  if [ -z "$version_url" ]; then
    echo "unknown version: $version" >&2
    exit 2
  fi
  download "$version_url" "$version_json"

  client_url="$(jq -r '.downloads.client.url' "$version_json")"
  download "$client_url" "$client_jar"
}

download_libraries() {
  version_json="$MC_DIR/versions/$version/$version.json"

  jq -r '.libraries[]
    | select(.downloads.artifact)
    | [.downloads.artifact.url, .downloads.artifact.path]
    | @tsv' "$version_json" |
    xargs -P "$JOBS" -n 2 sh "$0" --worker-library "$MC_DIR"
}

download_assets() {
  version_json="$MC_DIR/versions/$version/$version.json"
  asset_index="$(jq -r '.assetIndex.id' "$version_json")"
  asset_json="$MC_DIR/assets/indexes/$asset_index.json"

  download "$(jq -r '.assetIndex.url' "$version_json")" "$asset_json"

  jq -r '.objects[].hash' "$asset_json" |
    xargs -P "$JOBS" -n 1 sh "$0" --worker-asset "$MC_DIR"
}

library_classpath() {
  version_json="$MC_DIR/versions/$version/$version.json"

  jq -r '.libraries[]
    | select(.downloads.artifact)
    | .downloads.artifact.path' "$version_json" |
    sed "s|^|$MC_DIR/libraries/|" | paste -sd ':'
}

launch() {
  version_json="$MC_DIR/versions/$version/$version.json"
  client_jar="$MC_DIR/versions/$version/$version.jar"
  main_class="$(jq -r '.mainClass' "$version_json")"
  asset_index="$(jq -r '.assets' "$version_json")"

  library_classpath="$(library_classpath)"
  classpath="$client_jar:$library_classpath"

  set -- --username "$username" --version "$version" --gameDir "$MC_DIR" --assetsDir "$MC_DIR/assets" --assetIndex "$asset_index"
  exec java -cp "$classpath" "$main_class" --accessToken 0 "$@"
}

main() {
  case "${1:-}" in
    --worker-library)
      shift
      worker_library "$@"
      return
    ;;
    --worker-asset)
      shift
      worker_asset "$@"
      return
    ;;
  esac

  if [ $# -lt 1 ]; then
    echo "usage: $0 <version> [username]" >&2
    exit 1
  fi

  version="$1"
  username="${2:-Player}"

  download_version

  download_libraries
  download_assets

  launch
}

main "$@"

AUTOVOL 🔊

⎗
✓
local mp = require "mp"

--[[
PROJECT: Autovol
UPDATES: 2026-08-25 12:59:11 JST
LICENSE: The Unlicense (unlicense.org) ]]

local enabled = true
local FILTER = "@autovol:lavfi=[speechnorm=e=6.25:r=0.00001:l=1]"

local function filter()
  mp.commandv("af", "remove", FILTER)
  if enabled then
    mp.commandv("af", "add", FILTER)
  end
end

mp.add_key_binding("F1", "toggle-autovol", function()
  enabled = not enabled

  filter()
end)

mp.register_event("file-loaded", filter)

CATSEYE 🐱

⎗
✓
local mp = require "mp"

--[[
PROJECT: Catseye
UPDATES: 2026-08-25 12:59:16 JST
LICENSE: The Unlicense (unlicense.org) ]]

local enabled = true
local FILTER = "@catseye:lavfi=[eq=contrast=1.10:saturation=1.30]"

local function filter()
  mp.commandv("vf", "remove", FILTER)
  if enabled then
    mp.commandv("vf", "add", FILTER)
  end
end

mp.add_key_binding("F2", "toggle-catseye", function()
  enabled = not enabled

  filter()
end)

mp.register_event("file-loaded", filter)

FASTMPV ⏩️

⎗
✓
local mp = require "mp"

--[[
PROJECT: Fastmpv
UPDATES: 2026-08-25 16:02:38 JST
LICENSE: The Unlicense (unlicense.org) ]]

local enabled = true
local last_start, last_end
local SPEED_SILENCE, SPEED_NORMAL = 3, 1
local FILTER = "@fastmpv:lavfi=[silencedetect=noise=-30dB:d=1]"

local function speed(v)
  mp.set_property_number("speed", v)
  if enabled then
    mp.osd_message(string.format("Speed: %.2fx", v))
  end
end

local function check(_, meta)
  if not enabled or not meta then return end

  local s = meta["lavfi.silence_start"]
  local e = meta["lavfi.silence_end"]

  if s and s ~= last_start then
    last_start = s
    speed(SPEED_SILENCE)
  end

  if e and e ~= last_end then
    last_end = e
    speed(SPEED_NORMAL)
  end
end

local function filter()
  mp.commandv("af", "remove", FILTER)
  if enabled then
    mp.commandv("af", "add", FILTER)
  end
  last_start, last_end = nil, nil
  speed(SPEED_NORMAL)
end

mp.add_key_binding("F3", "toggle-fastmpv", function()
  enabled = not enabled

  filter()
end)

mp.register_event("seek", filter)
mp.register_event("file-loaded", filter)
mp.observe_property("af-metadata/fastmpv", "native", check)
Edit

Pub: 05 Dec 2024 05:11 UTC

Edit: 01 Oct 2026 04:18 UTC

Views: 12118

Auto Theme: Dark