Spaces:
Sleeping
Sleeping
Update get_gmail_data.py
Browse files- get_gmail_data.py +3 -0
get_gmail_data.py
CHANGED
@@ -85,6 +85,7 @@ class GmailDataExtractor:
|
|
85 |
Raises:
|
86 |
RuntimeError: If there is an issue while fetching message data from the Gmail API.
|
87 |
"""
|
|
|
88 |
message_url = f"https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}"
|
89 |
try:
|
90 |
response = requests.get(message_url, headers={"Authorization": f"Bearer {self.__jwt}"})
|
@@ -107,6 +108,7 @@ class GmailDataExtractor:
|
|
107 |
Raises:
|
108 |
RuntimeError: If there is an issue while fetching attachment data from the Gmail API.
|
109 |
"""
|
|
|
110 |
attachment_url = f"https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}/attachments/{attachment_id}"
|
111 |
try:
|
112 |
response = requests.get(attachment_url, headers={"Authorization": f"Bearer {self.__jwt}"})
|
@@ -129,6 +131,7 @@ class GmailDataExtractor:
|
|
129 |
Raises:
|
130 |
RuntimeError: If there is an issue while fetching message data from the Gmail API.
|
131 |
"""
|
|
|
132 |
message_id = message.get("id")
|
133 |
if not message_id:
|
134 |
return None, None, [], False
|
|
|
85 |
Raises:
|
86 |
RuntimeError: If there is an issue while fetching message data from the Gmail API.
|
87 |
"""
|
88 |
+
print("fetch_message_data")
|
89 |
message_url = f"https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}"
|
90 |
try:
|
91 |
response = requests.get(message_url, headers={"Authorization": f"Bearer {self.__jwt}"})
|
|
|
108 |
Raises:
|
109 |
RuntimeError: If there is an issue while fetching attachment data from the Gmail API.
|
110 |
"""
|
111 |
+
print("fetch_attachment_data")
|
112 |
attachment_url = f"https://www.googleapis.com/gmail/v1/users/me/messages/{message_id}/attachments/{attachment_id}"
|
113 |
try:
|
114 |
response = requests.get(attachment_url, headers={"Authorization": f"Bearer {self.__jwt}"})
|
|
|
131 |
Raises:
|
132 |
RuntimeError: If there is an issue while fetching message data from the Gmail API.
|
133 |
"""
|
134 |
+
print("process_messages")
|
135 |
message_id = message.get("id")
|
136 |
if not message_id:
|
137 |
return None, None, [], False
|