Fix request_channel_id part

This commit is contained in:
BreadTube 2026-01-09 20:39:57 +09:00
commit a27e195ea3

View file

@ -72,7 +72,7 @@ class YoutubeManager:
raise RuntimeError(f'Exception calling YouTube shorts ({video_id}): {error}') from error raise RuntimeError(f'Exception calling YouTube shorts ({video_id}): {error}') from error
def request_channel_id(self, channel_name: str, request_timeout: float) -> str: def request_channel_id(self, channel_name: str, request_timeout: float) -> str:
url = ('https://www.googleapis.com/youtube/v3/channels?part=snippet' url = ('https://www.googleapis.com/youtube/v3/channels?part=id'
f'&forHandle=%40{channel_name}&key={self._api_key}') f'&forHandle=%40{channel_name}&key={self._api_key}')
self._logger.debug('YoutubeManager: request channel id for channel %s', channel_name) self._logger.debug('YoutubeManager: request channel id for channel %s', channel_name)
_, info = self._request(url=url, request_timeout=request_timeout) _, info = self._request(url=url, request_timeout=request_timeout)