その昔、KemaNet(Google 検索)というソフトウェアを作っていた人の、自分用メモのサイトです。
<<
2025.7
>>
[Stories] |
||||||
日 | 月 | 火 | 水 | 木 | 金 | 土 |
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
lyric(){
lynx -dump "https://search.yahoo.co.jp/search?ei=UTF-8&p=${1}+song+site:uta-net.com" |
grep -Fm1 https://www.uta-net.com/song/ |
awk '$0=$NF' |
xargs lynx -dump |
sed -n '/(BUTTON) シェア/,/この歌詞をマイ歌ネットに登録/p' |
sed '1d;$d' |
awk '$1=$1'
}
$ lyric お願いマッスル | head
お願いマッスル
めっちゃモテたい
お願いマッスル
めっちゃ痩せたい、YES
お願いマッスル
めっちゃモテたいから
ウー!(キレてるよ!)
ハー!(キレてるよ!)
筋肉にお願い!
ヒップレイズ!サイドベント!
movie(){
lynx -dump "https://search.yahoo.co.jp/search?ei=UTF-8&p=${1}+movie+site:uta-net.com" |
grep -Fm1 https://www.uta-net.com/movie/ |
awk '$0=$NF' |
xargs yt-dlp
}
2025/05/30に修正が入ってて、ばっちり動きます
ffmpeg -> ffplay/mpv にすると再生専用に早変わり(radish-play.sh相当)
本家の取り込みが終わってないっぽい
2025/05/29 頃から再生できなくなった様子
ならば rec_radiko_ts で現在時刻を開始点として追っかけ再生すれば良いのでは?
コード未整理なので概要だけ
なんとなく radish-play よりも再生開始時のバッファが少ない気がします
高橋なんぐの金曜天国
rec_radiko_ts -s BSN -f 202505300900 -d 55 -S 202505300942
seektime 変更用 変数を追加
# Define argument values
station_id=
fromtime=
totime=
seektime= # nobuoki
duration=
seektime 変更用 コマンドラインオプション追加
while getopts s:f:t:S:d:m:u:p:o: option; do # nobuoki
case "${option}" in
s)
station_id="${OPTARG}"
;;
f)
fromtime="${OPTARG}"
;;
t)
totime="${OPTARG}"
;;
S) # nobuoki
seektime="${OPTARG}"
;;
ファイル保存部分を、m3u8プレイリスト再生に変更
# Record
#ffmpeg
(以下コメントアウト続く)
#if [ ${ret} -ne 0 ]; then
# echo "Record fai#led" >&2
# finalize
# exit 1
#fi
# nobuoki: Play
playlist_uri="https://radiko.jp/v2/api/ts/playlist.m3u8?station_id=${station_id}&start_at=${fromtime}00&ft=${fromtime}00&end_at=${totime}00&to=${totime}00&seek=${seektime:-$fromtime}00&l=15&lsid=${lsid}&type=c"
mpv \
--really-quiet \
--no-video \
--http-header-fields="X-Radiko-Authtoken: ${authtoken}" \
"${playlist_uri}"
Ubuntu - bash の場合:
sudo apt -y install curl wget
page="$(curl -sSL https://github.com/conda-forge/miniforge/releases)"
url="https://github.com$(grep -m1 -oP '"\K/[^"]+'"$(uname -m)"'.sh' <<<"$page")"
script=${url##*/}
wget -N "$url"
bash "$script" -b -f
~/miniforge3/bin/conda init bash
. ~/.bashrc
conda update -n base -c conda-forge conda -y
# シェル起動時に自動で base 環境が有効化されるのがイヤな場合は以下も実行
conda config --set auto_activate false
mamba初期設定:
~/miniforge3/bin/mamba shell init --shell bash --root-prefix=~/miniforge3
. ~/.bashrc
# プロキシサーバ証明書
# 環境変数 REQUESTS_CA_BUNDLE がなぜか効かない場合の対症療法
sed -i '/^ssl_verify:/d' ~/.condarc
echo 'ssl_verify: /etc/ssl/certs/ca-certificates.crt' | tee -a ~/.condarc
参考:
おまけ:ネストした conda 環境を脱出
while [ -n "$CONDA_PREFIX" ]; do echo "$CONDA_DEFAULT_ENV"; conda deactivate; done
# コマンドっぽく使いたいので関数定義(.bashrcとかに記述)
unconda(){ while [ -n "$CONDA_PREFIX" ]; do echo "$CONDA_DEFAULT_ENV"; conda deactivate; done; }