Cut GET parameters from download file name

This commit is contained in:
Pijus Kamandulis 2019-05-05 19:51:51 +03:00
parent e13f98eb4a
commit be2baffe69
1 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"path/filepath"
"strings"
. "./fileio"
. "./helpers"
@ -51,9 +52,10 @@ func main() {
item.Image.URL)
for _, enclosure := range item.Enclosures {
LogInfo("Downloading attachment '" + filepath.Base(enclosure.URL) + "'")
filename := strings.Split(filepath.Base(enclosure.URL), "?")[0]
LogInfo("Downloading attachment '" + filename + "'")
DownloadFile(
itemOutputDir+"/"+filepath.Base(enclosure.URL),
itemOutputDir+"/"+filename,
enclosure.URL)
}
}