diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-09-02 02:17:41 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-09-02 02:17:41 (GMT) |
commit | 5f1a1745610f854d2c828439f164354e3ab8ffb6 (patch) | |
tree | a5f86a945cfd8dc5a19ad576da7543638b603e20 | |
parent | 0d3025b170012a689793a42060bfdcc59843d057 (diff) |
youtube-dl fetches CBA api key from .netrc now
-rw-r--r-- | rhimport/core.go | 14 | ||||
-rw-r--r-- | rhimport/fetcher.go | 3 |
2 files changed, 0 insertions, 17 deletions
diff --git a/rhimport/core.go b/rhimport/core.go index 12ad35c..25a4090 100644 --- a/rhimport/core.go +++ b/rhimport/core.go @@ -25,13 +25,11 @@ package rhimport import ( - "bufio" "fmt" "io/ioutil" "log" "os" "path" - "strings" "code.helsinki.at/rhrd-go/rddb" "github.com/andelf/go-curl" @@ -47,8 +45,6 @@ const ( ARCHIV_HOST = "archiv.helsinki.at" ARCHIV_USER = "rhimport" ARCHIV_BASE_PATH = "/srv/archiv" - - CBA_API_KEY_FILE = "/etc/cba-api.key" ) var ( @@ -110,16 +106,6 @@ func (p *FilePolicy) FromString(str string) error { return nil } -func getCBAApiKey() string { - key_file, err := os.Open(CBA_API_KEY_FILE) - if err == nil { - defer key_file.Close() - data, _ := bufio.NewReader(key_file).ReadString('\n') - return strings.TrimSpace(string(data)) - } - return "" -} - type AttachmentChunk struct { Data []byte Error error diff --git a/rhimport/fetcher.go b/rhimport/fetcher.go index db7ac3e..2740055 100644 --- a/rhimport/fetcher.go +++ b/rhimport/fetcher.go @@ -143,9 +143,6 @@ func checkYoutubeDL(ctx *Context, res *Result, uri *url.URL) *youtubeDLInfo { var stderr, stdout bytes.Buffer cmd.Stdout = &stdout cmd.Stderr = &stderr - if cba_api_key := getCBAApiKey(); cba_api_key != "" { - cmd.Env = append(os.Environ(), "CBA_API_KEY="+cba_api_key) - } ctx.stdlog.Printf("running youtube-dl for '%s'", ctx.SourceUri) done := make(chan *youtubeDLInfo) |