python脚本的repin功能不起作用

问题描述

我是有关python的新手,并且仍在学习,我正在尝试使Github上的脚本能够按规定在Pinterest上执行某些任务,我只想将其他人固定在我的板上,我有已经尝试了一个多星期而没有任何结果,也许有人愿意为此提供帮助。 我真的很感激 Here is the source file link on Github

这是固定代码的一部分:

 def repin(pin_id='',board_id='',section_id=None): return pinterest.repin(board_id=board_id,pin_id=pin_id,section_id=section_id)

我已经制作了一个文件并放在上面:

    import json
    import time
    import os
    from py3pin.Pinterest import Pinterest
    pinterest = Pinterest(email='my acc email',password='my acc pass',username='my acc username',cred_root='cred_root')
    def repin(pin_id='I put other's people pin no Here',board_id='I put one of my board id number 
    Here',section_id=None):
    return pinterest.repin(board_id=board_id,section_id=section_id)

我没有任何结果,也没有任何错误。 感谢您的帮助,非常感谢。

解决方法

尝试:

import json
import time
import os
from py3pin.Pinterest import Pinterest
pinterest = Pinterest(email='my acc email',password='my acc pass',username='my acc username',cred_root='cred_root')
pinterest.login()
def repin(pin_id="403212972893719260",board_id="403213041577459796"):
  pinterest.repin(board_id=board_id,pin_id=pin_id)

repin()

我唯一遇到的错误是登录错误,因为凭据无效。

侧面注意:ID是随机的占位符。