错误:{[错误:getaddrinfo ENOTFOUND]代码:'ENOTFOUND',错误:'ENOTFOUND',系统调用:'getaddrinfo'}

时间:2016-03-20 21:05:46

标签: node.js

Fotolog最近关闭,我想在那里备份我的所有照片。寻找有用的东西,我找到了这个项目:https://github.com/firstdoit/fotolog-backup

我按照自述文件中的说明安装了npm和咖啡

但是当我尝试跑步时:

 coffee fotolog-build-index.coffee ticinowriting2

我收到此错误:

doc@doc-mtn:~/fotolog-backup$ coffee fotolog-build-index.coffee ticinowriting2
{ [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }

“fotolog-build-index”中的代码是:

 request = require 'request'
$ = require 'cheerio'
fs = require 'fs'

imageURLs = []
user = process.argv[2]
throw new Error("Usage: coffee fotolog-build-index.coffee <username>") unless user

buildIndexFromPage = (page) ->
request "http://www.fotolog.com.br/#{user}/mosaic/#{page}", (err, resp, html) ->
    return console.error(err)  if err
    console.log "finished page #{page}... adding images"

    images = $.load(html)("a.wall_img_container img")
    images.map (i,img) ->
        imageURLs.push $(img).attr("src").replace('_t','_f')

    if images.length < 30
        console.log imageURLs
        console.log "got #{imageURLs.length} images"
        fs.writeFileSync('index.json', JSON.stringify(imageURLs))
    else
        buildIndexFromPage(page + 30)

buildIndexFromPage(0)

对不起我的英语不好,我来自瑞士,我对这种代码一无所知

1 个答案:

答案 0 :(得分:0)

该错误表示DNS解析程序无法将主机名(www.fotolog.com.br)解析为IP地址。我可以验证确实如此(dig得到NXDOMAIN)。因此,除非您拥有IP地址,否则您无能为力。

您可以尝试www.fotolog.com,因为它似乎尚未解决,但该网站上的消息表明数据应该在2016年2月20日之前下载。

相关问题