def METHOD_NAME(self, page):
    if "Sorry, but the page you requested could not be found." in page:
        raise exception.NotFoundError("gallery")
    return {
        "gallery_id": self.gallery_id,
        "title": text.unescape(text.extr(
            page, 'property="og:title" content="', '"').strip())
    }