diff --git a/Gmeek.py b/Gmeek.py index a84b275..fbd3b61 100644 --- a/Gmeek.py +++ b/Gmeek.py @@ -86,7 +86,7 @@ class GMEEK(): print("static does not exist") def defaultConfig(self): - dconfig={"singlePage":[],"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","themeMode":"manual","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","head":"","indexScript":"","indexStyle":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence","exlink":{},"needComment":1,"allHead":""} + dconfig={"singlePage":[],"startSite":"","filingNum":"","onePageListNum":15,"commentLabelColor":"#006b75","yearColorList":["#bc4c00", "#0969da", "#1f883d", "#A333D0"],"i18n":"CN","themeMode":"manual","dayTheme":"light","nightTheme":"dark","urlMode":"pinyin","script":"","style":"","head":"","indexScript":"","indexStyle":"","bottomText":"","showPostSource":1,"iconList":{},"UTC":+8,"rssSplit":"sentence","exlink":{},"needComment":1,"allHead":"","disableCamo":0} config=json.loads(open('config.json', 'r', encoding='utf-8').read()) self.blogBase={**dconfig,**config}.copy() self.blogBase["postListJson"]=json.loads('{}') @@ -159,6 +159,8 @@ class GMEEK(): return a_tag + img_tag def process_html_img_src(self, origin_html): + if self.blogBase["disableCamo"] != 1: + return origin_html # 使用正则表达式查找并替换符合条件的标签 pattern = r'(]*>)(]*data-canonical-src[^>]*>)' processed_html = re.sub(pattern, self.replace_canonical_attributes, origin_html)