From cc423f62bb0232d14f3caf12e3ff4ff5feabc011 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Sat, 10 Feb 2024 20:05:49 -0600 Subject: [PATCH] Fix the royalroad stolen-content removal They added speak:none to the CSS, and I was strictly checking for a rule that only contained display:none. --- sites/royalroad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/royalroad.py b/sites/royalroad.py index a40df35..ecd4fd0 100644 --- a/sites/royalroad.py +++ b/sites/royalroad.py @@ -115,7 +115,7 @@ class RoyalRoad(Site): # HTML, and hiding them with CSS. Currently the CSS is very easy to # find, so do so and filter them out. for style in full_page.find_all('style'): - if m := re.match(r'\s*\.(\w+)\s*{\s*display:\s*none;\s*}', style.string): + if m := re.match(r'\s*\.(\w+)\s*{[^}]*display:\s*none;[^}]*}', style.string): for warning in contents.find_all(class_=m.group(1)): warning.decompose()