mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
Added remote_path option to CouchPotato section, allows setting the basepath for where CouchPotato looks for its video files on the server its installed on.
Re-coded autoProcessMovies, it now will attempt to get imdbID from dirName, nzbName and if both fail it then uses a regex to get the movie title and uses that to perform a search on CouchPotato. We also now get the release_id and use that instead of movie id. Fixed a bug that was preventing failed downloads from working properly for CouchPotato.
This commit is contained in:
parent
aa86f74c32
commit
77e07be6c8
5 changed files with 134 additions and 214 deletions
|
@ -1,7 +1,6 @@
|
|||
import copy
|
||||
import json
|
||||
import os
|
||||
import socket
|
||||
import urllib
|
||||
import time
|
||||
import nzbtomedia
|
||||
|
@ -9,7 +8,7 @@ from lib import requests
|
|||
from nzbtomedia.Transcoder import Transcoder
|
||||
from nzbtomedia.nzbToMediaAutoFork import autoFork
|
||||
from nzbtomedia.nzbToMediaSceneExceptions import process_all_exceptions
|
||||
from nzbtomedia.nzbToMediaUtil import convert_to_ascii, is_sample, flatten, getDirectorySize, delete
|
||||
from nzbtomedia.nzbToMediaUtil import convert_to_ascii, is_sample, flatten, delete
|
||||
from nzbtomedia import logger
|
||||
|
||||
class autoProcessTV:
|
||||
|
@ -43,7 +42,6 @@ class autoProcessTV:
|
|||
apikey = nzbtomedia.CFG[section][inputCategory]["apikey"]
|
||||
except:
|
||||
apikey = ""
|
||||
|
||||
try:
|
||||
ssl = int(nzbtomedia.CFG[section][inputCategory]["ssl"])
|
||||
except:
|
||||
|
@ -52,10 +50,6 @@ class autoProcessTV:
|
|||
web_root = nzbtomedia.CFG[section][inputCategory]["web_root"]
|
||||
except:
|
||||
web_root = ""
|
||||
try:
|
||||
watch_dir = nzbtomedia.CFG[section][inputCategory]["watch_dir"]
|
||||
except:
|
||||
watch_dir = ""
|
||||
try:
|
||||
transcode = int(nzbtomedia.CFG["Transcoder"]["transcode"])
|
||||
except:
|
||||
|
@ -68,10 +62,6 @@ class autoProcessTV:
|
|||
delay = float(nzbtomedia.CFG[section][inputCategory]["delay"])
|
||||
except:
|
||||
delay = 0
|
||||
try:
|
||||
TimePerGiB = int(nzbtomedia.CFG[section][inputCategory]["TimePerGiB"])
|
||||
except:
|
||||
TimePerGiB = 60 # note, if using Network to transfer on 100Mbit LAN, expect ~ 600 MB/minute.
|
||||
try:
|
||||
SampleIDs = (nzbtomedia.CFG["Extensions"]["SampleIDs"])
|
||||
except:
|
||||
|
@ -89,10 +79,6 @@ class autoProcessTV:
|
|||
except:
|
||||
Torrent_NoLink = 0
|
||||
|
||||
|
||||
mediaContainer = (nzbtomedia.CFG["Extensions"]["mediaExtensions"])
|
||||
minSampleSize = int(nzbtomedia.CFG["Extensions"]["minSampleSize"])
|
||||
|
||||
if not os.path.isdir(dirName) and os.path.isfile(dirName): # If the input directory is a file, assume single file download and split dir/name.
|
||||
dirName = os.path.split(os.path.normpath(dirName))[0]
|
||||
|
||||
|
@ -114,8 +100,8 @@ class autoProcessTV:
|
|||
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, SampleIDs):
|
||||
if fileExtension in nzbtomedia.MEDIACONTAINER: # If the file is a video file
|
||||
if is_sample(filePath, nzbName, nzbtomedia.MINSAMPLESIZE, SampleIDs):
|
||||
logger.debug("Removing sample file: %s", filePath)
|
||||
os.unlink(filePath) # remove samples
|
||||
else:
|
||||
|
@ -130,11 +116,6 @@ class autoProcessTV:
|
|||
status = int(1)
|
||||
failed = True
|
||||
|
||||
dirSize = getDirectorySize(dirName) # get total directory size to calculate needed processing time.
|
||||
TIME_OUT = int(TimePerGiB) * dirSize # SickBeard needs to complete all moving and renaming before returning the log sequence via url.
|
||||
TIME_OUT += 60 # Add an extra minute for over-head/processing/metadata.
|
||||
socket.setdefaulttimeout(int(TIME_OUT)) #initialize socket timeout.
|
||||
|
||||
# configure SB params to pass
|
||||
fork_params['quiet'] = 1
|
||||
if nzbName is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue