diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-10-16 12:01:47 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-10-16 12:01:47 -0700 |
| commit | e7276713a35b2dbc7a2b0ab197d18645c9e52a53 (patch) | |
| tree | 4199ce609a09fbdb33df4608b6d60a229ab67978 /news_feed.py | |
| parent | bcdec514d4823031b39d5c726b371a5bfbefd240 (diff) | |
migrate maimaidx_intl to scrape downloads api route
Diffstat (limited to 'news_feed.py')
| -rw-r--r-- | news_feed.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/news_feed.py b/news_feed.py index 2b9a80d..2761f29 100644 --- a/news_feed.py +++ b/news_feed.py @@ -149,12 +149,9 @@ def get_news(news_url: str, version=None) -> list: news_posts = translate.add_translate_text_to_en(news_posts) elif news_url == constants.MAIMAIDX_INTL_NEWS_SITE: - scraper = SiteScraper(headless=True) - site_data = scraper.get_page_source(news_url) - scraper.close() - if version in [ constants.MAIMAIDX_VERSION.PRISM, constants.MAIMAIDX_VERSION.PRISM_PLUS ]: - news_posts = sorted(maimaidx_intl.parse_maimaidx_intl_news_site(site_data), key=lambda x: x['timestamp'], reverse=True) - _attach_llm_summaries(news_posts, "maimai DX International") + site_data = download_site_as_html(news_url) + news_posts = sorted(maimaidx_intl.parse_maimaidx_intl_api_route(site_data, "MAIMAIDX_INTL"), key=lambda x: x['timestamp'], reverse=True) + _attach_llm_summaries(news_posts, "maimai DX International") elif news_url == constants.ONGEKI_JP_NEWS_SITE: site_data = download_site_as_html(news_url) |
