diff options
| author | Pinapelz <donaldshan1@outlook.com> | 2023-05-06 21:58:49 -0700 |
|---|---|---|
| committer | Pinapelz <donaldshan1@outlook.com> | 2023-05-06 21:58:49 -0700 |
| commit | 7b0157a79378847bd3aa4e10e30f0a929ca27c53 (patch) | |
| tree | 3d6b7738ffa01b9196a907d6e74dbbbdfc5f4700 /webapi | |
| parent | 178cb85d040ec73b7e0564169fe4b7cb2d05085a (diff) | |
Fixed auto generate channel data files
Diffstat (limited to 'webapi')
| -rw-r--r-- | webapi/holodex.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/webapi/holodex.py b/webapi/holodex.py index 89fcc14..6a5dc93 100644 --- a/webapi/holodex.py +++ b/webapi/holodex.py @@ -28,8 +28,12 @@ class HolodexAPI(WebAPI): members -= 100 offset += 100 for channel in data: + print(channel['name']) if channel['inactive'] is False: - self._active_channels.append(channel['id']) + try: + self._active_channels.append(channel['id'] + "," + channel['english_name']) + except (KeyError, TypeError, ValueError): + self._active_channels.append(channel['id'] + "," + channel['name']) channel['description'] = self.get_channel_description(channel['id']) filtered_data.append(channel) else: @@ -60,4 +64,4 @@ class HolodexAPI(WebAPI): """ Gets the list of active channels """ - return self._active_channels + yield from self._active_channels |
