diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-04-17 00:18:01 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-04-17 00:18:01 -0700 |
| commit | 785e8bbbd6cc7d89d18a5738e1cc0473c910d406 (patch) | |
| tree | ee35e0bdd6c68c7a326f7754adc9e86c620b89f9 | |
| parent | 301a47f11ac8dd93d722c75ae606ea2d123e8a63 (diff) | |
ddr: add extra spacing for DDR posts
| -rw-r--r-- | bemani/ddr.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bemani/ddr.py b/bemani/ddr.py index a969434..a4e9f12 100644 --- a/bemani/ddr.py +++ b/bemani/ddr.py @@ -25,8 +25,7 @@ def parse_ddr_world_news_site(html: str): timestamp = int(time.mktime(dt.timetuple())) except Exception: date_iso, timestamp = None, None - - paras = [p.get_text(strip=True, separator="\n") + paras = [p.get_text(strip=True, separator="\n\n") for p in div.find_all("p", recursive=False)] if not paras: for child in div.find_all(recursive=False): @@ -34,8 +33,11 @@ def parse_ddr_world_news_site(html: str): if "news_title" in cls or "img_news_center" in cls: continue if child.name == "div": - paras.append(child.get_text(strip=True, separator="\n")) - content = "\n\n".join(paras) if paras else None + paras.append(child.get_text(strip=True, separator="\n\n")) + + content = "\n\n\n".join(paras) if paras else None + if content: + content = f"\n{content}\n" images = [] for img in div.select("div.img_news_center img"): |
