diff --git a/Gmeek.py b/Gmeek.py index 5cc6c99..204d6bf 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -8,7 +8,7 @@ import shutil import urllib import requests import argparse -from bs4 import BeautifulSoup +import html from github import Github from xpinyin import Pinyin from feedgen.feed import FeedGenerator @@ -160,12 +160,7 @@ class GMEEK(): ) if 'Gmeek-html' in post_body: - soup = BeautifulSoup(post_body, "html.parser") - code_tags = soup.find_all("code", class_="notranslate") - for code_tag in code_tags: - if code_tag.text.startswith("Gmeek-html"): - code_tag.replace_with(code_tag.text.replace("Gmeek-html", "").strip()) - post_body=soup + post_body = html.unescape(re.sub(r'Gmeek-html(.*?)',r'\1',post_body,flags=re.DOTALL)) postBase["postTitle"]=issue["postTitle"] postBase["postUrl"]=self.blogBase["homeUrl"]+"/"+issue["postUrl"] diff --git a/requirements.txt b/requirements.txt index f0f8ca7..8baec19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,4 @@ requests xpinyin feedgen Jinja2 -beautifulsoup4 transliterate \ No newline at end of file