fix profile songs in localhost

pull/124/head
Aevann 2023-02-17 17:20:51 +02:00
parent 44e9085d8d
commit 92b77735ae
1 changed files with 11 additions and 10 deletions

View File

@ -800,6 +800,7 @@ def settings_song_change(v):
return redirect("/settings/personal?msg=Profile Anthem successfully updated!")
if YOUTUBE_KEY != DEFAULT_CONFIG_VALUE:
req = requests.get(f"https://www.googleapis.com/youtube/v3/videos?id={id}&key={YOUTUBE_KEY}&part=contentDetails", timeout=5).json()
duration = req['items'][0]['contentDetails']['duration']
if duration == 'P0D':