laurengarcia / url-metadata

NPM module: Request a url and scrape the metadata from its HTML using Node.js or the browser.
https://www.npmjs.com/package/url-metadata
MIT License
166 stars 43 forks source link

add customHeaders option #37

Closed chienwen closed 1 year ago

chienwen commented 3 years ago

I suggest adding a new option customHeaders to specify any header if needed.

In my use case, a website may prompt a window at the first time to confirm my age is over 18. So in this case I can add a custom cookie in the header:

urlMetadata('https://www.ptt.cc/bbs/Gossiping/index.html', {
    customHeaders: {
        'cookie': 'over18=1'
    }
}).then( ... );
bieblebrox commented 3 years ago

When will this be merged?

laurengarcia commented 1 year ago

Custom header option available in new version 3.0.1 https://www.npmjs.com/package/url-metadata