{"id":300329,"date":"2020-03-18T15:00:32","date_gmt":"2020-03-18T15:00:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=300329"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=300329","title":{"rendered":"\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0437 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0439 youtube + \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f google \u043d\u0430 PHP"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/492884\/\">\u041d\u0430 \u0434\u043d\u044f\u0445 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0437 \u0441\u0442\u0440\u0438\u043c\u0430 youtube. \u0421\u0442\u0430\u0442\u0435\u0439 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b, \u0430 \u0435\u0441\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0444\u0444. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0433\u0443\u0433\u043b. \u0421 \u043d\u0435\u0439 \u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f (\u043d\u0430\u0434\u0435\u044e\u0441\u044c) \u0438 \u0433\u043e\u0442\u043e\u0432 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u043f\u044b\u0442\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xt\/f3\/dr\/xtf3dr7igkgn6dylqy9njbn76iy.png\" alt=\"image\"><br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0435\u043b \u2014 \u044d\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/developers.google.com\/youtube\/v3\/live\/docs\/liveChatMessages\/list\" rel=\"nofollow\">LiveChatMessages: list<\/a>, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c liveChatId, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 <a href=\"https:\/\/developers.google.com\/youtube\/v3\/live\/docs\/liveBroadcasts\/list?apix_params=%7B%22part%22%3A%22id%2Csnippet%2CcontentDetails%22%2C%22broadcastStatus%22%3A%22all%22%7D\" rel=\"nofollow\">LiveBroadcasts: list<\/a>, \u043d\u043e \u0447\u0442\u043e \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0435\u0440\u0435\u0437 google \u0441 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430. \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b.<\/p>\n<h3>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<h4>\u041a\u043e\u043d\u0441\u043e\u043b\u044c \u0433\u0443\u0433\u043b<\/h4>\n<p>  <a href=\"https:\/\/developers.google.com\/identity\/protocols\/oauth2\/web-server\" rel=\"nofollow\">Using OAuth 2.0 for Web Server Applications<\/a>, \u0445\u043e\u0447\u0443 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e Web Server \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043b\u044e\u0447, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 js \u0436\u0438\u0432\u0435\u0442 \u0447\u0430\u0441, \u0430 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 (\u0431\u0435\u0437 \u0443\u0447\u0430\u0441\u0442\u0438\u044f \u044e\u0437\u0435\u0440\u0430) \u0442.\u043a. \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f refresh token. \u0422\u0430\u043a \u0436\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441 \u043d\u0438\u043c\u0438 \u0432\u0441\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435.<\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0430\u043a\u043a\u0430\u0443\u043d\u0442. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"https:\/\/console.developers.google.com\/\" rel=\"nofollow\">console.developers.google.com<\/a>, \u0437\u0434\u0435\u0441\u044c \u0432 \u043b\u0435\u0432\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0433\u043b\u0443 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u00ab\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4r\/og\/rt\/4rogrtnvccfw9lvz8asilqc194c.png\"><\/p>\n<p>  \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u00ab\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c API \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b\u00bb \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"https:\/\/console.developers.google.com\/apis\/library\" rel=\"nofollow\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 API<\/a><br \/>  \u0417\u0434\u0435\u0441\u044c \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 YouTube Data API v3.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u00ab\u041e\u043a\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 OAuth\u00bb \u043d\u0430 \u043b\u0435\u0432\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 (<a href=\"https:\/\/console.developers.google.com\/apis\/credentials\/consent\" rel=\"nofollow\">\u0438\u043b\u0438 \u0442\u0443\u0442<\/a>) \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u043a\u043d\u043e. <br \/>  \u041d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0448\u0430\u0433\u0435 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u043b\u044f User Type \u00ab\u0412\u043d\u0435\u0448\u043d\u0438\u0439\u00bb<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4y\/fk\/nc\/4yfkncdq8dlv40ufzntgz7g4_a4.png\"><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0432 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c 2 \u043f\u043e\u043b\u044f \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u00ab\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043c\u0435\u043d\u044b\u00bb, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u043e\u043c\u0435\u043d, \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 \u043f\u0443\u0441\u0442\u044b\u043c, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u044b\u0445 \u043d\u0435\u0442. \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/13\/mh\/23\/13mh23rszuqremjfky_hgsznvey.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00ab\u0423\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\u00bb (https:\/\/console.developers.google.com\/apis\/credentials)<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0441 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442 \u0442\u0430\u043a\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/af\/yp\/g0\/afypg03-958sw8zmlxofutkbnje.png\"><\/p>\n<p>  \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\u00bb -&gt; \u00ab\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 OAuth\u00bb<br \/>  \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043d\u0443\u0436\u043d\u044b\u0439 \u0442\u0438\u043f (\u0434\u043b\u044f \u043d\u0430\u0441 \u0432\u0435\u0431), \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438 \u00ab\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043d\u044b\u0435 URI \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u00bb \u2014 \u044d\u0442\u043e url \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043a\u043e\u0434 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u044e\u0434\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 url \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 <\/p>\n<blockquote><p><a href=\"http:\/\/localhost:8080\/oauth2callback.php\" rel=\"nofollow\">http:\/\/localhost:8080\/oauth2callback.php<\/a><\/p><\/blockquote>\n<p>  <\/p>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 <\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sp\/9y\/0w\/sp9y0wauytj8ldcjpbyiw2zoq3e.png\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u043a\u043d\u043e \u0441 ID \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c. \u041f\u043e\u043a\u0430 \u044d\u0442\u043e \u0441\u043c\u0435\u043b\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c. \u041f\u0435\u0440\u0435\u0434 \u0432\u0430\u043c\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fp\/ak\/vp\/fpakvpb5zmnrmjltpzkmlxadefe.png\"><\/p>\n<p>  \u041d\u0430\u0436\u0438\u043c\u0430\u0439\u0442\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043e\u0447\u043a\u0443 \u00ab\u0421\u043a\u0430\u0447\u0430\u0442\u044c\u00bb \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/z9\/rn\/ei\/z9rnei5e06sovlj1qtllcpw1ydc.png\"> <\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0432 secret_json.json. <\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043a\u043e\u0434\u0443.<\/p>\n<h4>PHP<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"plaintext\">php composer.phar require google\/apiclient:^2.0<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 composer \u0438 \u043a\u0430\u043a \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u2014 <a href=\"https:\/\/habr.com\/ru\/post\/439200\/\">\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c<\/a><br \/>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 2 \u0444\u0430\u0439\u043b\u0430 \u2014 index.php \u0438 oauth2callback.php<br \/>  \u041c\u043e\u0436\u0435\u0442\u0435, \u043a\u0441\u0442\u0430\u0442\u0438, \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0430\u0448 PHP \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<pre><code class=\"plaintext\">php -S localhost:8080<\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0444\u0430\u0439\u043b secret_json.json (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u043a\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435) \u0432 \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 Index.php \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 index.php<\/p>\n<pre><code class=\"php\">&lt;?php require_once __DIR__ . '\/vendor\/autoload.php';  $client = new Google_Client(); \/\/ \u044d\u0442\u043e \u043f\u0443\u0442\u044c \u0434\u043e \u043d\u0430\u0448\u0435\u0433\u043e \u0444\u0430\u0439\u043b\u0430 $client-&gt;setAuthConfig('client_secret.json'); \/\/ \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 $client-&gt;setScopes([     'https:\/\/www.googleapis.com\/auth\/youtube.readonly', ]); \/\/ \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f refresh_token $client-&gt;setAccessType(&quot;offline&quot;);  if (isset($_SESSION['access_token']) &amp;&amp; $_SESSION['access_token']) {     $client-&gt;setAccessToken($_SESSION['access_token']); } else {     $redirect_uri = 'http:\/\/' . $_SERVER['HTTP_HOST'] . '\/oauth2callback.php';     header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));     exit(); }  $refreshToken = $_SESSION['access_token']['refresh_token']; $accessToken = $_SESSION['access_token']['access_token']; $tknType = $_SESSION['access_token']['token_type']; $clientId = $client-&gt;getClientId(); $created = $_SESSION['access_token']['created']; unset($_SESSION['access_token']); unset($_SESSION['user']); session_destroy();  $data = json_encode([   'refreshToken' =&gt; $refreshToken,     'accessToken' =&gt; $accessToken,     'tknType' =&gt; $tknType,     'clientId' =&gt; $clientId,     'created' =&gt; $created ]); echo $data; <\/code><\/pre>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043e\u0442\u0434\u0430\u0441\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432\u044b \u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0431\u0430\u0437\u0443 (\u0438\u043b\u0438 \u0431\u043b\u043e\u043a\u043d\u043e\u0442).<\/p>\n<p>  \u0424\u0430\u0439\u043b oauth2callback.php:<\/p>\n<pre><code class=\"php\">&lt;?php require_once __DIR__.'\/vendor\/autoload.php';  session_start();  $client = new Google_Client(); $client-&gt;setAuthConfigFile('client_secret.json'); $client-&gt;setRedirectUri('http:\/\/' . $_SERVER['HTTP_HOST'] . '\/oauth2callback.php'); $client-&gt;setScopes([     'https:\/\/www.googleapis.com\/auth\/youtube.readonly', ]); $client-&gt;setApprovalPrompt('force'); $client-&gt;setAccessType(&quot;offline&quot;);  if (!isset($_GET['code'])) {     $auth_url = $client-&gt;createAuthUrl();     header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL)); } else {     $client-&gt;authenticate($_GET['code']);     $_SESSION['access_token'] = $client-&gt;getAccessToken();     $redirect_uri = 'http:\/\/' . $_SERVER['HTTP_HOST'] . '\/';     header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); } <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u044e\u0437\u0435\u0440\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0433\u0443\u0433\u043b \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0442\u043e\u043a\u0435\u043d\u0435 \u0432 \u0441\u0435\u0441\u0441\u0438\u044e. \u041f\u043e\u0441\u043b\u0435, \u0432\u0435\u0440\u043d\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e, \u0433\u0434\u0435 index.php \u0443\u0436\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438.<br \/>  \u0412\u044b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u044f\u043c\u043e \u0432 oauth2callback \u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 index \u0438\u043b\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043b\u044e\u0431\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0432\u0430\u0441 \u0430\u0434\u0440\u0435\u0441. \u0422\u0430\u043a \u0436\u0435, \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435 \u0443\u0447\u0442\u0435\u043d\u044b \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0443\u0447\u0442\u0438\u0442\u0435 \u044d\u0442\u043e.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043e. \u0423 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c access_token \u0438 refresh_token, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0437\u044c\u043c\u0435\u043c\u0441\u044f \u0437\u0430 \u044e\u0442\u0443\u0431.<\/p>\n<h3>\u042e\u0442\u0443\u0431\u0435<\/h3>\n<p>  <\/p>\n<h4>\u0421\u0440\u0430\u0437\u0443 PHP<\/h4>\n<p>  getStreams.php:<\/p>\n<pre><code class=\"php\">&lt;?php require_once __DIR__ . '\/vendor\/autoload.php'; \/\/ \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435 require_once __DIR__ . '\/refreshToken.php';  $client = new Google_Client(); $client-&gt;setAuthConfig('client_secret.json'); $client-&gt;setScopes([     'https:\/\/www.googleapis.com\/auth\/youtube.readonly', ]); $client-&gt;setAccessType(&quot;offline&quot;);  \/\/ \u043c\u0430\u0441\u0441\u0438\u0432 $data \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (\u044f \u043f\u0438\u0448\u0443 \u0432 \u0431\u0434) if (($data['created'] - time()) &lt;= -3600) {     $data = refreshToken($data['refreshToken'], $db); }  $client-&gt;setAccessToken($data['accessToken']); $service = new Google_Service_YouTube($client); \/\/ \u0434\u0435\u043b\u0430\u0435\u043c 2 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0433\u0443\u0433\u043e\u043b \u043e\u0442\u0434\u0430\u0435\u0442 \u0438\u043b\u0438 \u0438\u0434\u0443\u0449\u0438\u0435 \u0438\u043b\u0438 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u0438,  \/\/ \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0438 \u0442\u0435 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. $queryParams = [     'broadcastStatus' =&gt; 'upcoming',     'maxResults' =&gt; 50 ]; $response = $service-&gt;liveBroadcasts-&gt;listLiveBroadcasts('id,snippet,status', $queryParams); $items = $response['items']; $streamsUpcoming = itemsGenerator($items);  $queryParams = [     'broadcastStatus' =&gt; 'active',     'maxResults' =&gt; 50 ]; $response = $service-&gt;liveBroadcasts-&gt;listLiveBroadcasts('id,snippet,status', $queryParams); $items = $response['items']; $streamsActive = itemsGenerator($items); $streams = array_merge($streamsUpcoming, $streamsActive);  \/\/ \u043e\u0442\u0434\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 echo json_encode($streams);  \/\/ \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u0432\u0435\u0442 \u0433\u0443\u0433\u043b\u0430 \u043a \u0432\u0438\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043c. function itemsGenerator($items) {     $streams = [];     foreach ($items as $item) {         \/\/ \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0446\u0438\u044f \u0432 \u044d\u0444\u0438\u0440\u0435 \u0438\u043b\u0438 \u0437\u0430\u043f\u043b\u043f\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430 (\u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043c)         if (!isset($item['snippet']['actualEndTime'])) {             $streams[] = [                 'id' =&gt; $item['id'],                 'title' =&gt; $item['snippet']['title'],                 'description' =&gt; $item['snippet']['description'],                 'image' =&gt; $item['snippet']['thumbnails']['medium']['url'],                 'liveChatId' =&gt; $item['snippet']['liveChatId'],                 'channelId' =&gt; $item['snippet']['channelId']             ];         }     }     return $streams; }  <\/code><\/pre>\n<p>  \u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u0432\u043e\u0442 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0435\u0449\u0435 \u043f\u0440\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438?<\/p>\n<pre><code class=\"php\">$client-&gt;setScopes([     'https:\/\/www.googleapis.com\/auth\/youtube.readonly', ]); <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0432\u043e\u0442, \u043e\u043d\u0438 \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0442 \u0437\u0430 \u0442\u043e \u043a\u0430\u043a\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0432\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0435\u0441\u0442\u044c \u0435\u0449\u0435 <code>https:\/\/www.googleapis.com\/auth\/youtube.upload<\/code> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p>\n<p>  refreshToken.php:<\/p>\n<pre><code class=\"php\">&lt;?php require_once __DIR__ . '\/vendor\/autoload.php';  \/**  * @param string $refreshToken  * @param $db  * @return array  * @throws Google_Exception  *\/ function refreshToken($refreshToken, $db) {     $client = new Google_Client();     $client-&gt;setAuthConfig('client_secret.json');     $client-&gt;setScopes([         'https:\/\/www.googleapis.com\/auth\/youtube.readonly',     ]);     $client-&gt;setAccessType(&quot;offline&quot;);      $client-&gt;refreshToken($refreshToken);     $accessToken = $client-&gt;getAccessToken();      $refreshToken = $accessToken['refresh_token'];     $accessToken = $accessToken['access_token'];     $clientId = $client-&gt;getClientId();     $data = [         'refreshToken' =&gt; $refreshToken,         'accessToken' =&gt; $accessToken,         'tknType' =&gt; 'Bearer',         'clientId' =&gt; $clientId,         'created' =&gt; time()     ];      \/\/ \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0431\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.      return $data; } <\/code><\/pre>\n<p>  \u0422\u043e\u043a\u0435\u043d, \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0439 \u0433\u0443\u0433\u043b\u043e\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441. \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u0441\u0443\u0442\u043e\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 25 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430, \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0448 \u0442\u043e\u043a\u0435\u043d \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0412 getStreams \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430. <\/p>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446<br \/>  getStreamMessages.php:<\/p>\n<pre><code class=\"php\">&lt;?php require_once __DIR__ . '\/vendor\/autoload.php'; require_once __DIR__ . '\/refreshToken.php';  $client = new Google_Client(); $client-&gt;setAuthConfig('client_secret.json'); $client-&gt;setScopes([     'https:\/\/www.googleapis.com\/auth\/youtube.readonly', ]); $client-&gt;setAccessType(&quot;offline&quot;); \/\/ $data - \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438\u0437 \u0431\u0434 if (($data['created'] - time()) &lt;= -3600) {     $data = refreshToken($data['refreshToken'], $db); } $client-&gt;setAccessToken($data['accessToken']);  $service = new Google_Service_YouTube($client);  $queryParams = [     'maxResults' =&gt; 2000,     'profileImageSize' =&gt; 120 ];  $response = $service-&gt;liveChatMessages-&gt;listLiveChatMessages($liveChatId, 'id,snippet,authorDetails', $queryParams);  echo json_encode($response); <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u044f \u0443\u0436\u0435 \u043d\u0435 \u0441\u0442\u0430\u043b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u0441\u0430\u043c\u0438, \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 $response \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432\u0441\u044f \u043d\u0443\u0436\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f, \u0430 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/developers.google.com\/youtube\/v3\/live\/docs\/liveChatMessages\/list\" rel=\"nofollow\">\u0432\u043e\u0442<\/a>.<\/p>\n<p>  \u0427\u0442\u043e \u043c\u0435\u043d\u044f \u0440\u0430\u0441\u0441\u0442\u0440\u043e\u0438\u043b\u043e \u0442\u0430\u043a \u044d\u0442\u043e \u0442\u043e \u0447\u0442\u043e \u043d\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0445\u0443\u043a\u043e\u0432 (\u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c, \u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0443, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430) \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. <\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e liveChatMessages, \u0432 \u043d\u0435\u043c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0432\u0440\u043e\u0434\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u043d\u043e\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0448\u0435\u043b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<p>  <a href=\"https:\/\/github.com\/Aleksandr-yask\/youtube-LiveChatMessages-php\" rel=\"nofollow\">Github \u043f\u0440\u043e\u0435\u043a\u0442<\/a> \u0441 \u0431\u0434 (\u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u0444\u0430\u0439\u043b client_secret.json)<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/492884\/\"> https:\/\/habr.com\/ru\/post\/492884\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/492884\/\">\u041d\u0430 \u0434\u043d\u044f\u0445 \u0432\u0441\u0442\u0430\u043b\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0437 \u0441\u0442\u0440\u0438\u043c\u0430 youtube. \u0421\u0442\u0430\u0442\u0435\u0439 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0432\u043e\u0434\u0443 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b, \u0430 \u0435\u0441\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0444\u0444. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0433\u0443\u0433\u043b. \u0421 \u043d\u0435\u0439 \u044f \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f (\u043d\u0430\u0434\u0435\u044e\u0441\u044c) \u0438 \u0433\u043e\u0442\u043e\u0432 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u043f\u044b\u0442\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xt\/f3\/dr\/xtf3dr7igkgn6dylqy9njbn76iy.png\" alt=\"image\">  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-300329","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=300329"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/300329\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=300329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=300329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=300329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}