aboutsummaryrefslogtreecommitdiffstats
path: root/news_feed.py
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-04-16 23:55:00 -0700
committerPinapelz <yukais@pinapelz.com>2025-04-16 23:55:00 -0700
commita5b15484423f9c9c9518a7be49845f018a8ff46f (patch)
tree4d9254e50f62d2cfc5c5269950d08b0cb9b7dab4 /news_feed.py
parentf140219f082e658f65a10d9ebfa070f5d649771d (diff)
feat: add support for DDR World
Diffstat (limited to 'news_feed.py')
-rw-r--r--news_feed.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/news_feed.py b/news_feed.py
index ac90f0f..75a3678 100644
--- a/news_feed.py
+++ b/news_feed.py
@@ -19,6 +19,7 @@ Generic format for a news entry. All keys are considered to be nullable
from site_scraper import SiteScraper, download_site_as_html
import bemani.sdvx as sound_voltex
import bemani.iidx as iidx
+import bemani.ddr as ddr
import sega.chuni_jp as chunithm_jp
import sega.chuni_intl as chuni_intl
import sega.maimaidx_jp as maimaidx_jp
@@ -30,14 +31,21 @@ import translate
def get_news(news_url: str, version=None) -> list:
if news_url == constants.SOUND_VOLTEX_EXCEED_GEAR_NEWS_SITE:
site_data = download_site_as_html(news_url)
- news_posts = sorted(sound_voltex.parse_exceed_gear_news_site(site_data, constants.EAMUSEMENT_BASE_URL), key=lambda x: x['timestamp'], reverse=True)
+ news_posts = sorted(sound_voltex.parse_exceed_gear_news_site(site_data), key=lambda x: x['timestamp'], reverse=True)
news_posts = translate.add_translate_text_to_en(news_posts)
elif news_url == constants.IIDX_PINKY_CRUSH_NEWS_SITE:
site_data = download_site_as_html(news_url)
- news_posts = sorted(iidx.parse_pinky_crush_news_site(site_data, constants.EAMUSEMENT_BASE_URL), key=lambda x: x['timestamp'], reverse=True)
+ news_posts = sorted(iidx.parse_pinky_crush_news_site(site_data), key=lambda x: x['timestamp'], reverse=True)
news_posts = translate.add_translate_text_to_en(news_posts, iidx.KEY_TERMS_TL)
+ elif news_url == constants.DDR_WORLD_NEWS_SITE:
+ scraper = SiteScraper(headless=True)
+ site_data = scraper.get_page_source(news_url)
+ scraper.close()
+ news_posts = sorted(ddr.parse_ddr_world_news_site(site_data), key=lambda x: x['timestamp'], reverse=True)
+ news_posts = translate.add_translate_text_to_en(news_posts)
+
elif news_url == constants.CHUNITHM_JP_NEWS_SITE:
site_data = download_site_as_html(news_url)
if version == constants.CHUNITHM_VERSION.VERSE:
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage