mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
Add Transcoder here.
This commit is contained in:
parent
bda5eb5b39
commit
d288bf2bd7
1 changed files with 16 additions and 0 deletions
|
@ -8,6 +8,7 @@ import time
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import Transcoder
|
||||||
from nzbToMediaEnv import *
|
from nzbToMediaEnv import *
|
||||||
from nzbToMediaSceneExceptions import process_all_exceptions
|
from nzbToMediaSceneExceptions import process_all_exceptions
|
||||||
|
|
||||||
|
@ -132,6 +133,11 @@ def process(dirName, nzbName=None, status=0):
|
||||||
except ConfigParser.NoOptionError:
|
except ConfigParser.NoOptionError:
|
||||||
web_root = ""
|
web_root = ""
|
||||||
|
|
||||||
|
try:
|
||||||
|
transcode = int(config.get("Transcoder", "transcode"))
|
||||||
|
except (ConfigParser.NoOptionError, ValueError):
|
||||||
|
transcode = 0
|
||||||
|
|
||||||
myOpener = AuthURLOpener(username, password)
|
myOpener = AuthURLOpener(username, password)
|
||||||
|
|
||||||
nzbName = str(nzbName) # make sure it is a string
|
nzbName = str(nzbName) # make sure it is a string
|
||||||
|
@ -155,6 +161,16 @@ def process(dirName, nzbName=None, status=0):
|
||||||
process_all_exceptions(nzbName.lower(), dirName)
|
process_all_exceptions(nzbName.lower(), dirName)
|
||||||
|
|
||||||
if status == 0:
|
if status == 0:
|
||||||
|
if transcode == 1:
|
||||||
|
Logger.info("Checking for files to be transcoded")
|
||||||
|
mediaContainer = (config.get("Torrent", "mediaExtensions")).split(',') # for now, this is in Torrent section...
|
||||||
|
for dirpath, dirnames, filenames in os.walk(dirName):
|
||||||
|
for file in filenames:
|
||||||
|
filePath = os.path.join(dirpath, file)
|
||||||
|
fileExtension = os.path.splitext(file)[1]
|
||||||
|
if fileExtension in mediaContainer: # If the file is a video file
|
||||||
|
result = Transcoder.Transcode_file(filePath)
|
||||||
|
|
||||||
if method == "manage":
|
if method == "manage":
|
||||||
command = "manage.update"
|
command = "manage.update"
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue