diff --git a/content.sh b/content.sh index 9a5db2c..b527d24 100755 --- a/content.sh +++ b/content.sh @@ -29,11 +29,11 @@ then exit 1 fi -gamePk=$(./livepk.sh -t $team) +gamePk=$(livepk.sh -t $team) if [[ -z $gamePk || "$gamePk" = 'null' ]] then exit 1 fi jqFilter='.highlights.highlights.items | map(select(.keywordsAll[].value == "highlight"))[] | {headline, id} + {url: (.playbacks | map(select(.name == "mp4Avc"))[0].url)}' -mlblive content -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | ./writedb.sh -d $db -t highlights -c '' +mlblive content -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | writedb.sh -d $db -t highlights -c '' diff --git a/subscribe.sh b/subscribe.sh index 044e006..fa26511 100755 --- a/subscribe.sh +++ b/subscribe.sh @@ -29,11 +29,11 @@ then exit 1 fi -gamePk=$(./livepk.sh -t $team) +gamePk=$(livepk.sh -t $team) if [[ -z $gamePk || "$gamePk" = 'null' ]] then exit 1 fi jqFilter='{gamePk} + (.gameData.teams | {awayTeam: .away.teamName, homeTeam: .home.teamName}) + (.liveData.plays.allPlays[] | (.result + (.about | {atBatIndex, halfInning, inning, isComplete, isScoringPlay, hasReview})))' -mlblive subscribe -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | ./writedb.sh -d $db -t playinfo -c '' +mlblive subscribe -g $gamePk | jq -Sc --unbuffered "$jqFilter" | sed -u 's/$/0/' | writedb.sh -d $db -t playinfo -c ''