mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add /videos suffix support for classic series url
This commit is contained in:
parent
db30b9eadc
commit
253d8712c8
1 changed files with 1 additions and 1 deletions
|
|
@ -354,7 +354,7 @@ func (c *Crunchyroll) FindEpisodeByName(seriesName, episodeTitle string) ([]*Epi
|
||||||
// if possible since beta url are always safe to use.
|
// if possible since beta url are always safe to use.
|
||||||
// The method will stay in the library until only beta urls are supported by crunchyroll itself.
|
// The method will stay in the library until only beta urls are supported by crunchyroll itself.
|
||||||
func ParseVideoURL(url string) (seriesName string, ok bool) {
|
func ParseVideoURL(url string) (seriesName string, ok bool) {
|
||||||
pattern := regexp.MustCompile(`(?m)^https?://(www\.)?crunchyroll\.com(/\w{2}(-\w{2})?)?/(?P<series>[^/]+)/?$`)
|
pattern := regexp.MustCompile(`(?m)^https?://(www\.)?crunchyroll\.com(/\w{2}(-\w{2})?)?/(?P<series>[^/]+)(/videos)?/?$`)
|
||||||
if urlMatch := pattern.FindAllStringSubmatch(url, -1); len(urlMatch) != 0 {
|
if urlMatch := pattern.FindAllStringSubmatch(url, -1); len(urlMatch) != 0 {
|
||||||
groups := regexGroups(urlMatch, pattern.SubexpNames()...)
|
groups := regexGroups(urlMatch, pattern.SubexpNames()...)
|
||||||
seriesName = groups["series"]
|
seriesName = groups["series"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue