[audiochan] extract 'description' texts (#6582)
https://github.com/mikf/gallery-dl/issues/6582#issuecomment-3643689186
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user