forked from mdhiggins/sickbeard_mp4_automator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsabToSickBeardwithConverter.py
More file actions
31 lines (27 loc) · 890 Bytes
/
sabToSickBeardwithConverter.py
File metadata and controls
31 lines (27 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
import os
import sys
import autoProcessTV
from readSettings import ReadSettings
from mkvtomp4 import MkvtoMp4
settings = ReadSettings(os.path.dirname(sys.argv[0]), "autoProcess.ini")
path = str(sys.argv[1])
converter = MkvtoMp4(settings)
converter.output_dir = None
for r, d, f in os.walk(path):
for files in f:
inputfile = os.path.join(r, files)
if MkvtoMp4(settings).validSource(inputfile):
try:
print "Valid file detected: " + inputfile
except:
print "Valid file detected"
converter.process(inputfile)
"""Contents of sabToSickbeard.py"""
if len(sys.argv) < 2:
print "No folder supplied - is this being called from SABnzbd?"
sys.exit()
elif len(sys.argv) >= 3:
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2])
else:
autoProcessTV.processEpisode(sys.argv[1])