mirror of https://github.com/pikami/rss-dl.git
Handle feed items without images
This commit is contained in:
parent
881f1aec48
commit
1d0fbff006
2
main.go
2
main.go
|
@ -47,11 +47,13 @@ func main() {
|
||||||
itemDetailsPath,
|
itemDetailsPath,
|
||||||
GrabFeedItemJSON(item))
|
GrabFeedItemJSON(item))
|
||||||
|
|
||||||
|
if item.Image != nil {
|
||||||
itemImagePath := itemOutputDir + "/image" + RemoveGetParams(filepath.Ext(item.Image.URL))
|
itemImagePath := itemOutputDir + "/image" + RemoveGetParams(filepath.Ext(item.Image.URL))
|
||||||
LogInfo("Downloading image to " + itemImagePath)
|
LogInfo("Downloading image to " + itemImagePath)
|
||||||
DownloadFile(
|
DownloadFile(
|
||||||
itemImagePath,
|
itemImagePath,
|
||||||
item.Image.URL)
|
item.Image.URL)
|
||||||
|
}
|
||||||
|
|
||||||
for _, enclosure := range item.Enclosures {
|
for _, enclosure := range item.Enclosures {
|
||||||
filename := RemoveGetParams(filepath.Base(enclosure.URL))
|
filename := RemoveGetParams(filepath.Base(enclosure.URL))
|
||||||
|
|
Loading…
Reference in New Issue