Skip to content

Instantly share code, notes, and snippets.

@assafmo
Last active November 4, 2017 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save assafmo/68e33d67107f99b2730240601da36db2 to your computer and use it in GitHub Desktop.
Save assafmo/68e33d67107f99b2730240601da36db2 to your computer and use it in GitHub Desktop.
ESPN NBA scoreboard page to highlights mp4
#!/bin/bash
curl 'http://www.espn.com/nba/scoreboard' --compressed -s | \
grep -Eo '\{"leagues.+}' | \
jq -r '.events | '\
'map(.competitions | '\
'map(.headlines | '\
'map(.video | '\
'map(if .tracking.coverageType == "Final Game Highlight" then '\
'.links.source.HD.href else empty end))))[][][][]' 2> /dev/null
@assafmo
Copy link
Author

assafmo commented Oct 18, 2017

Also work with dates, .e.g replace the URL with http://www.espn.com/nba/scoreboard/_/date/20161026.

@assafmo
Copy link
Author

assafmo commented Nov 4, 2017

works great piping: ./espn_nba_scoreboard_to_mp4.sh | xargs -n 1 aria2c -c -s 8 -x 8 -k 1M --stream-piece-selector=inorder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment