Add segment titles to description text
This commit is contained in:
parent
1d28a5a445
commit
8cca298ba1
1 changed files with 10 additions and 0 deletions
10
pukuthek.py
10
pukuthek.py
|
@ -94,6 +94,15 @@ with YoutubeDL(PARAMS) as ydl:
|
|||
date = soup.find("span", {"class": "date"}).text
|
||||
title = soup.find("span", {"class": "js-profile"}).text
|
||||
video_id = url.split("/")[-1]
|
||||
segments = soup.find_all("h4", {"class": "segment-title"})
|
||||
|
||||
segment_texts = []
|
||||
|
||||
for segment in segments:
|
||||
segment_text = segment.text
|
||||
segment_texts.append(segment_text)
|
||||
|
||||
description = "\n".join(segment_texts)
|
||||
|
||||
if not video_id:
|
||||
video_id = url.split("/")[-2]
|
||||
|
@ -128,6 +137,7 @@ with YoutubeDL(PARAMS) as ydl:
|
|||
"filename": f"{timestamp}-{video_id}.mp4",
|
||||
"name": f"{title} ({date})",
|
||||
"privacy": "3",
|
||||
"description": description,
|
||||
}
|
||||
upload_request = Request(
|
||||
upload_url,
|
||||
|
|
Loading…
Reference in a new issue