Add video "subtitle" to description

This commit is contained in:
Kumi 2023-06-19 22:04:18 +02:00
parent 79a73237ed
commit ab2726fd71
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -132,12 +132,17 @@ with YoutubeDL(PARAMS) as ydl:
segment_text = segment.text
segment_texts.append(segment_text)
subtitle = soup.find("p", {"class": "js-description-subtitle"})
description = (
"\n".join(segment_texts)
if segment_texts
else "Keine Beschreibung verfügbar"
)
if subtitle.text:
description = f"{subtitle.text}\n\n{description}"
if not video_id:
video_id = url.split("/")[-2]