mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-26 13:49:21 +08:00
better url regex
This commit is contained in:
parent
cf11ef9c3b
commit
71ce8b957a
2
popup.go
2
popup.go
@ -258,7 +258,7 @@ func helpPopup(panel Panel) {
|
||||
// Input popup. Takes video url from youtube to be downloaded
|
||||
func downloadMusicPopup(selPlaylist *tview.TreeNode) {
|
||||
|
||||
re := regexp.MustCompile(`https:\/\/youtu\.be\/[a-zA-Z0-9]+`)
|
||||
re := regexp.MustCompile(`^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$`)
|
||||
|
||||
inputField := tview.NewInputField().
|
||||
SetLabel("Youtube url: ").
|
||||
|
Loading…
x
Reference in New Issue
Block a user