Created
October 16, 2017 08:57
-
-
Save yvt/3280d7180c9d462e7b7316b8d14e6fa1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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