mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
parent
e9fc2b16f5
commit
99c4961f6a
5 changed files with 30 additions and 4 deletions
|
@ -223,7 +223,6 @@ if __name__ == "__main__":
|
||||||
# EXAMPLE VALUES:
|
# EXAMPLE VALUES:
|
||||||
clientAgent = config.get("Torrent", "clientAgent") # utorrent | deluge | transmission | other
|
clientAgent = config.get("Torrent", "clientAgent") # utorrent | deluge | transmission | other
|
||||||
useLink = config.get("Torrent", "useLink") # no | hard | sym
|
useLink = config.get("Torrent", "useLink") # no | hard | sym
|
||||||
minSampleSize = int(config.get("Torrent", "minSampleSize")) # 200 (in MB)
|
|
||||||
outputDirectory = config.get("Torrent", "outputDirectory") # /abs/path/to/complete/
|
outputDirectory = config.get("Torrent", "outputDirectory") # /abs/path/to/complete/
|
||||||
categories = (config.get("Torrent", "categories")).split(',') # music,music_videos,pictures,software
|
categories = (config.get("Torrent", "categories")).split(',') # music,music_videos,pictures,software
|
||||||
|
|
||||||
|
@ -236,6 +235,7 @@ if __name__ == "__main__":
|
||||||
compressedContainer = (config.get("Extensions", "compressedExtensions")).split(',') # .zip,.rar,.7z
|
compressedContainer = (config.get("Extensions", "compressedExtensions")).split(',') # .zip,.rar,.7z
|
||||||
mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') # .mkv,.avi,.divx
|
mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') # .mkv,.avi,.divx
|
||||||
metaContainer = (config.get("Extensions", "metaExtensions")).split(',') # .nfo,.sub,.srt
|
metaContainer = (config.get("Extensions", "metaExtensions")).split(',') # .nfo,.sub,.srt
|
||||||
|
minSampleSize = int(config.get("Extensions", "minSampleSize")) # 200 (in MB)
|
||||||
|
|
||||||
cpsCategory = config.get("CouchPotato", "cpsCategory") # movie
|
cpsCategory = config.get("CouchPotato", "cpsCategory") # movie
|
||||||
sbCategory = config.get("SickBeard", "sbCategory") # tv
|
sbCategory = config.get("SickBeard", "sbCategory") # tv
|
||||||
|
|
|
@ -26,6 +26,7 @@ import shutil
|
||||||
|
|
||||||
import Transcoder
|
import Transcoder
|
||||||
from nzbToMediaEnv import *
|
from nzbToMediaEnv import *
|
||||||
|
from nzbToMediaUtil import *
|
||||||
from nzbToMediaSceneExceptions import process_all_exceptions
|
from nzbToMediaSceneExceptions import process_all_exceptions
|
||||||
|
|
||||||
Logger = logging.getLogger()
|
Logger = logging.getLogger()
|
||||||
|
@ -106,9 +107,29 @@ def processEpisode(dirName, nzbName=None, failed=False):
|
||||||
except (ConfigParser.NoOptionError, ValueError):
|
except (ConfigParser.NoOptionError, ValueError):
|
||||||
delete_failed = 0
|
delete_failed = 0
|
||||||
|
|
||||||
|
mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',')
|
||||||
|
minSampleSize = int(config.get("Extensions", "minSampleSize"))
|
||||||
|
|
||||||
process_all_exceptions(nzbName.lower(), dirName)
|
process_all_exceptions(nzbName.lower(), dirName)
|
||||||
|
|
||||||
|
# Now check if movie files exist in destination:
|
||||||
|
video = int(0)
|
||||||
|
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
|
||||||
|
if is_sample(filePath, nzbName, minSampleSize):
|
||||||
|
Logger.debug("Removing sample file: %s", filePath)
|
||||||
|
os.unlink(filePath) # remove samples
|
||||||
|
else:
|
||||||
|
video = video + 1
|
||||||
|
if video > 0: # Check that a video exists. if not, assume failed.
|
||||||
|
flatten(dirName) # to make sure SickBeard can find the video (not in sub-folder)
|
||||||
|
else:
|
||||||
|
Logger.warning("No media files found in directory %s. Processing this as a failed download", dirName)
|
||||||
|
status = int(1)
|
||||||
|
failed = True
|
||||||
|
|
||||||
#allows manual call of postprocess script if we have specified a watch_dir. Check that here.
|
#allows manual call of postprocess script if we have specified a watch_dir. Check that here.
|
||||||
if nzbName == "Manual Run" and watch_dir == "":
|
if nzbName == "Manual Run" and watch_dir == "":
|
||||||
|
|
|
@ -99,7 +99,7 @@ def migrate():
|
||||||
pass
|
pass
|
||||||
for item in original:
|
for item in original:
|
||||||
option, value = item
|
option, value = item
|
||||||
if option in ["compressedExtensions", "mediaExtensions", "metaExtensions"]:
|
if option in ["compressedExtensions", "mediaExtensions", "metaExtensions", "minSampleSize"]:
|
||||||
section = "Extensions" # these were moved
|
section = "Extensions" # these were moved
|
||||||
if option == "useLink": # Sym links supported now as well.
|
if option == "useLink": # Sym links supported now as well.
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -82,8 +82,6 @@ web_root =
|
||||||
clientAgent = other
|
clientAgent = other
|
||||||
###### useLink - Set to hard for physical links, sym for symbolic links, and no to not use links
|
###### useLink - Set to hard for physical links, sym for symbolic links, and no to not use links
|
||||||
useLink = hard
|
useLink = hard
|
||||||
###### minSampleSize - Minimum required size to consider a file not an sample file (in MB, eg 200mb)
|
|
||||||
minSampleSize = 200
|
|
||||||
###### outputDirectory - Default output directory (categories will be appended as sub directory to outputDirectory)
|
###### outputDirectory - Default output directory (categories will be appended as sub directory to outputDirectory)
|
||||||
outputDirectory = /abs/path/to/complete/
|
outputDirectory = /abs/path/to/complete/
|
||||||
###### Other categories/labels defined for your downloader. Does not include CouchPotato, SickBeard, HeadPhones, Mylar categories.
|
###### Other categories/labels defined for your downloader. Does not include CouchPotato, SickBeard, HeadPhones, Mylar categories.
|
||||||
|
@ -99,6 +97,8 @@ deleteOriginal = 0
|
||||||
compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001
|
compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001
|
||||||
mediaExtensions = .mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso
|
mediaExtensions = .mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.iso
|
||||||
metaExtensions = .nfo,.sub,.srt,.jpg,.gif
|
metaExtensions = .nfo,.sub,.srt,.jpg,.gif
|
||||||
|
###### minSampleSize - Minimum required size to consider a media file not a sample file (in MB, eg 200mb)
|
||||||
|
minSampleSize = 200
|
||||||
|
|
||||||
[Transcoder]
|
[Transcoder]
|
||||||
transcode = 0
|
transcode = 0
|
||||||
|
|
|
@ -4,10 +4,15 @@ VX.X
|
||||||
|
|
||||||
Impacts All
|
Impacts All
|
||||||
Add option to set the "wait_for" period. This is how long the script waits to see if the movie changes status in CouchPotato.
|
Add option to set the "wait_for" period. This is how long the script waits to see if the movie changes status in CouchPotato.
|
||||||
|
minSampleSize now moved to [extensions] section and availabe for nzbs and torrents.
|
||||||
|
|
||||||
|
Impacts NZBs
|
||||||
|
Added Flatten of input directory and test for media files (including sample deletion) in autoProcessTV
|
||||||
|
|
||||||
Impacts Torrents
|
Impacts Torrents
|
||||||
Fixed Delete_Original option
|
Fixed Delete_Original option
|
||||||
|
|
||||||
|
|
||||||
V8.1 04/05/2013
|
V8.1 04/05/2013
|
||||||
|
|
||||||
Impacts All
|
Impacts All
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue