def get_watchlist_id_by_name(watchlistsdict):
"""
For each watchlist name specified in the config file, find the
associated watchlist ID.
NOTE: We trigger on watchlist IDs, and not on watchlist names
"""
headers = {'X-AUTH-TOKEN': cbtoken}
r = requests.get("https://%s/api/v1/watchlist" % (cbserver),
headers=headers,
verify=False)
parsed_json = json.loads(r.text)
for watchlist in parsed_json:
for key, value in watchlistsdict.iteritems():
if watchlist['name'].lower() == key.lower():
watchlistsdict[key] = int(watchlist['id'])
auto_blacklist_from_watchlist.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录