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

View File

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"path/filepath" "path/filepath"
"strings"
. "./fileio" . "./fileio"
. "./helpers" . "./helpers"
@ -51,9 +52,10 @@ func main() {
item.Image.URL) item.Image.URL)
for _, enclosure := range item.Enclosures { 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( DownloadFile(
itemOutputDir+"/"+filepath.Base(enclosure.URL), itemOutputDir+"/"+filename,
enclosure.URL) enclosure.URL)
} }
} }