Add video "subtitle" to description
This commit is contained in:
parent
79a73237ed
commit
ab2726fd71
1 changed files with 5 additions and 0 deletions
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in a new issue