another url format
This commit is contained in:
parent
694faae00f
commit
1050699e4c
1 changed files with 6 additions and 0 deletions
6
main.go
6
main.go
|
@ -15,6 +15,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -111,6 +112,11 @@ func view(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if parts := regexp.MustCompile(`^(view/)?([a-f0-9]+)/(.*?)\.(.*)$`).FindStringSubmatch(url); parts != nil {
|
||||||
|
c.Redirect(302, fmt.Sprintf("https://cdn.lbryplayer.xyz/speech/%s:%s.%s", parts[3], parts[2], parts[4]))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
c.Redirect(302, "https://cdn.lbryplayer.xyz/speech/"+url)
|
c.Redirect(302, "https://cdn.lbryplayer.xyz/speech/"+url)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue