Advertisement
Guest User

Untitled

a guest
May 15th, 2022
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.68 KB | None | 0 0
  1. #!/usr/bin/env sh
  2.  
  3. NAME="95rn16"
  4.  
  5. export TZ="Asia/Tokyo"
  6.  
  7. while true ; do
  8.   # rename nodate_*.ts files into correct dates, preserving last-modified time
  9.   for filename in ./nodate_*.ts; do
  10.     if [ ! -f "$filename" ]; then
  11.         continue
  12.     fi
  13.     datetime="$(date -d "@$(stat -c "%W" "$filename")" +"%Y-%m-%d_%H-%M-%S%z")"
  14.    modified_datetime="$(date -d "@$(stat -c "%Y" "$filename")" +"%Y%m%d%H%M.%S")"
  15.    mv "$filename" "twitcast_$NAME_${datetime}.ts"
  16.    touch -m -t "$modified_datetime" "twitcast_$NAME_${datetime}.ts"
  17.  done
  18.  
  19.  streamlink -o "nodate_twitcast_$NAME_$(date +%s).ts" --retry-streams 1 --retry-max 600 $EXTRA_ARGS "https://twitcasting.tv/$NAME" best
  20. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement