Skip to content

Commit

Permalink
Update twimm.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
asakura42 authored Dec 8, 2023
1 parent 1c9c566 commit d9c7552
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions twimm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,17 @@ parsingstreamers() {
}

process_video() {
local line=$(echo "$1" | awk -F'\t' '{print $1}')
local all=$(grep "^$1[[:blank:]]" "$tocheck")
local line=$(echo "$all" | awk -F'\t' '{print $1}')
last_parsed=$(grep "^$line " "$last_parsed_file" | awk '{print $2}')
if [ -z "$last_parsed" ] ; then
last_parsed=0
fi
if [ "$last_parsed" -ge "$days_ago" ]; then
printf "%s " "-$line"
else
local tags=$(echo "$1" | awk -F'\t' '{print $2}')
local lang=$(echo "$1" | awk -F'\t' '{print $3}')
local tags=$(echo "$all"| awk -F'\t' '{print $2}')
local lang=$(echo "$all" | awk -F'\t' '{print $3}')
listofvids=$(curl -Ls "$instance/api/vods/shelve/$line" | jq -r '.data[] | select(.title == "Recent broadcasts") | .videos[] | select(.duration > 10000) | {id: .id, game: .game.name, login: .streamer.login} | [.id, .game, .login] | @tsv')
if [ -z "$listofvids" ] ; then
true
Expand All @@ -101,6 +102,7 @@ addtowatch() {
export -f process_video
export last_parsed_file
export towatch
export tocheck
export instance
export days_ago
echo
Expand Down

0 comments on commit d9c7552

Please sign in to comment.