GoDown/app/handlers/api/20_GET_api_add_ytid.go

18 lines
355 B
Go
Raw Normal View History

2022-04-29 01:00:04 +02:00
package api
import (
"net/http"
"net/url"
"github.com/gin-gonic/gin"
)
func GET_api_add_ytid(c *gin.Context) {
newSong_ytid := c.Param("ytid")
newSong_url := "https://www.youtube.com/watch?v=" + newSong_ytid
_, err := url.ParseRequestURI(newSong_url)
check(err)
is_available := ytid_in_db(newSong_ytid)
c.String(http.StatusOK, is_available)
}