【问题标题】:Anybody know how to only get pictures and not videos using the instaloader package on python?有人知道如何使用 python 上的 instaloader 包只获取图片而不是视频吗?
【发布时间】:2020-10-16 03:22:35
【问题描述】:

我正在尝试仅从 instagram 中抓取图片。我目前在使用 instaloader 时同时获取图片和视频。有谁知道是否有一些参数可以让我只返回图片?

L = instaloader.Instaloader( 
        download_pictures=True,
        download_videos=False, 
        download_video_thumbnails=False,
        compress_json=False, 
        download_geotags=False, 
        post_metadata_txt_pattern=None, 
        max_connection_attempts=0,
        download_comments=False,
        )
    profile = instaloader.Profile.from_username(L.context, username)

【问题讨论】:

标签: python web-scraping instagram


【解决方案1】:

您是否已经尝试从 instaloader 阅读“帮助”文档?

尝试输入instaloader --help,你会看到使用instaloader排除视频的命令选项,即--no-videos

示例:

$ instaloader arianagrande --no-videos

这将从 arianagrande 个人资料中删除帖子,但不包括包含视频的帖子。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-10
    • 2010-11-24
    • 1970-01-01
    • 1970-01-01
    • 2013-08-19
    • 1970-01-01
    • 2012-12-10
    • 1970-01-01
    相关资源
    最近更新 更多