首页 > 解决方案 > Gmail API,只有来自 Twitter 电子邮件的片段包含一堆 \u200c 字符,而不是真正的片段

问题描述

这就是我获取线程列表的方式:

page = resource.users().threads().list(
                userId='me', q='category: social',
                maxResults=50).execute()
threads_list = page.get('threads', [])

当我打印threads_list时,我会得到如下信息:

[{'id': '16643b797b5cf72d', 'snippet': 'Some normal thread snippet.', 'historyId': '461733'}, {'id': '16642fea8db13893', 'snippet': '\u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c \u200c', 'historyId': '461679'}]

在来自 twitter 的一封电子邮件的 gmail 片段中是:“Windows 10 最终将让你镜像你的 Android 手机的应用程序”,但我得到一堆零宽度非连接字符......

只是来自推特的片段是这样的,其他所有片段都是正常的。我正在使用现在已弃用的oauth2client来运行流程,也许这是问题所在,但我不确定。

标签: pythonemailoauth-2.0gmail-api

解决方案


推荐阅读