Fix video title parsing
This commit is contained in:
parent
f59982f745
commit
3ddffe2774
1 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
import html
|
||||||
import http.client
|
import http.client
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
@ -11,7 +12,6 @@ import time
|
||||||
import tomllib
|
import tomllib
|
||||||
from typing import Any, TYPE_CHECKING
|
from typing import Any, TYPE_CHECKING
|
||||||
import traceback
|
import traceback
|
||||||
import urllib.parse
|
|
||||||
|
|
||||||
from .config import Config
|
from .config import Config
|
||||||
from .discord_manager import ApiEncoder, DiscordManager
|
from .discord_manager import ApiEncoder, DiscordManager
|
||||||
|
|
@ -351,7 +351,7 @@ class Bot:
|
||||||
def _video_message_content(self, video: SearchResultItem) -> str:
|
def _video_message_content(self, video: SearchResultItem) -> str:
|
||||||
return (self.config.youtube_channel_video_message
|
return (self.config.youtube_channel_video_message
|
||||||
.replace('{{video_id}}', str(video.id.videoId))
|
.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_description}}', str(video.snippet.description))
|
||||||
.replace('{{video_publish_time}}', video.snippet.publishTime.isoformat())
|
.replace('{{video_publish_time}}', video.snippet.publishTime.isoformat())
|
||||||
.replace('{{channel_id}}', str(video.snippet.channelId))
|
.replace('{{channel_id}}', str(video.snippet.channelId))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue