1
0
mirror of https://git.sr.ht/~cadence/NewLeaf synced 2024-11-24 08:27:29 +00:00

#42 Return UNKNOWN error for not explicitly handled errors for channel extraction instead of stacktrace

This commit is contained in:
Lomanic 2021-11-13 19:55:08 +01:00 committed by Cadence Ember
parent c9b16d3efd
commit 29a3894337

View File

@ -35,7 +35,10 @@ def extract_channel(ucid):
"identifier": "ACCOUNT_TERMINATED" "identifier": "ACCOUNT_TERMINATED"
} }
else: else:
print("Seen alert text '{}'".format(alert_text)) return {
"error": alert_text,
"identifier": "UNKNOWN"
}
header = yt_initial_data["header"]["c4TabbedHeaderRenderer"] if "c4TabbedHeaderRenderer" in yt_initial_data["header"] else {} header = yt_initial_data["header"]["c4TabbedHeaderRenderer"] if "c4TabbedHeaderRenderer" in yt_initial_data["header"] else {}
channel_metadata = yt_initial_data["metadata"]["channelMetadataRenderer"] channel_metadata = yt_initial_data["metadata"]["channelMetadataRenderer"]