Delete videos from course descriptions

This commit is contained in:
I-Al-Istannen
2024-10-28 19:32:16 +01:00
parent 71c65e89d1
commit d7a2b6e019
2 changed files with 8 additions and 0 deletions

View File

@ -85,6 +85,11 @@ def clean(soup: BeautifulSoup) -> BeautifulSoup:
if isinstance(type(children[0]), Comment):
dummy.decompose()
# Delete video figures, as they can not be internalized anyway
for video in soup.select(".ilc_media_cont_MediaContainerHighlighted .ilPageVideo"):
if figure := video.find_parent("figure"):
figure.decompose()
for hrule_imposter in soup.find_all(class_="ilc_section_Separator"):
hrule_imposter.insert(0, soup.new_tag("hr"))