Update hatenadir/ds/v2-xx/movie.py

Simplify checking the star color

Co-authored-by: Peder B. Sundt <pbsds@hotmail.com>
This commit is contained in:
LugiiaandPeder B. Sundt authored and Peder B. Sundt committed 2021-02-26 17:32:35 +01:00
1 parent c7271434e7
commit 77ce0c90ed
1 file changed
+1 -4
+1 -4
View File
@@ -82,10 +82,7 @@ class CreatorIDFileResource(resource.Resource):
return self.GenerateDetailsPage(creator, ".".join(file.split(".")[:-1])).encode("UTF-8")
elif filetype == "star":
path = "/".join(request.path.split("/")[3:])
try:
color = request.args.get('starcolor')[0] #colour of the star. can be green, red, blue, or purple.
except:
color = "yellow" #if starcolor arg doesn't exist, then its yellow. there's probably a better way to handle this, but I'm not fluent with python ;-;
color = request.args.get('starcolor', ["yellow"])[0] # colour of star, can be green, red, blue, or purple. Yellow otherwise.
headers = request.getAllHeaders()
#bad formatting