Special characters handling

* Fix README for python version
* Add discord-friendly unidecode function for channel names (avoiding
  special characted)
* Check if "items" is present before accessing in channel id request
  response
This commit is contained in:
BreadTube 2026-02-03 01:30:41 +09:00
commit d015927861
10 changed files with 315 additions and 13 deletions

View file

@ -76,6 +76,8 @@ class YoutubeManager:
f'&forHandle=%40{channel_name}&key={self._api_key}')
self._logger.debug('YoutubeManager: request channel id for channel %s', channel_name)
_, info = self._request(url=url, request_timeout=request_timeout)
if 'items' not in info:
raise RuntimeError(f'No result found for channel named: {channel_name}')
return info['items'][0]['id']
@staticmethod