fdfd
This commit is contained in:
parent
0edbf59578
commit
bd702d613b
8 changed files with 14 additions and 14 deletions
|
@ -13,8 +13,8 @@ valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$")
|
|||
valid_title_regex = re.compile("^((?!<).){3,100}$")
|
||||
valid_password_regex = re.compile("^.{8,100}$")
|
||||
|
||||
youtubekey = environ.get("YOUTUBE_KEY").strip()
|
||||
coins_name = environ.get("COINS_NAME").strip()
|
||||
YOUTUBE_KEY = environ.get("YOUTUBE_KEY").strip()
|
||||
COINS_NAME = environ.get("COINS_NAME").strip()
|
||||
|
||||
@app.post("/settings/profile")
|
||||
@auth_required
|
||||
|
@ -426,13 +426,13 @@ def settings_css(v):
|
|||
@auth_required
|
||||
def settings_profilecss_get(v):
|
||||
if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
|
||||
if v.coins < 1000 and not v.patron: return f"You must have +1000 {coins_name} or be a patron to set profile css."
|
||||
if v.coins < 1000 and not v.patron: return f"You must have +1000 {COINS_NAME} or be a patron to set profile css."
|
||||
return render_template("settings_profilecss.html", v=v)
|
||||
|
||||
@app.post("/settings/profilecss")
|
||||
@auth_required
|
||||
def settings_profilecss(v):
|
||||
if v.coins < 1000 and not v.patron: return f"You must have +1000 {coins_name} or be a patron to set profile css."
|
||||
if v.coins < 1000 and not v.patron: return f"You must have +1000 {COINS_NAME} or be a patron to set profile css."
|
||||
profilecss = request.form.get("profilecss").replace('\\', '')[:50000]
|
||||
v.profilecss = profilecss
|
||||
g.db.add(v)
|
||||
|
@ -614,7 +614,7 @@ def settings_song_change(v):
|
|||
return redirect("/settings/profile")
|
||||
|
||||
|
||||
req = requests.get(f"https://www.googleapis.com/youtube/v3/videos?id={id}&key={youtubekey}&part=contentDetails").json()
|
||||
req = requests.get(f"https://www.googleapis.com/youtube/v3/videos?id={id}&key={YOUTUBE_KEY}&part=contentDetails").json()
|
||||
try: duration = req['items'][0]['contentDetails']['duration']
|
||||
except:
|
||||
print(req)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue