Skip to content

Commit

Permalink
[ie/archive.org] Fix comments extraction (yt-dlp#11527)
Browse files Browse the repository at this point in the history
Closes yt-dlp#11526
Authored by: jshumphrey
  • Loading branch information
jshumphrey authored Nov 12, 2024
1 parent bacc31b commit f2a4983
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion yt_dlp/extractor/archiveorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,26 @@ class ArchiveOrgIE(InfoExtractor):
},
},
],
}, {
# The reviewbody is None for one of the reviews; just need to extract data without crashing
'url': 'https://archive.org/details/gd95-04-02.sbd.11622.sbeok.shnf/gd95-04-02d1t04.shn',
'info_dict': {
'id': 'gd95-04-02.sbd.11622.sbeok.shnf/gd95-04-02d1t04.shn',
'ext': 'mp3',
'title': 'Stuck Inside of Mobile with the Memphis Blues Again',
'creators': ['Grateful Dead'],
'duration': 338.31,
'track': 'Stuck Inside of Mobile with the Memphis Blues Again',
'description': 'md5:764348a470b986f1217ffd38d6ac7b72',
'display_id': 'gd95-04-02d1t04.shn',
'location': 'Pyramid Arena',
'uploader': '[email protected]',
'album': '1995-04-02 - Pyramid Arena',
'upload_date': '20040519',
'track_number': 4,
'release_date': '19950402',
'timestamp': 1084927901,
},
}]

@staticmethod
Expand Down Expand Up @@ -335,7 +355,7 @@ def _real_extract(self, url):
info['comments'].append({
'id': review.get('review_id'),
'author': review.get('reviewer'),
'text': str_or_none(review.get('reviewtitle'), '') + '\n\n' + review.get('reviewbody'),
'text': join_nonempty('reviewtitle', 'reviewbody', from_dict=review, delim='\n\n'),
'timestamp': unified_timestamp(review.get('createdate')),
'parent': 'root'})

Expand Down

0 comments on commit f2a4983

Please sign in to comment.