18 lines
355 B
Go
18 lines
355 B
Go
|
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)
|
||
|
}
|