fix problem in download.py when title has not been set

This commit is contained in:
Thomas Peetz
2025-08-19 08:55:45 +02:00
parent ddc5797549
commit a6a03e3f04
13 changed files with 221 additions and 50 deletions
+5
View File
@@ -43,9 +43,14 @@ if __name__ == '__main__':
for item in data:
link = item['url']
log.info(f"{item['id']} - {str(link)}")
if not link:
continue
try:
r = requests.get(link)
soup = BeautifulSoup(r.content, "html.parser")
title_tag = soup.find('title')
if title_tag:
title= title_tag.get_text()
title = soup.title.string
item['title'] = title
item['review'] = False