Fix linter errors

This commit is contained in:
Philipp Rintz 2022-07-18 20:29:59 +02:00 committed by GitHub
parent 14e59bf197
commit 1f32365c84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,8 +132,9 @@ class YoutubeChannelUrlValidator(StringValidator):
if len(query_path_split) < 3 or len(query_path_split[2]) == 0:
return None
return f"https://youtube.com{query.path}"
elif len(query_path_split) == 2 and len(query_path_split[1]) > 0:
# For channels that do not feature a 'c' or 'channel', ensure length of channel string is at least one
if len(query_path_split) == 2 and len(query_path_split[1]) > 0:
# For channels that do not feature a 'c' or 'channel'
# Ensure length of channel string is at least one
return f"https://youtube.com{query.path}"
return None