diff --git a/gallery_dl/extractor/audiochan.py b/gallery_dl/extractor/audiochan.py index e6133839..55d25279 100644 --- a/gallery_dl/extractor/audiochan.py +++ b/gallery_dl/extractor/audiochan.py @@ -48,6 +48,8 @@ class AudiochanExtractor(Extractor): post["_http_headers"] = self.headers_dl post["date"] = self.parse_datetime_iso(file["created_at"]) post["date_updated"] = self.parse_datetime_iso(file["updated_at"]) + post["description"] = self._extract_description( + post["description"]) tags = [] for tag in post["tags"]: @@ -86,6 +88,18 @@ class AudiochanExtractor(Extractor): break params["page"] += 1 + def _extract_description(self, description, asd=None): + if asd is None: + asd = [] + + if "text" in description: + asd.append(description["text"]) + elif "content" in description: + for desc in description["content"]: + self._extract_description(desc, asd) + + return asd + class AudiochanAudioExtractor(AudiochanExtractor): subcategory = "audio" diff --git a/test/results/audiochan.py b/test/results/audiochan.py index b6cd1595..35903b45 100644 --- a/test/results/audiochan.py +++ b/test/results/audiochan.py @@ -14,6 +14,10 @@ __tests__ = ( "#pattern" : r"https://stream.audiochan.com/v\?token=YXVkaW9zL2Q4YjA1ZWEzLWU0ZGItNGU2NC05MzZiLTQzNmI3MmM4OTViMS9sOTBCOFI0ajhjS0NFSmNwa2kubXAz&exp=\d+&st=.+", "#count" : 1, + "description": [ + "author summary: ", + "You wake up in the middle of the night, noticing that your boyfriend is still awake and restlessly moving around. Work-related worries are making him anxious and keeping him from falling asleep so you do your best to take care of him, calm him down, and help him get some rest." + ], "user": { "username": "lil_lovergirl", }, @@ -59,6 +63,7 @@ __tests__ = ( "#count" : range(25, 40), "search_tags": "Cozy", + "description": list, "user": dict, "tags": list, },