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:
parent
8d76596ebf
commit
d015927861
10 changed files with 315 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue