mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Added code in to confirm that the clientAgent returned from the download info in the DB is correct for the script being run so that nzb's don't get processed by torrent scripts and vise-versa.
This commit is contained in:
parent
868ac210e9
commit
0e7b8eacab
3 changed files with 11 additions and 0 deletions
|
@ -311,10 +311,14 @@ def main(args):
|
||||||
downloadInfo = nzbtomedia.get_downloadInfo(os.path.basename(dirName), 0)
|
downloadInfo = nzbtomedia.get_downloadInfo(os.path.basename(dirName), 0)
|
||||||
if downloadInfo:
|
if downloadInfo:
|
||||||
clientAgent = str(downloadInfo['client_agent'][0])
|
clientAgent = str(downloadInfo['client_agent'][0])
|
||||||
|
if not clientAgent.lower() in nzbtomedia.TORRENT_CLIENTS:
|
||||||
|
continue
|
||||||
|
|
||||||
inputHash = str(downloadInfo['input_hash'][0])
|
inputHash = str(downloadInfo['input_hash'][0])
|
||||||
inputID = str(downloadInfo['input_id'][0])
|
inputID = str(downloadInfo['input_id'][0])
|
||||||
logger.info("Found download info for %s, setting variables now ..." % (os.path.basename(dirName)))
|
logger.info("Found download info for %s, setting variables now ..." % (os.path.basename(dirName)))
|
||||||
|
|
||||||
|
|
||||||
logger.info("Running %s:%s as a manual run for folder %s ..." % (section, category, dirName))
|
logger.info("Running %s:%s as a manual run for folder %s ..." % (section, category, dirName))
|
||||||
results = processTorrent(dirName, os.path.basename(dirName), category, inputHash, inputID, clientAgent)
|
results = processTorrent(dirName, os.path.basename(dirName), category, inputHash, inputID, clientAgent)
|
||||||
if results != 0:
|
if results != 0:
|
||||||
|
|
|
@ -446,6 +446,9 @@ def main(args, section=None):
|
||||||
downloadInfo = get_downloadInfo(os.path.basename(dirName), 0)
|
downloadInfo = get_downloadInfo(os.path.basename(dirName), 0)
|
||||||
if downloadInfo:
|
if downloadInfo:
|
||||||
clientAgent = str(downloadInfo['client_agent'][0])
|
clientAgent = str(downloadInfo['client_agent'][0])
|
||||||
|
if not clientAgent.lower() in nzbtomedia.NZB_CLIENTS:
|
||||||
|
continue
|
||||||
|
|
||||||
download_id = str(downloadInfo['input_id'][0])
|
download_id = str(downloadInfo['input_id'][0])
|
||||||
logger.info("Found download info for %s, setting variables now ..." % (os.path.basename(dirName)))
|
logger.info("Found download info for %s, setting variables now ..." % (os.path.basename(dirName)))
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,10 @@ from nzbtomedia.nzbToMediaUtil import category_search, sanitizeFileName, copy_li
|
||||||
from nzbtomedia.transcoder import transcoder
|
from nzbtomedia.transcoder import transcoder
|
||||||
from nzbtomedia.databases import mainDB
|
from nzbtomedia.databases import mainDB
|
||||||
|
|
||||||
|
# Client Agents
|
||||||
|
NZB_CLIENTS = ['sabnzbd','nzbget']
|
||||||
|
TORRENT_CLIENTS = ['transmission', 'deluge', 'utorrent']
|
||||||
|
|
||||||
# sabnzbd constants
|
# sabnzbd constants
|
||||||
SABNZB_NO_OF_ARGUMENTS = 8
|
SABNZB_NO_OF_ARGUMENTS = 8
|
||||||
SABNZB_0717_NO_OF_ARGUMENTS = 9
|
SABNZB_0717_NO_OF_ARGUMENTS = 9
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue