aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-05-19 16:22:40 -0700
committerPinapelz <yukais@pinapelz.com>2025-05-19 16:22:40 -0700
commitf342dca5bd5e239362768ec80ca478ee3cee608b (patch)
treee7bb40a75feeaf7a6735afda5a1fe0e48feead92
parentba99daa6f1d8194b875dd5ae4222a6e5311b4d68 (diff)
wmmt: fix response encoding, remove internal_path requirements
-rw-r--r--bandai_namco/wmmt.py8
-rw-r--r--news_feed.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/bandai_namco/wmmt.py b/bandai_namco/wmmt.py
index c70440e..1277514 100644
--- a/bandai_namco/wmmt.py
+++ b/bandai_namco/wmmt.py
@@ -131,7 +131,7 @@ def make_wmmt_parser(version: constants.WANGAN_MAXI_VERSION):
return six_rr_plus_parser
-def make_wmmt_news_extractor(identifier: str, version: constants.WANGAN_MAXI_VERSION, internal_path: str, region_text: str):
+def make_wmmt_news_extractor(identifier: str, version: constants.WANGAN_MAXI_VERSION, region_text: str):
def five_dx_plus_extractor(html: str, data: dict):
soup = BeautifulSoup(html, "html.parser")
container = soup.select_one(".parts_inner_01")
@@ -245,6 +245,6 @@ def make_wmmt_news_extractor(identifier: str, version: constants.WANGAN_MAXI_VER
get_wmmt_na_news_post_links = make_wmmt_parser(constants.WANGAN_MAXI_VERSION.FIVE_DX_PLUS)
get_wmmt_asia_oce_news_post_links = make_wmmt_parser(constants.WANGAN_MAXI_VERSION.SIX_RR)
get_wmmt_jp_news_post_links = make_wmmt_parser(constants.WANGAN_MAXI_VERSION.SIX_RR_PLUS)
-parse_wmmt_na_news = make_wmmt_news_extractor("WANGAN_MAXI_NA", constants.WANGAN_MAXI_VERSION.FIVE_DX_PLUS, "wanganmaxi5dxplus/na", "NA")
-parse_wmmt_asia_oce_news = make_wmmt_news_extractor("WANGAN_MAXI_ASIA_OCE", constants.WANGAN_MAXI_VERSION.SIX_RR, "wanganmaxi6rr/en", "ASIA/OCE")
-parse_wmmt_jp_news = make_wmmt_news_extractor("WANGAN_MAXI_JP", constants.WANGAN_MAXI_VERSION.SIX_RR_PLUS, "wanganmaxi6rrplus/jp", "JPN")
+parse_wmmt_na_news = make_wmmt_news_extractor("WANGAN_MAXI_NA", constants.WANGAN_MAXI_VERSION.FIVE_DX_PLUS, "NA")
+parse_wmmt_asia_oce_news = make_wmmt_news_extractor("WANGAN_MAXI_ASIA_OCE", constants.WANGAN_MAXI_VERSION.SIX_RR, "ASIA/OCE")
+parse_wmmt_jp_news = make_wmmt_news_extractor("WANGAN_MAXI_JP", constants.WANGAN_MAXI_VERSION.SIX_RR_PLUS, "JPN")
diff --git a/news_feed.py b/news_feed.py
index e6e125e..fb11c6c 100644
--- a/news_feed.py
+++ b/news_feed.py
@@ -169,14 +169,14 @@ def get_news(news_url: str, version=None) -> list:
elif news_url == constants.WANGAN_MAXI_GENERIC:
news_posts = []
- na_site_data = download_site_as_html(constants.WANGAN_MAXI_NA_NEWS_SITE)
+ na_site_data = download_site_as_html(constants.WANGAN_MAXI_NA_NEWS_SITE, response_encoding="utf-8")
prelim_na_news_data = wmmt.get_wmmt_na_news_post_links(na_site_data)
for data in prelim_na_news_data:
post_site_data = download_site_as_html(data["url"])
news = wmmt.parse_wmmt_na_news(post_site_data, data)
if news is not None:
news_posts.append(news)
- asia_oce_site_data = download_site_as_html(constants.WANGAN_MAXI_ASIA_OCE_NEWS_SITE)
+ asia_oce_site_data = download_site_as_html(constants.WANGAN_MAXI_ASIA_OCE_NEWS_SITE, response_encoding="utf-8")
prelim_asia_oce_news_data = wmmt.get_wmmt_asia_oce_news_post_links(asia_oce_site_data)
for data in prelim_asia_oce_news_data:
post_site_data = download_site_as_html(data["url"])
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage