i'm working on youtube data api v3.
i want know how can check if video has been disabled or removed youtube.
e.g: https://www.youtube.com/watch?v=dht_6z2oazi
https://www.googleapis.com/youtube/v3/videos?id=dht_6z2oazi &part=snippet,contentdetails,player,statistics,status &key=[mykey] i can not idea api.
{ "kind": "youtube#videolistresponse", "etag": "\"idqj1j7zks4x3o3zsflbowgwahu/y7032ccbqsaurzeivmjdfyzamtg\"", "pageinfo": { "totalresults": 1, "resultsperpage": 1 }, "items": [ { "kind": "youtube#video", "etag": "\"idqj1j7zks4x3o3zsflbowgwahu/2forrsugqbs1nvqk3ar1pfmin7i\"", "id": "dht_6z2oazi", "snippet": {}, "contentdetails": { "duration": "pt1h31m1s", "dimension": "2d", "definition": "sd", "caption": "false", "licensedcontent": false }, "status": { "uploadstatus": "processed", "privacystatus": "public", "license": "youtube", "embeddable": true, "publicstatsviewable": true }, "statistics": { "viewcount": "301", "likecount": "0", "dislikecount": "0", "favoritecount": "0", "commentcount": "0" }, "player": { "embedhtml": "<iframe width=\"640\" height=\"360\" src=\"//www.youtube.com/embed/dht_6z2oazi\" frameborder=\"0\" allowfullscreen></iframe>" } } ] } i tried
https://www.googleapis.com/youtube/v3/videos ?part=id &key=[mykey] &id=dht_6z2oazi but it's not working, still give result.
there's status field in results posted. think subfield closely relates want uploadstatus. when perform api call video, get:
"status": { "uploadstatus": "rejected", "rejectionreason": "uploaderaccountsuspended", "privacystatus": "public", "license": "youtube", "embeddable": true, "publicstatsviewable": true } from documentation, here possible values uploadstatus:
- deleted
- failed
- processed
- rejected
- uploaded
after video uploaded , processed, should accessible users (assuming it's public). therefore, should checking if status "rejected" or "deleted".
Comments
Post a Comment