取得不同解析度下任何 Instagram 用戶的個人資料圖片的 url
npm install --save instagram-profile-picture
Full size
:
1080x1080 px
const ipp = require ( 'instagram-profile-picture' ) ;
ipp ( '9gag' ) . then ( user => {
console . log ( user ) ;
// => https://scontent-sit4-1.cdninstagram.com/7...jpg
} ) ;
Regular size
:
640x640 px
ipp . regular ( 'instagram' ) . then ( user => {
console . log ( user ) ;
// => https://scontent-sit4-1.cdninstagram.com/7...jpg
} ) ;
Medium size
:
320x320 px
ipp . medium ( '9gag' ) . then ( user => {
console . log ( user ) ;
// => https://scontent-sit4-1.cdninstagram.com/7...jpg
} ) ;
Small size
:
150x150 px
ipp . small ( '9gag' ) . then ( user => {
console . log ( user ) ;
// => https://scontent-sit4-1.cdninstagram.com/7...jpg
} ) ;
此外,您可以獲得公開共享媒體(images/videos)
的可下載鏈接
Images
ipp . image ( 'https://www.instagram.com/p/BRfTRCQBeHw/' ) . then ( img => {
console . log ( img ) ;
// => "https://instagram.fpat1-1.fna....9017349928908750848_n.jpg"
} ) ;
Videos
ipp . video ( 'https://www.instagram.com/p/BTTuhDsgtCs/' ) . then ( vid => {
console . log ( vid ) ;
// => "https://instagram.fpat1-1.fn....9178079197241802752_n.mp4"
} )
Instavim
:直接從命令列下載 Instagram 媒體。 麻省理工學院 © Rishi Giri;