'Sends NZB to NZBGet client
:param nzb: nzb object
:param proper: True if this is a Proper download, False if not. Defaults to False'

@staticmethod
def sendNZB(nzb, proper=False):

    if (sickrage.srCore.srConfig.NZBGET_HOST is None):
        sickrage.srCore.srLogger.error(u'No    NZBget    host    found    in    configuration.    Please    configure    it.')
        return False
    dupe_key = u''
    dupe_score = 0
    addToTop = False
    nzbgetprio = 0
    category = sickrage.srCore.srConfig.NZBGET_CATEGORY
    if nzb.show.is_anime:
        category = sickrage.srCore.srConfig.NZBGET_CATEGORY_ANIME
    url = (u'%(protocol)s://%(username)s:%(password)s@%(host)s/xmlrpc' % {u'protocol': (u'https' if sickrage.srCore.srConfig.NZBGET_USE_HTTPS else u'http'), u'host': sickrage.srCore.srConfig.NZBGET_HOST, u'username': sickrage.srCore.srConfig.NZBGET_USERNAME, u'password': sickrage.srCore.srConfig.NZBGET_PASSWORD})
    nzbGetRPC = xmlrpclib.ServerProxy(url)
    try:
        if nzbGetRPC.writelog(u'INFO', (u'SiCKRAGE    connected    to    drop    of    %s    any    moment    now.' % (nzb.name + u'.nzb'))):
            sickrage.srCore.srLogger.debug(u'Successful    connected    to    NZBget')
        else:
            sickrage.srCore.srLogger.error(u'Successful    connected    to    NZBget,    but    unable    to    send    a    message')
    except httplib.socket.error:
        sickrage.srCore.srLogger.error(u'Please    check    your    NZBget    host    and    port    (if    it    is    running).    NZBget    is    not    responding    to    this    combination')
        return False
    except xmlrpclib.ProtocolError as e:
        if (e.errmsg == u'Unauthorized'):
            sickrage.srCore.srLogger.error(u'NZBget    username    or    password    is    incorrect.')
        else:
            sickrage.srCore.srLogger.error((u'Protocol    Error:    ' + e.errmsg))
        return False
    for curEp in nzb.episodes:
        if (dupe_key == u''):
            if (curEp.show.indexer == 1):
                dupe_key = (u'SiCKRAGE-' + str(curEp.show.indexerid))
            elif (curEp.show.indexer == 2):
                dupe_key = (u'SiCKRAGE-tvr' + str(curEp.show.indexerid))
        dupe_key += (((u'-' + str(curEp.season)) + u'.') + str(curEp.episode))
        if ((date.today() - curEp.airdate) <= timedelta(days=7)):
            addToTop = True
            nzbgetprio = sickrage.srCore.srConfig.NZBGET_PRIORITY
        else:
            category = sickrage.srCore.srConfig.NZBGET_CATEGORY_BACKLOG
            if nzb.show.is_anime:
                category = sickrage.srCore.srConfig.NZBGET_CATEGORY_ANIME_BACKLOG
    if (nzb.quality != Quality.UNKNOWN):
        dupe_score = (nzb.quality * 100)
    if proper:
        dupe_score += 10
    nzbcontent64 = None
    if (nzb.resultType == u'nzbdata'):
        data = nzb.extraInfo[0]
        nzbcontent64 = standard_b64encode(data)
    sickrage.srCore.srLogger.info(u'Sending    NZB    to    NZBget')
    sickrage.srCore.srLogger.debug((u'URL:    ' + url))
    try:
        nzbget_version_str = nzbGetRPC.version()
        nzbget_version = tryInt(nzbget_version_str[:nzbget_version_str.find(u'.')])
        if (nzbget_version == 0):
            if (nzbcontent64 is not None):
                nzbget_result = nzbGetRPC.append((nzb.name + u'.nzb'), category, addToTop, nzbcontent64)
            else:
                if (nzb.resultType == u'nzb'):
                    try:
                        nzbcontent64 = standard_b64encode(sickrage.srCore.srWebSession.get(nzb.url).text)
                    except Exception:
                        return False
                nzbget_result = nzbGetRPC.append((nzb.name + u'.nzb'), category, addToTop, nzbcontent64)
        elif (nzbget_version == 12):
            if (nzbcontent64 is not None):
                nzbget_result = nzbGetRPC.append((nzb.name + u'.nzb'), category, nzbgetprio, False, nzbcontent64, False, dupe_key, dupe_score, u'score')
            else:
                nzbget_result = nzbGetRPC.appendurl((nzb.name + u'.nzb'), category, nzbgetprio, False, nzb.url, False, dupe_key, dupe_score, u'score')
        elif (nzbget_version >= 13):
            nzbget_result = (True if (nzbGetRPC.append((nzb.name + u'.nzb'), (nzbcontent64 if (nzbcontent64 is not None) else nzb.url), category, nzbgetprio, False, False, dupe_key, dupe_score, u'score') > 0) else False)
        elif (nzbcontent64 is not None):
            nzbget_result = nzbGetRPC.append((nzb.name + u'.nzb'), category, nzbgetprio, False, nzbcontent64)
        else:
            nzbget_result = nzbGetRPC.appendurl((nzb.name + u'.nzb'), category, nzbgetprio, False, nzb.url)
        if nzbget_result:
            sickrage.srCore.srLogger.debug(u'NZB    sent    to    NZBget    successfully')
            return True
        else:
            sickrage.srCore.srLogger.error((u'NZBget    could    not    add    %s    to    the    queue' % (nzb.name + u'.nzb')))
            return False
    except Exception:
        sickrage.srCore.srLogger.error((u'Connect    Error    to    NZBget:    could    not    add    %s    to    the    queue' % (nzb.name + u'.nzb')))
        return False
