From 3ddffe2774bce3985ed741673490d9ea1abd33ce Mon Sep 17 00:00:00 2001 From: BreadTube Date: Wed, 29 Oct 2025 21:36:20 +0900 Subject: [PATCH] Fix video title parsing --- breadtube_bot/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/breadtube_bot/bot.py b/breadtube_bot/bot.py index d381294..359294f 100644 --- a/breadtube_bot/bot.py +++ b/breadtube_bot/bot.py @@ -1,6 +1,7 @@ from __future__ import annotations from enum import Enum +import html import http.client import json import logging @@ -11,7 +12,6 @@ import time import tomllib from typing import Any, TYPE_CHECKING import traceback -import urllib.parse from .config import Config from .discord_manager import ApiEncoder, DiscordManager @@ -351,7 +351,7 @@ class Bot: def _video_message_content(self, video: SearchResultItem) -> str: return (self.config.youtube_channel_video_message .replace('{{video_id}}', str(video.id.videoId)) - .replace('{{video_title}}', str(urllib.parse.unquote(video.snippet.title))) + .replace('{{video_title}}', str(html.unescape(video.snippet.title))) .replace('{{video_description}}', str(video.snippet.description)) .replace('{{video_publish_time}}', video.snippet.publishTime.isoformat()) .replace('{{channel_id}}', str(video.snippet.channelId))