Check if output folder exists before the program starts
This commit is contained in:
8
main.py
8
main.py
@@ -19,7 +19,7 @@ def ripDvd(driveName):
|
|||||||
print("- Movie could not be found, will use name " + driveName)
|
print("- Movie could not be found, will use name " + driveName)
|
||||||
print("- Will now procede to ripping DVD")
|
print("- Will now procede to ripping DVD")
|
||||||
movieName = driveName
|
movieName = driveName
|
||||||
os.system('HandBrakeCLI -i /dev/sr0 -o "' + movieName + '.mp4" --preset-import-file preset.json')
|
os.system('HandBrakeCLI -i /dev/sr0 -o output/"' + movieName + '.mp4" --preset-import-file preset.json')
|
||||||
|
|
||||||
def waitForDvd():
|
def waitForDvd():
|
||||||
print("- Insert a DVD into drive")
|
print("- Insert a DVD into drive")
|
||||||
@@ -35,6 +35,12 @@ def waitForDvd():
|
|||||||
fh.close()
|
fh.close()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
def addOutputFolder():
|
||||||
|
if (os.path.isdir('output') == False):
|
||||||
|
os.mkdir('output')
|
||||||
|
|
||||||
|
|
||||||
|
addOutputFolder()
|
||||||
print("-----------------------------------------------")
|
print("-----------------------------------------------")
|
||||||
print("- Auto DVD Ripper -")
|
print("- Auto DVD Ripper -")
|
||||||
print("-----------------------------------------------")
|
print("-----------------------------------------------")
|
||||||
|
|||||||
Reference in New Issue
Block a user