YouTube Data API V3 not returning Livestream from Channel ID - api

I'm working on a project that requires me to get a YouTube live stream's chat for use in my program. Everything was working perfectly with this js package, but it seems that google has changed something because it suddenly stopped working. I have regenerated keys, and am well below my quota, so I know that isn't the problem.
Strangely, when I use the youtube data api "try this api" section in their online documentation, the same problem is happening where the live stream is not found by the id. I've tried it on many different live channels, and all have returned an empty "items" array. Anyone else have this issue?
function execute() {
return gapi.client.youtube.search.list({
"part": "snippet, id",
"channelId": "UCSJ4gkVC6NrvII8umztf0Ow",
"eventType": "live",
"type": "video"
})
.then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function(err) { console.error("Execute error", err); });
}
Results from the request:
{
"kind": "youtube#searchListResponse",
"etag": "\"8jEFfXBrqiSrcF6Ee7MQuz8XuAM/4y-zlkAvKOyrH7TNQpxpBtYUxKU\"",
"regionCode": "US",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 5
},
"items": []
}

I can confirm this issue but the issue is a bug from Google. Hope it gets fixed soon.

There is definitely something going on with the YouTube Data API. If you give it a try on the on the Deverloper Console for Search: list it won't work if you are providing channelId. However, if you leave channelId blank it will return all of YouTube's live streams.
Google's instructions for getting help say to add the tag google-apis-explorer to your post. I have submitted an edit to add that tag to your original post. Hopefully we'll all get some answers soon.

Related

Bot not Responding Alert in Google Chat API

I have used same code as mentioned in one of the samples available on Google Chat Documentation
https://github.com/googleworkspace/hangouts-chat-samples/blob/master/java/basic-async-bot/src/main/java/com/google/chat/bot/basic/async/Bot.java
But the google chat is first giving the message "BOTNAME not responding" then the reply from the bot.
I have even tried to post the message with the thread from previous message as mentioned in the documentation. But still not getting desired result.
Any kind of help will be appreciated.
I eventually got it. Actually, I was sending a response to google chat with some content. When I modified it, by sending a response without any content, the error is resolved and it is working fine as accepted.
it's a shame I didn't see this issue before.
Check your APPSCRIPT.JSON for a chat property {} at the end. With updates when deploying is being overwritten but Google is already solving =)
Ex of my appssript.json: (Correct)
{
"timeZone": "America/Fortaleza",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"libraries": [
{
"userSymbol": "cGoa",
"libraryId": "1v_l4xN3ICa0lAW315NQEzAHPSoNiFdWHsMEwj2qA5t9cgZ5VWci2Qxv2",
"version": "36"
},
{
"userSymbol": "OAuth1",
"libraryId": "1CXDCY5sqT9ph64fFwSzVtXnbjpSfWdRymafDrtIZ7Z_hwysTY7IIhi7s",
"version": "18"
},
{
"userSymbol": "Verificacao_CallBack",
"libraryId": "1dgfE9K71u1k7tkxQHy2F2oAAAYB_lVnZOj8bmL0sl-vMEQYq8bYrDE1J",
"version": "0",
"developmentMode": true
}
]
},
"chat": {
}
}
You can deploys news versions in OLD apps script editors!

Issue with retrieving video statistics using youtube data api

I am using following youtbe data api url:
"https://www.googleapis.com/youtube/v3/videos?part=statistics&id=ZR2GpiDE4FI&key=yourkey"
I am getting response:
{
"kind": "youtube#videoListResponse",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/pox2n0n-cJSP1MGKUsoLm6qpH8E\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/iVM0LfP5vvHBM6wl1BhD0yBeR9k\"",
"id": "eZSe4xVXHhI"
}
]
}
statistics node is missing from the response .
Yes, as per the YouTube API docs, the statistics can be part of the response: https://developers.google.com/youtube/v3/docs/videos/list
I have noticed this as well last week that statistics for certain videos were empty.
Looks like there has been some change in the YouTube API and they stopped returning stats for older videos. Bug? New feature? I don't know.
However I can receive the statistics for newer videos but not the old ones anymore.
Best to get some response from someone from YouTube.

How to send pushes with "conditions" to pushwoosh with remote API?

I use the pushwoosh remote API and I can send pushes to all users and to just one device, good!
But now Im trying to be able to send pushes to different groups and Im trying to get "conditions" to work. But Im missing something and I don´t know what!
I have first created a tag called "Grupper" as a listtag at pushwoosh.
And it is registering the value "5A" at pushwoosh from the app.
And this is how I try to send a push from my server.
var tags="5A"
var data = {
"request": {
"application": applicationId,
"auth": authKey,
"notifications": [{
"send_date": "now",
"ignore_user_timezone": true,
"content": {
"en": pushtext
},
"conditions":["Grupper", "EQ", tags]
}]
}
};
And here its the "conditions" that is wrong somehow?
If I remove the row with "conditions" then it sends a push to all users, but if I use it, it sends nothing. No errors.
Any input really appreciated, after a couple of days trying, I still don´t know what Im missing :-)
A condition is always an array of arrays, therefore try this:
"conditions":[["Grupper", "EQ", tags]]
Also, since "Grupper" is a List-type tag, you can only use IN operator with it (see the docs here)

Google youtube api v3 does not return part "brandingSettings"

I am trying to extract the banner-image used in a certain youtube channel programmatically.
As far as I know it is to be in the brandingSettings, to be exact I think it is brandingSettings.image.bannerImageUrl, see here for an indetail description of the API:
https://developers.google.com/youtube/v3/docs/channels
So, I suppose I should be able to get that information with a GET request like this:
https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&key=[YOURAPIKEY]&forUsername=esltv
But that request (replacing the [YOURAPIKEY] with my actual key of course) returns without the desired part "brandingSettings":
{
"kind": "youtube#channelListResponse",
"etag": "\"79S54kzisD_9SOTfQLu_0TVQSpY/WJfuNLYVgEQVEhWQ-03PpQlCyzo\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "\"79S54kzisD_9SOTfQLu_0TVQSpY/GwL7oIruOCBr66yiNtrJqE3_Drs\"",
"id": "UC0G2qz-hoaCswQNgoWU_LTw"
}
]
}
I currently have turned on "YouTube Data API v3" in google api console.
Am I missing some permission, or does the channel somehow not suit in regard of retrieving its brandingSettings?
BRs,
Sebastian
for Username is actually for you to get the channelId. channels.list actually depends on channelId.
So with your first request you get channelID back, then do the same request second time, use channelId instead of username. (If you already know channelID use it first time as well.)
GET https://www.googleapis.com/youtube/v3/channels?part=brandingSettings&id=UC0G2qz-hoaCswQNgoWU_LTw&key={YOUR_API_KEY}

How to get the original message's message field through FbGraph /me/inbox?

I am trying to get the original message content from the /me/inbox through the API. I have authorized the read_inbox permission and got a bunch of message objects back. However, each of the message has no Subject nor Message (content). But it does contain comments which include a list of comments with the comment's message content.
Is this a permission issue? Or am I using the API wrong?
Message example below (using fake content for privacy reason.)
{
"id": "97654321",
"to": {
"data": [
{
"name": "Luke C.",
"id": "12346"
},
{
"name": "Mark D.",
"id": "12345"
}
]
},
"updated_time": "2013-01-31T19:10:17+0000",
"unread": 0,
"unseen": 0
}
Upon asking my colleague who have worked with FBgraph api for sometime already. It seems like the fbgraph inbox does behaved like this for a while and there does not seem to have any intention to fix it. And I also noticed that the me/outbox would behave as expected where a 'from'
Thus, I have moved onto using FQL to replace the me/inbox api:
SELECT body, recipients, sender, thread_id, message_id
FROM unified_message where thread_id IN
(SELECT thread_id FROM unified_thread WHERE folder = 'inbox')
If anyone know why FbGraph api does not work, please still help contribute to this question.