fent / node-miniget

A small http(s) GET library.
MIT License
53 stars 17 forks source link

Invalid URL: undefined #70

Closed lester51 closed 1 year ago

lester51 commented 1 year ago
/data/data/io.tempage.dorynode/cache/node_modules/miniget/dist/index.js:115
            stream.emit('error', new Miniget.MinigetError(`Invalid URL: ${url}`));
                                 ^

MinigetError: Invalid URL: undefined
    at doDownload (/data/data/io.tempage.dorynode/cache/node_modules/miniget/dist/index.js:115:34)
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  statusCode: undefined
}
//MY CODE
let test2 = async(url) => {
    let urlParts =  url.split('/')
    urlParts[urlParts.length-1] = encodeURIComponent(urlParts[urlParts.length-1])
    console.log(urlParts.join('/'))
    let body = await miniget(urlParts.join('/')).text()
 fs.writeFileSync(path+'animerush.html',pretty(body))
}
(async()=>{
 a = await test2('https:/\/animerush.in/anime/high-school-dxd-hero/5qhJFJH6LB2V2WN8MeJKEw==')
 console.log(a)
})()
fent commented 1 year ago

what did the console.logs reveal?

lester51 commented 1 year ago

Sorry for late reply I think its only a false alarm maybe my internet connection was not good enough at that time maybe the error was on yhe part of my scraper that scrapes url thats why its undefined.