chore: add notification/record_interactions endpoint

This commit is contained in:
LuanRT
2022-05-30 17:03:38 -03:00
parent 82e8620a77
commit 71c4b16654
5 changed files with 342 additions and 115 deletions

View File

@@ -8,15 +8,16 @@ class NotificationItem {
static parseItem(item) {
if (item.notificationRenderer) {
const notification = item.notificationRenderer;
return {
title: notification?.shortMessage?.simpleText,
sent_time: notification?.sentTimeText?.simpleText,
timestamp: notification.notificationId,
channel_name: notification?.contextualMenu?.menuRenderer?.items[1]?.menuServiceItemRenderer?.text?.runs[1]?.text || 'N/A',
channel_thumbnail: notification?.thumbnail?.thumbnails[0],
video_thumbnail: notification?.videoThumbnail?.thumbnails[0],
video_url: notification.navigationEndpoint.watchEndpoint && `https://youtu.be/${notification.navigationEndpoint.watchEndpoint.videoId}` || 'N/A',
read: notification.read,
notification_id: notification.notificationId,
read: notification.read
};
}
}