diff --git a/mlbhighlightsave.sh b/mlbhighlightsave.sh index f3608aa..ed47dcc 100755 --- a/mlbhighlightsave.sh +++ b/mlbhighlightsave.sh @@ -40,5 +40,5 @@ fi # grab select data from response with jq, add 0 to the end of each line (to go # in the 'posted' db column), then write each line to db -jqFilter='.highlights.highlights.items | map(select(.keywordsAll[].value == "highlight"))[] | {headline, id} + {url: (.playbacks | map(select(.name == "mp4Avc"))[0].url)}' +jqFilter='.highlights.highlights.items | map(select(.keywordsAll[].value == "highlight"))[] | {headline, id} + {url: (.playbacks | map(select(.name == "mp4Avc"))[0].url)} | select(.url | startswith("https://mlb-cuts-diamond"))' mlblive content -g $gamePk | jq -Sc "$jqFilter" | sed 's/$/0/' | sqlite3 $db '.mode ascii' '.separator  \n' '.import /dev/stdin mlbdata'