Removed deprecated functions

This commit is contained in:
bytedream 2022-01-18 23:46:07 +01:00
parent 674b0e0de3
commit 21619fe333
3 changed files with 3 additions and 21 deletions

View file

@ -30,7 +30,7 @@ func init() {
} }
func loginCredentials(email, password string) error { func loginCredentials(email, password string) error {
out.Debugln("Logging in via credentials") out.Debug("Logging in via credentials")
session, err := crunchyroll.LoginWithCredentials(email, password, locale, client) session, err := crunchyroll.LoginWithCredentials(email, password, locale, client)
if err != nil { if err != nil {
return err return err
@ -40,11 +40,11 @@ func loginCredentials(email, password string) error {
func loginSessionID(sessionID string, alreadyChecked bool) error { func loginSessionID(sessionID string, alreadyChecked bool) error {
if !alreadyChecked { if !alreadyChecked {
out.Debugln("Logging in via session id") out.Debug("Logging in via session id")
if _, err := crunchyroll.LoginWithSessionID(sessionID, locale, client); err != nil { if _, err := crunchyroll.LoginWithSessionID(sessionID, locale, client); err != nil {
return err return err
} }
} }
out.Infoln("Due to security reasons, you have to login again on the next reboot") out.Info("Due to security reasons, you have to login again on the next reboot")
return ioutil.WriteFile(sessionIDPath, []byte(sessionID), 0777) return ioutil.WriteFile(sessionIDPath, []byte(sessionID), 0777)
} }

View file

@ -325,14 +325,6 @@ func (c *Crunchyroll) FindEpisodeByName(seriesName, episodeTitle string) ([]*Epi
return matchingEpisodes, nil return matchingEpisodes, nil
} }
// MatchEpisode tries to extract the crunchyroll series name and title out of the given url
//
// Deprecated: Use ParseEpisodeURL instead
func MatchEpisode(url string) (seriesName, title string, ok bool) {
seriesName, title, _, _, ok = ParseEpisodeURL(url)
return
}
// ParseVideoURL tries to extract the crunchyroll series / movie name out of the given url // ParseVideoURL tries to extract the crunchyroll series / movie name out of the given url
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>[^/]+)/?$`)

View file

@ -37,16 +37,6 @@ type Format struct {
Subtitles []*Subtitle Subtitles []*Subtitle
} }
// Download calls DownloadGoroutines with 4 goroutines.
// See DownloadGoroutines for more details
//
// Deprecated: Use DownloadGoroutines instead
func (f *Format) Download(output *os.File, onSegmentDownload func(segment *m3u8.MediaSegment, current, total int, file *os.File, err error) error) error {
return f.DownloadGoroutines(output, 4, func(segment *m3u8.MediaSegment, current, total int, file *os.File) error {
return onSegmentDownload(segment, current, total, file, nil)
})
}
// DownloadGoroutines downloads the format to the given output file (as .ts file). // DownloadGoroutines downloads the format to the given output file (as .ts file).
// See Format.DownloadSegments for more information // See Format.DownloadSegments for more information
func (f *Format) DownloadGoroutines(output *os.File, goroutines int, onSegmentDownload func(segment *m3u8.MediaSegment, current, total int, file *os.File) error) error { func (f *Format) DownloadGoroutines(output *os.File, goroutines int, onSegmentDownload func(segment *m3u8.MediaSegment, current, total int, file *os.File) error) error {