mirror of
https://github.com/pikami/rss-dl.git
synced 2025-02-17 09:45:44 +00:00
Cut GET parameters from download file name
This commit is contained in:
parent
e13f98eb4a
commit
be2baffe69
6
main.go
6
main.go
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user