aboutsummaryrefslogtreecommitdiffstats
path: root/backend/webapi/youtube.py
diff options
context:
space:
mode:
Diffstat (limited to 'backend/webapi/youtube.py')
-rw-r--r--backend/webapi/youtube.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/backend/webapi/youtube.py b/backend/webapi/youtube.py
index 44d786f..a25f5ba 100644
--- a/backend/webapi/youtube.py
+++ b/backend/webapi/youtube.py
@@ -37,16 +37,22 @@ class YouTubeAPI(WebAPI):
snippet_list = snippet['items']
for i in range(len(stats_list)):
try:
+ # group/sub_org is used to further divide channels into subsets (sorta like teams)
+ # can't think of a better match via YouTube API rn other than customUrl
data_entry = {'english_name': channel_names[i], 'id': channel_ids[i],
'subscriber_count':
- self._search_matching_id(channel_ids[i], stats_list)[
- 'statistics']['subscriberCount'], 'view_count':
- self._search_matching_id(channel_ids[i], stats_list)[
- 'statistics']['viewCount'], 'photo':
- self._search_matching_id(channel_ids[i], snippet_list)[
- 'snippet']['thumbnails']['default']['url'], 'description':
- self._search_matching_id(channel_ids[i], snippet_list)[
- 'snippet']['description']}
+ self._search_matching_id(channel_ids[i], stats_list)['statistics']['subscriberCount'],
+ 'view_count':
+ self._search_matching_id(channel_ids[i], stats_list)['statistics']['viewCount'],
+ 'photo':
+ self._search_matching_id(channel_ids[i], snippet_list)['snippet']['thumbnails']['default']['url'],
+ 'description':
+ self._search_matching_id(channel_ids[i], snippet_list)['snippet']['description'],
+ 'group':
+ self._search_matching_id(channel_ids[i], snippet_list)['snippet']['customUrl'],
+ 'video_count':
+ self._search_matching_id(channel_ids[i], stats_list)['statistics']['videoCount']
+ }
data.append(data_entry)
except TypeError:
print("Error NoneType: " + str(channel_ids[i]))
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage