1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 16:33:16 +01:00

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.
This commit is contained in:
David Lynch 2024-02-10 20:05:49 -06:00
parent 64d77b62db
commit cc423f62bb

View file

@ -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()