使用Python和Instaloader包,我可以通过以下代码下载配置文件图片
import instaloader
dp = instaloader.Instaloader()
dp.download_profile(profile_name, profile_pic_only = True)我要做的就是提供个人资料的名字。
我还想存档的是,我想下载一篇文章的图片,比如:https://www.instagram.com/p/CgbAU5GD6MU/
这能用完成吗?
谢谢!
发布于 2022-08-19 07:19:59
好的!获取您想要的urls,并轻松使用它们。
import instaloader
L = instaloader.Instaloader()
post_url = 'https://www.instagram.com/p/CgbAU5GD6MU/'
post = instaloader.Post.from_shortcode(L.context, post_url.split('p/')[1].strip('/ '))
photo_url = post.url # this will be post's thumbnail (or first slide)
video_url = post.video_url # if post.is_video is True then it will be url of video filehttps://stackoverflow.com/questions/73413029
复制相似问题