diff options
| author | Pinapelz <donaldshan1@outlook.com> | 2023-05-06 20:59:11 -0700 |
|---|---|---|
| committer | Pinapelz <donaldshan1@outlook.com> | 2023-05-06 20:59:11 -0700 |
| commit | 178cb85d040ec73b7e0564169fe4b7cb2d05085a (patch) | |
| tree | 9c7a74b785385630dbf6d21a32ab57aa8f71f2e5 /main.py | |
| parent | 41abeffef17b9a085cf89c3563bd54917559a0f5 (diff) | |
Implemented failsafe for APIs
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -107,10 +107,13 @@ def main(mode=0): if mode == 0: holodex_organizations = HOLODEX_ORG.split(",") print("Running Holodex API Data Collection\n"+"Found "+str(len(holodex_organizations))+" organizations") - for org in holodex_organizations: - hldex = HolodexAPI(fs.get_api_key("holodex_api_key"), member_count = ORG_MEMBER_COUNT, organization = org) - data += hldex.get_data_all_channels() - excluded_channels += hldex.get_exclude_channels() + try: + for org in holodex_organizations: + hldex = HolodexAPI(fs.get_api_key("holodex_api_key"), member_count = ORG_MEMBER_COUNT, organization = org) + data += hldex.get_data_all_channels() + excluded_channels += hldex.get_exclude_channels() + except: + main(mode=1) elif mode == 1: print("Running YouTube API Data Collection") |
