diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2021-03-25 21:36:39 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2021-03-25 21:36:39 +1000 |
| commit | 43e093e38ec70213ac92e4c35a64b37250356258 (patch) | |
| tree | 263df9f0be9733683cc80e1e57fe19df3ec0da60 /importers | |
| parent | 3ab82de433cd260303e933628e4a07c96df5154a (diff) | |
Update deps
Diffstat (limited to 'importers')
| -rw-r--r-- | importers/youtube_importer.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/importers/youtube_importer.go b/importers/youtube_importer.go index c309850..932c3b7 100644 --- a/importers/youtube_importer.go +++ b/importers/youtube_importer.go @@ -1,10 +1,11 @@ package importers import ( + "context" "fmt" "strings" - "github.com/rylio/ytdl" + "github.com/Andreychik32/ytdl" ) type YoutubeImporter struct{} @@ -14,13 +15,15 @@ func (i *YoutubeImporter) GetVideoInfo(url string) (videoInfo VideoInfo, err err url = strings.TrimSpace(strings.SplitN(url, ":", 2)[1]) } - info, err := ytdl.GetVideoInfo(url) + ctx := context.Background() + info, err := ytdl.GetVideoInfo(ctx, url) if err != nil { err = fmt.Errorf("error retriving youtube video info: %w", err) return } - videoURL, err := ytdl.DefaultClient.GetDownloadURL(info, info.Formats[0]) + ctx = context.Background() + videoURL, err := ytdl.DefaultClient.GetDownloadURL(ctx, info, info.Formats[0]) if err != nil { err = fmt.Errorf("error retriving youtube video url: %w", err) return |
