【发布时间】:2020-06-27 02:21:12
【问题描述】:
我正在制作一个应用程序来下载 Instagram 上的功能,并且我正在制作一个下载 Instagram 故事的功能
在他们编写的 instaloader 文档中:
download_storyitem(项目,目标)
下载一个用户故事。
参数 item (StoryItem) – 故事项目,如 get_stories() 中的 story['items'] 中的故事
target (Union[str, Path]) – 替换 dirname_pattern 和 filename_pattern 中的 {target}
这是我的代码:
def get_stories(self):
get = root.get_stories(userids=6328186396)
root.download_storyitem(get, ['file_name.jpg', "C:\Users"])
但这会产生错误:
Traceback (most recent call last):
File "instagram_downloader.py", line 68, in <module>
main()
File "instagram_downloader.py", line 59, in main
start.get_stories()
File "instagram_downloader.py", line 21, in get_stories
root.download_storyitem(get, ['file_name.jpg', "\Pictures"])
File "C:\Users\codin\AppData\Local\Programs\Python\Python38-32\lib\site-packages\instaloader\instaloader.py", line 631, in download_storyitem
date_local = item.date_local
AttributeError: 'generator' object has no attribute 'date_local'
【问题讨论】:
标签: python python-3.x instagram