Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
popravek
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Oct 10, 2023
1 parent 2234456 commit d4a4128
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/endpoints/radio.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import copy
import json
import os
import re
import time
import uuid

Expand Down Expand Up @@ -50,13 +51,8 @@ async def new_suggestion(
name: str = Form(),
authorization: str = Header(),
):
yt = youtube_id.split("&")[0]
yt = yt.replace("http://", "")
yt = yt.replace("https://", "")
yt = yt.replace("www.", "")
yt = yt.replace("m.", "")
yt = yt.replace("youtube.com/watch?v=", "")
yt = yt.replace("youtu.be/", "")
z = re.match(r"(?:[?&]v=|\/embed\/|\/1\/|\/v\/|https:\/\/(?:www\.)?youtu\.be\/)([^&\n?#]+)", youtube_id)
yt = z[1]
print(f"[RADIO] New song submitted {yt} {youtube_id}")
if authorization == "" or sessions.get(authorization) is None:
response.status_code = status.HTTP_400_BAD_REQUEST
Expand Down

0 comments on commit d4a4128

Please sign in to comment.