diff options
Diffstat (limited to 'rhimport/fetcher.go')
-rw-r--r-- | rhimport/fetcher.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rhimport/fetcher.go b/rhimport/fetcher.go index 2264f30..0a72342 100644 --- a/rhimport/fetcher.go +++ b/rhimport/fetcher.go @@ -136,7 +136,9 @@ func checkYoutubeDL(ctx *Context, res *Result, uri *url.URL) *YoutubeDLInfo { var stderr, stdout bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = &stderr - cmd.Env = append(os.Environ(), "CBA_API_KEY="+cba_api_key) + if cba_api_key := getCBAApiKey(); cba_api_key != "" { + cmd.Env = append(os.Environ(), "CBA_API_KEY="+cba_api_key) + } done := make(chan *YoutubeDLInfo) go func() { @@ -209,6 +211,7 @@ func fetchFileCurl(ctx *Context, res *Result, uri *url.URL) (err error) { } else { cbdata.remotename = info.Title + "." + info.Ext } + cbdata.remotename = strings.NewReplacer("/", "_").Replace(cbdata.remotename) switch strings.ToLower(info.Extractor) { case "generic": |