列表订户限制为1000

2024-04-19 07:06:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图根据Subscriptions: list文档获取订阅列表。我想获取所有订阅服务器,因此在第一个请求之后,我在循环中的参数列表中使用mySubscribers=True。你知道吗

while "nextPageToken" in my_dict:
    next_page_token = my_dict["nextPageToken"]

    my_dict = subscriptions_list_by_channel_id(client,
        part='snippet,contentDetails',
        mySubscribers=True,
        maxResults=50,
        pageToken=next_page_token
        )

    for item in my_dict["items"]:
        file.write("{}\n".format(item["snippet"]["channelId"]))

问题是在第20页我的循环中断,也就是说,我没有在响应中收到一个nextPageToken键,将我的数据限制为1000个已获取的订户总数。但我有1000多艘潜艇。文档说明myRecentSubscribers有1000的限制,但mySubscribers没有。你知道吗

在任何地方都找不到什么帮助。对我的情况有什么线索吗?你知道吗


Tags: in文档tokentrue列表mypageitem