From ab2726fd7166cfce9532583fed0437a9ee1cd680 Mon Sep 17 00:00:00 2001 From: Kumi Date: Mon, 19 Jun 2023 22:04:18 +0200 Subject: [PATCH] Add video "subtitle" to description --- pukuthek.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pukuthek.py b/pukuthek.py index 19c6aa2..d476a55 100644 --- a/pukuthek.py +++ b/pukuthek.py @@ -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]