Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- TV_SHOWS=$(curl --silent "http://localhost:32400/library/sections/3/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=10")
- test -r "$TV_SHOWS" || { echo "error: invalid input, usage: ${0//*\//} filename.xml"; exit 1; }
- let idx=0
- while read line || test -n "$line"; do
- if test "${line:0:2}" == '<V'; then
- tmp=${line##* title=}
- title=${tmp%% grandparentKey*}
- tmp=${line##*grandparentTitle=}
- gptitle=${tmp%% contentRating*}
- if test "$idx" -lt "1" ; then
- let idx=1
- echo -n "[ [ $title, $gptitle ]"
- else
- echo -n ", [ $title, $gptitle ]"
- fi
- fi
- done <"$1"
- echo " ]"
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement