'Executes any extra scripts defined in the config.
:param ep_obj: The object to use when calling the extra script'

def _run_extra_scripts(self, ep_obj):

    for curScriptName in sickrage.srCore.srConfig.EXTRA_SCRIPTS:
        script_cmd = [piece for piece in re.split(u'(    |\\".*?\\"|\'.*?\')', curScriptName) if piece.strip()]
        script_cmd[0] = os.path.abspath(script_cmd[0])
        self._log((u'Absolute    path    to    script:    ' + script_cmd[0]), sickrage.srCore.srLogger.DEBUG)
        script_cmd = (script_cmd + [ep_obj.location, self.file_path, str(ep_obj.show.indexerid), str(ep_obj.season), str(ep_obj.episode), str(ep_obj.airdate)])
        self._log((u'Executing    command    ' + str(script_cmd)))
        try:
            p = subprocess.Popen(script_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=sickrage.PROG_DIR)
            (out, _) = p.communicate()
            self._log((u'Script    result:    ' + str(out)), sickrage.srCore.srLogger.DEBUG)
        except OSError as e:
            self._log(u'Unable    to    run    extra_script:    {}'.format(e.message))
        except Exception as e:
            self._log(u'Unable    to    run    extra_script:    {}'.format(e.message))
