Update yt_dlp/extractor/patreon.py

Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
This commit is contained in:
Jackson Humphrey 2024-11-13 12:47:51 -06:00 committed by GitHub
parent f7fb9e42e4
commit 791cc954bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -428,9 +428,8 @@ class PatreonIE(PatreonBaseIE):
cursor = None
for comment in traverse_obj(response, (('data', 'included'), lambda _, v: v['type'] == 'comment' and v['id'])):
count += 1
if (comment_id := try_call(lambda: comment.get('id'))) is None:
continue
attributes = comment.get('attributes') or {}
comment_id = comment['id']
attributes = traverse_obj(comment, ('attributes', {dict})) or {}
author_id = traverse_obj(comment, ('relationships', 'commenter', 'data', 'id'))
author_info = traverse_obj(
response, ('included', lambda _, v: v['id'] == author_id and v['type'] == 'user', 'attributes'),