Skip to content

Instantly share code, notes, and snippets.

@cyrillbrito
Last active March 12, 2019 20:41
Show Gist options
  • Save cyrillbrito/579af7117948c30fb8b3317f94381b87 to your computer and use it in GitHub Desktop.
Save cyrillbrito/579af7117948c30fb8b3317f94381b87 to your computer and use it in GitHub Desktop.
Automatically open a new episode of dragon ball Z and GT in VLC.

autoDBZ

This script will remember the last watched episode of Dragon Ball Z you watched and open a new episode. The Scripts is getting the videos from Saiyan Watch. To use the script you just call the script and select the e episode you want to watch. The script is using python 2.7.

Versions:

0.01 (2015-12-??)
   Initial drop

0.02 (2016-04-30)
   Better file management

0.03 (2016-05-06)
   Added keyboard interruption handler

autoDBGT

This script will remember the last watched episode of Dragon Ball GT you watched and open a new episode. The Scripts is getting the videos from Saiyan Watch. To use the script you just call the script and select the e episode you want to watch. The script is using python 2.7.

Versions:

0.01 (2016-04-30)
   Initial drop

0.02 (2016-05-06)
   Added keyboard interruption handler
#!/usr/bin/env python
#
# File name: autoDBZ
# Description: This will remember the last watched episode of Dragon Ball Z, and open a new episode
# Author: Cyrill Brito
# Date created: ??/12/2015
# Version: 0.3
# Usage: Just call the script and select the e episode you want to watch
# Python version: 2.7
import subprocess
import os
path = os.path.dirname(os.path.realpath(__file__))
filePath = path + '/.autoDBZ'
if not os.path.isfile(filePath):
file = open(filePath, 'w')
file.write('0')
file.close()
try:
while True:
file = open(filePath, 'r')
watchedEpisode = int(file.readline())
file.close()
print
print 'The last last watched episode was ' + str(watchedEpisode)
selectedEpisode = raw_input('What episode do you want to watch(default: ' + str(watchedEpisode + 1) + '): ')
if not selectedEpisode or not str(selectedEpisode).isdigit():
selectedEpisode = watchedEpisode + 1
file = open(filePath, 'w')
file.write(str(selectedEpisode))
file.close()
print 'The episode ' + str(selectedEpisode) + ' is being opened'
command = 'vlc http://107.155.78.122/~saiyanwatch2/Dragon%20Ball%20Z/' + str(selectedEpisode).zfill(3) + '.m4v'
print command
subprocess.call(command.split())
except KeyboardInterrupt:
print
#!/usr/bin/env python
#
# File name: autoDBGT
# Description: This will remember the last watched episode of Dragon Ball GT, and open a new episode
# Author: Cyrill Brito
# Date created: 30/04/2016
# Version: 0.2
# Usage: Just call the script and select the e episode you want to watch
# Python version: 2.7
import subprocess
import os
path = os.path.dirname(os.path.realpath(__file__))
filePath = path + '/.autoDBGT'
if not os.path.isfile(filePath):
file = open(filePath, 'w')
file.write('0')
file.close()
try:
while True:
file = open(filePath, 'r')
watchedEpisode = int(file.readline())
file.close()
print
print 'The last last watched episode was ' + str(watchedEpisode)
selectedEpisode = raw_input('What episode do you want to watch(default: ' + str(watchedEpisode + 1) + '): ')
if not selectedEpisode or not str(selectedEpisode).isdigit():
selectedEpisode = watchedEpisode + 1
file = open(filePath, 'w')
file.write(str(selectedEpisode))
file.close()
print 'The episode ' + str(selectedEpisode) + ' is being opened'
command = 'vlc http://107.155.78.122/~saiyanwatch2/Dragon%20Ball%20GT/' + str(selectedEpisode).zfill(3) + '.m4v'
print command
subprocess.call(command.split())
except KeyboardInterrupt:
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment