diff --git a/sabnzbd/database.py b/sabnzbd/database.py index 125e7f5..96e5a41 100644 --- a/sabnzbd/database.py +++ b/sabnzbd/database.py @@ -414,7 +414,7 @@ def build_history_info(nzo, storage='', downpath='', postproc_time=0, script_out downloaded = nzo.bytes_downloaded completeness = 0 fail_message = decode_factory(nzo.fail_msg) - url_info = nzo_info.get('more_info', '') + url_info = nzo_info.get('details', '') or nzo_info.get('more_info', '') # Get the dictionary containing the stages and their unpack process stages = decode_factory(nzo.unpack_info) diff --git a/sabnzbd/newsunpack.py b/sabnzbd/newsunpack.py index 167afc0..35d7b44 100644 --- a/sabnzbd/newsunpack.py +++ b/sabnzbd/newsunpack.py @@ -136,11 +136,11 @@ def find_programs(curdir): sabnzbd.newsunpack.RAR_PROBLEM = not unrar_check(sabnzbd.newsunpack.RAR_COMMAND) #------------------------------------------------------------------------------ -def external_processing(extern_proc, complete_dir, filename, nicename, cat, group, status): +def external_processing(extern_proc, complete_dir, filename, nicename, cat, group, status, failure_url): """ Run a user postproc script, return console output and exit value """ command = [str(extern_proc), str(complete_dir), str(filename), - str(nicename), '', str(cat), str(group), str(status)] + str(nicename), '', str(cat), str(group), str(status), str(failure_url)] if extern_proc.endswith('.py') and (sabnzbd.WIN32 or not os.access(extern_proc, os.X_OK)): command.insert(0, 'python') @@ -148,7 +148,7 @@ def external_processing(extern_proc, complete_dir, filename, nicename, cat, grou env = fix_env() logging.info('Running external script %s(%s, %s, %s, %s, %s, %s, %s)', - extern_proc, complete_dir, filename, nicename, '', cat, group, status) + extern_proc, complete_dir, filename, nicename, '', cat, group, status, failure_url) try: p = subprocess.Popen(command, shell=need_shell, stdin=subprocess.PIPE, diff --git a/sabnzbd/postproc.py b/sabnzbd/postproc.py index 7afa32a..ebf8667 100644 --- a/sabnzbd/postproc.py +++ b/sabnzbd/postproc.py @@ -435,9 +435,16 @@ def process_job(nzo): nzo.status = Status.RUNNING nzo.set_action_line(T('Running script'), unicoder(script)) nzo.set_unpack_info('Script', T('Running user script %s') % unicoder(script), unique=True) +<<<<<<< HEAD script_log, script_ret = external_processing(short_path(script_path, False), short_path(workdir_complete, False), nzo.filename, dirname, cat, nzo.group, job_result) script_line = get_last_line(script_log) +======= + script_log, script_ret = external_processing(script_path, workdir_complete, nzo.filename, + msgid, dirname, cat, nzo.group, job_result, + nzo.nzo_info.get('failure', '')) + script_line = get_last_line(script_log) +>>>>>>> f68de5d... Add some basic support for X-DNZB-Failure and X-DNZB-Details headers coming from indexers. if script_log: script_output = nzo.nzo_id if script_line: diff --git a/sabnzbd/urlgrabber.py b/sabnzbd/urlgrabber.py index 9a1e730..6f95eba 100644 --- a/sabnzbd/urlgrabber.py +++ b/sabnzbd/urlgrabber.py @@ -135,6 +135,10 @@ class URLGrabber(Thread): nzo_info['episodename'] = value elif item == 'x-dnzb-year': nzo_info['year'] = value + elif item == 'x-dnzb-failure': + nzo_info['failure'] = value + elif item == 'x-dnzb-details': + nzo_info['details'] = value elif item in ('content-length',): length = misc.int_conv(value)