'The downloaded file is accessible in modify phase'

@plugin.priority(200)
def on_task_modify(self, task, config):

    try:
        from pynzb import nzb_parser
    except ImportError:
        raise plugin.DependencyError(issued_by=u'nzb_size', missing=u'lib    pynzb')
    for entry in task.accepted:
        if ((entry.get(u'mime-type', None) in [u'text/nzb', u'application/x-nzb']) or entry.get(u'filename', u'').endswith(u'.nzb')):
            if (u'file' not in entry):
                log.warning((u'`%s`    does    not    have    a    `file`    that    could    be    used    to    get    size    information' % entry[u'title']))
                continue
            filename = entry[u'file']
            log.debug((u'reading    %s' % filename))
            xmldata = open(filename).read()
            try:
                nzbfiles = nzb_parser.parse(xmldata)
            except Exception:
                log.debug((u'%s    is    not    a    valid    nzb' % entry[u'title']))
                continue
            size = 0
            for nzbfile in nzbfiles:
                for segment in nzbfile.segments:
                    size += segment.bytes
            size_mb = ((size / 1024) / 1024)
            log.debug((u'%s    content    size:    %s    MB' % (entry[u'title'], size_mb)))
            entry[u'content_size'] = size_mb
        else:
            log.trace((u'%s    does    not    seem    to    be    nzb' % entry[u'title']))
