'Encode HTML before setting it'

def set_html(self, html):

    if html:
        if isinstance(html, bytes):
            html = self.config.get_parser().get_unicode_html(html)
        self.html = html
        self.download_state = ArticleDownloadState.SUCCESS
