Skip to content

Instantly share code, notes, and snippets.

@yvt
Created October 16, 2017 08:57
Show Gist options
  • Save yvt/3280d7180c9d462e7b7316b8d14e6fa1 to your computer and use it in GitHub Desktop.
Save yvt/3280d7180c9d462e7b7316b8d14e6fa1 to your computer and use it in GitHub Desktop.
#!/bin/bash
function genquery {
# Login to VLC's telnet interface
echo Password
# Submit the command
echo "$@"
}
TIME=$(genquery get_time | nc 127.0.0.1 4212 |
tail -2 | head -1 |
sed -Ee 's/([0-9]+).*/\1/')
# Change this value to match your favorite show
INTRO_DURATION=35
TARGET_TIME=$(($TIME + $INTRO_DURATION))
echo "Current Time: $TIME"
echo "Target Time: $TARGET_TIME"
genquery seek $TARGET_TIME | nc 127.0.0.1 4212
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment