Update gen_tdp

Added features=xml to fix python warnings.
This commit is contained in:
deepend-tildeclub 2023-01-16 11:35:17 -07:00 committed by GitHub
parent d28b3c4041
commit 7d82a258c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -17,10 +17,10 @@ for user in users:
tdpuser = dict(username=user) tdpuser = dict(username=user)
try: try:
title = bs( title = bs(
requests.get(f"http://tilde.club/~{user}/", allow_redirects=False).text, requests.get(f"http://tilde.club/~{user}/", allow_redirects=False).text,
"lxml", "lxml", features='xml'
).title.text ).title.text
except: except:
title = "No title" title = "No title"
tdpuser["title"] = title tdpuser["title"] = title
@ -36,4 +36,3 @@ tdp["users"] = tdpusers
with open("tilde.json", "w") as f: with open("tilde.json", "w") as f:
json.dump(tdp, f) json.dump(tdp, f)