{"id":325837,"date":"2021-07-02T09:00:09","date_gmt":"2021-07-02T09:00:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325837"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325837","title":{"rendered":"\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 youtube \u0432 csv"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u0430\u043a-\u0442\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c youtube \u043a\u0430\u043d\u0430\u043b\u0435, \u0443\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448 \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0431\u044b\u043b\u043e \u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0446\u0435\u043d\u0443 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0430\u043a\u0446\u0438\u0439 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0440\u0451\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439.<\/p>\n<p>\u041c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0437\u0430 \u043a\u0430\u043a\u0438\u0435 \u0446\u0435\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043b\u0438 &#171;\u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0440\u0430\u0437\u0443\u043c&#187;, \u043a\u043e\u0433\u0434\u0430 \u043f\u0443\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u044f\u0442\u044b\u0439 \u0433\u043e\u043b\u043e\u0441 \u0431\u044b\u043b \u0434\u0430\u043b\u0451\u043a \u043e\u0442 \u0438\u0441\u0442\u0438\u043d\u044b, \u043d\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u043e \u0432 \u0442\u043e\u0447\u043a\u0443.<\/p>\n<p>\u041f\u043b\u044e\u0441 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0431\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u043b\u0430\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0435\u0434\u0438\u043d\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0430 \u043d\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443, \u0433\u0434\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0432\u043e\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. <\/p>\n<p>\u0417\u0430\u0441\u043f\u043e\u0439\u043b\u0435\u0440\u044e: \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u043e\u0439 \u0442\u0440\u0443\u0434\u043e\u0451\u043c\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0430\u0436\u0435 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u043e\u0442\u0432\u0435\u0442\u0430 (\u043e\u043a \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0432\u0430\u043b\u0438\u0440\u0443\u044e\u0449\u0430\u044f, \u043d\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f): <\/p>\n<ul>\n<li>\n<p>\u043e\u0434\u043d\u0438 \u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043f\u043e\u0442\u043e\u043c \u0446\u0435\u043d\u0443, \u0434\u0440\u0443\u0433\u0438\u0435 &#8212; \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u0446\u0435\u043d\u0443, \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044e (\u043a\u043e\u0435-\u043a\u0442\u043e \u043f\u0438\u0441\u0430\u043b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u043d\u044b\u0445 \u0441\u043b\u043e\u0432 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0435\u0433\u043e \u043c\u044b\u0441\u043b\u0438 \u0438 \u043f\u043e\u0442\u043e\u043c \u0446\u0435\u043d\u0443)<\/p>\n<\/li>\n<li>\n<p>\u0413\u0434\u0435-\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0433\u0434\u0435-\u0442\u043e \u0442\u0438\u043a\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0441\u0442\u0430\u043c\u0438 \u0442\u0435\u043a\u0441\u0442 \u0431\u044b\u043b \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c, \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u043e\u0431\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043e\u0442\u0434\u0435\u043b\u044f\u043b\u0438 \u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0438 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432 (\u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0432\u0435)<\/p>\n<\/li>\n<li>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043e \u0434\u0432\u0443\u0445 \u0431\u0443\u043a\u0432, \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0430\u0441\u044c \u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u043b\u0438 \u0438 \u0436\u0430\u0440\u0433\u043e\u043d\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 (\u0411\u0443\u043c\u0435\u0440 \u0432\u043c\u0435\u0441\u0442\u043e BMW), \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0435 (Bayerische Motoren Werke)<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e \u043f\u0440\u0438\u0437\u0451\u0440\u0430\u043c\u0438 \u0432 \u0431\u043e\u0440\u044c\u0431\u0435 \u0441 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0441\u0442\u0430\u043b\u0438 \u043b\u044e\u0434\u0438, \u043f\u0438\u0441\u0430\u0432\u0448\u0438\u0435 \u0432 \u0441\u043b\u043e\u0432\u0430\u0445 Tesla \u0438 BMW &#8212; \u0440\u0443\u0441\u0441\u043a\u0443\u044e \u0431\u0443\u043a\u0432\u0443 &#171;\u0442&#187; \u0438 \u0440\u0443\u0441\u0441\u043a\u0443\u044e &#171;\u0432&#187; \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0430 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0432\u0448\u0438\u0435 \u0435\u0433\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438 \u200b  <\/p>\n<p>(\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043f\u043e \u0447\u0438\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f json \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043a\u043e\u0433\u0434\u0430 \u043b\u0430\u0442\u0438\u043d\u0438\u0446\u0430 \u0438\u0434\u0451\u0442 \u0431\u0443\u043a\u0432\u0430\u043c\u0438, \u0430 \u0432\u0435\u0441\u044c \u044e\u043d\u0438\u043a\u043e\u0434 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0448\u0430\u043c\u0438 \u0441 \u043a\u043e\u0434\u0430\u043c\u0438)<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f? \u0412\u0435\u0434\u044c \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u044b \/ \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 Yotube API<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0435 \u0432\u0441\u0435 \u0445\u043e\u0442\u044f\u0442 \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445 \u0445\u043e\u0440\u043e\u0448\u043e \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c, \u0434\u0430 \u0438 \u0437\u0430\u0447\u0435\u043c \u043a\u0443\u0440\u0438\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u043c\u0430\u043d\u0443\u0430\u043b\u044b, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u0437\u043a\u0430\u044f \u0438 \u043e\u0434\u043d\u043e\u0441\u043b\u043e\u0436\u043d\u0430\u044f.<\/p>\n<p>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c, \u0434\u0443\u043c\u0430\u044e \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<\/div>\n<\/details>\n<p><em>\u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e\u0439 \u0438 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0448\u0430\u0433\u043e\u0432, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438.<\/em><\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 youtube API (<a href=\"https:\/\/developers.google.com\/youtube\/v3\/getting-started\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/a>)<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0438\u0435 \u0432\u0430\u0448 \u0433\u0443\u0433\u043b-\u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/console.developers.google.com\/\" rel=\"noopener noreferrer nofollow\">https:\/\/console.developers.google.com\/<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" inline=\"true\" class=\"image image-inline\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/126\/907\/521\/126907521dcd99c898307ccd8cb983e4.png\" width=\"1021\" height=\"361\"><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439 <a href=\"https:\/\/console.developers.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">https:\/\/console.developers.google.com\/apis\/credentials<\/a><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 API \u043a\u043b\u044e\u0447<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" inline=\"true\" class=\"image image-inline\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/caf\/b96\/ddc\/cafb96ddcaa6339d80161b59fe0a9652.jpg\" width=\"1018\" height=\"678\"><img loading=\"lazy\" decoding=\"async\" inline=\"true\" class=\"image image-inline\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7a8\/7fd\/376\/7a87fd37624434c40d2c61349b498058.jpg\" width=\"505\" height=\"300\"><\/p>\n<p>(\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043d\u0435 \u0438\u0441\u043a\u0430\u0442\u044c)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 <a href=\"https:\/\/console.cloud.google.com\/apis\/dashboard\" rel=\"noopener noreferrer nofollow\">https:\/\/console.cloud.google.com\/apis\/dashboard<\/a><\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f API<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" inline=\"true\" class=\"image image-inline\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/27d\/994\/650\/27d994650fd88868447948390bb1e518.jpg\" width=\"1012\" height=\"457\"><\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 YouTube Data API v3<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" inline=\"true\" class=\"image image-inline\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a65\/5a5\/b53\/a655a5b5310f7393b204e23ed44adeb5.jpg\" width=\"1013\" height=\"400\"><\/p>\n<\/li>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0435\u0433\u043e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" inline=\"true\" class=\"image image-inline\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d6c\/748\/1e2\/d6c7481e2c80739b1728d6587854ddc9.jpg\" width=\"1014\" height=\"336\"><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 google-api-python-client (<a href=\"https:\/\/github.com\/googleapis\/google-api-python-client\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/a>)<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/www.python.org\/downloads\/\" rel=\"noopener noreferrer nofollow\">python<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<p><code>pip.exe install google-api-python-client<\/code><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/code.visualstudio.com\/Download\" rel=\"noopener noreferrer nofollow\">visual studio code<\/a><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 python \u0444\u0430\u0439\u043b \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434<\/p>\n<p>\u0412\u0441\u0451 \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 \u043d\u0451\u043c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u044d\u0442\u043e <\/p>\n<ul>\n<li>\n<p>DEVELOPER_KEY &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0443\u043d\u043a\u0442\u0435<\/p>\n<\/li>\n<li>\n<p>VIDEO_ID &#8212; \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/youtu.be\/9b4-G-czN5Y\" rel=\"noopener noreferrer nofollow\">https:\/\/youtu.be\/9b4-G-czN5Y<\/a> \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 9b4-G-czN5Y<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre><code class=\"python\"># -*- coding: utf-8 -*-  import os import googleapiclient.discovery import csv  DEVELOPER_KEY = \"AIzaSyB7oKxIsd4690TibZHZPaTLzw7nqzgrr4k\" VIDEO_ID = \"9b4-G-czN5Y\"  # \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 def youtube(nextPageToken=None):     # Disable OAuthlib's HTTPS verification when running locally.     # *DO NOT* leave this option enabled in production.     os.environ[\"OAUTHLIB_INSECURE_TRANSPORT\"] = \"1\"      api_service_name = \"youtube\"     api_version = \"v3\"          youtube = googleapiclient.discovery.build(         api_service_name, api_version, developerKey = DEVELOPER_KEY)      request = youtube.commentThreads().list(         part=\"id,snippet\",         maxResults=100,         pageToken=nextPageToken,         videoId=VIDEO_ID     )     response = request.execute()     return response  # \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u043f\u043b\u0430\u0435\u0432 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 def youtubechild(NextParentId, nextPageToken=None):     # Disable OAuthlib's HTTPS verification when running locally.     # *DO NOT* leave this option enabled in production.     os.environ[\"OAUTHLIB_INSECURE_TRANSPORT\"] = \"1\"      api_service_name = \"youtube\"     api_version = \"v3\"      youtube = googleapiclient.discovery.build(         api_service_name, api_version, developerKey = DEVELOPER_KEY)      request = youtube.comments().list(         part=\"id,snippet\",         maxResults=100, \tpageToken=nextPageToken,         parentId=NextParentId     )     response = request.execute()     return response  # \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f def main():     # \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438     print('download comments')     response = youtube()     items = response.get(\"items\")     nextPageToken = response.get(\"nextPageToken\") # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438, \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     i=1     while nextPageToken is not None:         print(str(i*100)) # \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u0430\u044f \u0441\u043e\u0442\u043d\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f         response = youtube(nextPageToken)         nextPageToken = response.get(\"nextPageToken\")         items = items + response.get(\"items\")         i+=1      print(len(items)) # \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043a\u0430\u0447\u0430\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432      # \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u043f\u043b\u0430\u0438 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438     print('download replies')     replies = []     for line in items: # \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u043c         if line.get(\"snippet\").get(\"totalReplyCount\") &gt; 0: # \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u043f\u043b\u0430\u0438             print(line.get(\"snippet\").get(\"totalReplyCount\")) # \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u043f\u043b\u0430\u0435\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0435\u043d\u043e             response = youtubechild(line.get(\"snippet\").get(\"topLevelComment\").get(\"id\"))             replies = replies + response.get(\"items\")             nextPageToken = response.get(\"nextPageToken\")             i=1             while nextPageToken is not None: # \u0434\u043e\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0440\u0435\u043f\u043b\u0430\u0438, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043f\u043e\u0440\u0446\u0438\u0438                 response = youtubechild(line.get(\"snippet\").get(\"topLevelComment\").get(\"id\"), nextPageToken)                 nextPageToken = response.get(\"nextPageToken\")                 replies = replies + response.get(\"items\")                 i+=1      print(len(replies)) # \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043a\u0430\u0447\u0430\u043d\u044b\u0445 \u0440\u0435\u043f\u043b\u0430\u0435\u0432      # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u0440\u0435\u043f\u043b\u0430\u0438 \u043d\u0430 \u043d\u0438\u0445 \u0432 \u0444\u0430\u0439\u043b csv     print(\"Open csv file\")     with open('youtuberesults.csv', 'w', encoding=\"utf-8\") as csv_file:  #\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f with, \u0447\u0442\u043e\u0431\u044b \u0444\u0430\u0439\u043b \u0437\u0430\u043a\u0440\u044b\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u0430\u043d\u0434         writer = csv.writer(csv_file, quoting=csv.QUOTE_ALL, lineterminator='\\r') # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u0432\u043e\u0439\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u044f\u0442\u0443\u044e, \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 LibreOffice Calc          # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432         row = [               'etag'             , 'parentid'             , 'id'             , 'textDisplay'             , 'textOriginal'             , 'authorDisplayName'             , 'authorProfileImageUrl'             , 'authorChannelUrl'             , 'authorChannelId'             , 'likeCount'             , 'publishedAt'             , 'updatedAt'         ]         print(\"Start write in csv\")           writer.writerow(row) # \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b              # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438         print(\"Write comments in csv\")           for line in items:             topLevelComment = line.get(\"snippet\").get(\"topLevelComment\")             # \u0431\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f             if topLevelComment.get('snippet').get('authorChannelId') is not None:                 authorChannelId = topLevelComment.get('snippet').get('authorChannelId').get('value')             else:                 authorChannelId = ''             row = [                   topLevelComment.get('etag')                 , topLevelComment.get('id')                 , topLevelComment.get('id')                 , topLevelComment.get('snippet').get('textDisplay')                 , topLevelComment.get('snippet').get('textOriginal')                 , topLevelComment.get('snippet').get('authorDisplayName')                 , topLevelComment.get('snippet').get('authorProfileImageUrl')                 , topLevelComment.get('snippet').get('authorChannelUrl')                 , authorChannelId                 , topLevelComment.get('snippet').get('likeCount')                 , topLevelComment.get('snippet').get('publishedAt')                 , topLevelComment.get('snippet').get('updatedAt')             ]             writer.writerow(row)          # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0440\u0435\u043f\u043b\u0430\u0438         print(\"Write replies in csv\")           for line in replies:             # \u0431\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f             if line.get('snippet').get('authorChannelId') is not None:                 authorChannelId = line.get('snippet').get('authorChannelId').get('value')             else:                 authorChannelId = ''             row = [                   line.get('etag')                 , line.get('snippet').get('parentId')                 , line.get('id')                 , line.get('snippet').get('textDisplay')                 , line.get('snippet').get('textOriginal')                 , line.get('snippet').get('authorDisplayName')                 , line.get('snippet').get('authorProfileImageUrl')                 , line.get('snippet').get('authorChannelUrl')                 , authorChannelId                 , line.get('snippet').get('likeCount')                 , line.get('snippet').get('publishedAt')                 , line.get('snippet').get('updatedAt')             ]             writer.writerow(row)              print(\"done\")    if __name__ == \"__main__\":     main() <\/code><\/pre>\n<p>\u0412 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e YouTube API. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 csv \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 LibreOffice&nbsp;Calc. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f&nbsp;\u0434\u0432\u043e\u0439\u043d\u044b\u0435&nbsp;\u043a\u0430\u0432\u044b\u0447\u043a\u0438&nbsp;\u0438&nbsp;\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c&nbsp;\u0437\u0430\u043f\u044f\u0442\u0430\u044f, \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 UTF-8.&nbsp;<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043e\u0442 \u0440\u0435\u043f\u043b\u0430\u044f \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c parentid \u0441 id &#8212; \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0445 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439, \u0438\u043d\u0430\u0447\u0435 \u0440\u0435\u043f\u043b\u0430\u0439.<\/p>\n<\/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\/565812\/\"> https:\/\/habr.com\/ru\/post\/565812\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u0430\u043a-\u0442\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c youtube \u043a\u0430\u043d\u0430\u043b\u0435, \u0443\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448 \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0442\u043e\u0440\u043e\u0432.<\/p>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0431\u044b\u043b\u043e \u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0446\u0435\u043d\u0443 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0430\u043a\u0446\u0438\u0439 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0440\u0451\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439.<\/p>\n<p>\u041c\u043d\u0435 \u0441\u0442\u0430\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0437\u0430 \u043a\u0430\u043a\u0438\u0435 \u0446\u0435\u043d\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043b\u0438 &#171;\u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0440\u0430\u0437\u0443\u043c&#187;, \u043a\u043e\u0433\u0434\u0430 \u043f\u0443\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u044f\u0442\u044b\u0439 \u0433\u043e\u043b\u043e\u0441 \u0431\u044b\u043b \u0434\u0430\u043b\u0451\u043a \u043e\u0442 \u0438\u0441\u0442\u0438\u043d\u044b, \u043d\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u043e \u0432 \u0442\u043e\u0447\u043a\u0443.<\/p>\n<p>\u041f\u043b\u044e\u0441 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0431\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u043b\u0430\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0435\u0434\u0438\u043d\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435, \u0430 \u043d\u0435 \u0432 \u0444\u043e\u0440\u043c\u0443, \u0433\u0434\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0432\u043e\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u0438 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. <\/p>\n<p>\u0417\u0430\u0441\u043f\u043e\u0439\u043b\u0435\u0440\u044e: \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u043e\u0439 \u0442\u0440\u0443\u0434\u043e\u0451\u043c\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u0434\u0430\u0436\u0435 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u043e\u0442\u0432\u0435\u0442\u0430 (\u043e\u043a \u0431\u044b\u043b\u0430 \u043f\u0440\u0435\u0432\u0430\u043b\u0438\u0440\u0443\u044e\u0449\u0430\u044f, \u043d\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f): <\/p>\n<ul>\n<li>\n<p>\u043e\u0434\u043d\u0438 \u043f\u0438\u0441\u0430\u043b\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043f\u043e\u0442\u043e\u043c \u0446\u0435\u043d\u0443, \u0434\u0440\u0443\u0433\u0438\u0435 &#8212; \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u0446\u0435\u043d\u0443, \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044e (\u043a\u043e\u0435-\u043a\u0442\u043e \u043f\u0438\u0441\u0430\u043b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043c\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u043d\u044b\u0445 \u0441\u043b\u043e\u0432 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0435\u0433\u043e \u043c\u044b\u0441\u043b\u0438 \u0438 \u043f\u043e\u0442\u043e\u043c \u0446\u0435\u043d\u0443)<\/p>\n<\/li>\n<li>\n<p>\u0413\u0434\u0435-\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0433\u0434\u0435-\u0442\u043e \u0442\u0438\u043a\u0435\u0440<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0441\u0442\u0430\u043c\u0438 \u0442\u0435\u043a\u0441\u0442 \u0431\u044b\u043b \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c, \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0414\u0440\u043e\u0431\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043e\u0442\u0434\u0435\u043b\u044f\u043b\u0438 \u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0438 \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u0438 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432 (\u0432 \u043e\u0434\u043d\u043e\u043c \u0441\u043b\u043e\u0432\u0435)<\/p>\n<\/li>\n<li>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u043e \u0434\u0432\u0443\u0445 \u0431\u0443\u043a\u0432, \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0430\u0441\u044c \u0438 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u043b\u0438 \u0438 \u0436\u0430\u0440\u0433\u043e\u043d\u043d\u044b\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 (\u0411\u0443\u043c\u0435\u0440 \u0432\u043c\u0435\u0441\u0442\u043e BMW), \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0435 (Bayerische Motoren Werke)<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e \u043f\u0440\u0438\u0437\u0451\u0440\u0430\u043c\u0438 \u0432 \u0431\u043e\u0440\u044c\u0431\u0435 \u0441 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0441\u0442\u0430\u043b\u0438 \u043b\u044e\u0434\u0438, \u043f\u0438\u0441\u0430\u0432\u0448\u0438\u0435 \u0432 \u0441\u043b\u043e\u0432\u0430\u0445 Tesla \u0438 BMW &#8212; \u0440\u0443\u0441\u0441\u043a\u0443\u044e \u0431\u0443\u043a\u0432\u0443 &#171;\u0442&#187; \u0438 \u0440\u0443\u0441\u0441\u043a\u0443\u044e &#171;\u0432&#187; \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u043b\u043e\u0432\u0430, \u0430 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0432\u0448\u0438\u0435 \u0435\u0433\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438 \u200b  <\/p>\n<p>(\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u043f\u043e \u0447\u0438\u0441\u0442\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f json \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043a\u043e\u0433\u0434\u0430 \u043b\u0430\u0442\u0438\u043d\u0438\u0446\u0430 \u0438\u0434\u0451\u0442 \u0431\u0443\u043a\u0432\u0430\u043c\u0438, \u0430 \u0432\u0435\u0441\u044c \u044e\u043d\u0438\u043a\u043e\u0434 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0448\u0430\u043c\u0438 \u0441 \u043a\u043e\u0434\u0430\u043c\u0438)<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0414\u043b\u044f \u0447\u0435\u0433\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f? \u0412\u0435\u0434\u044c \u0435\u0441\u0442\u044c \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u043f\u0430\u0440\u0441\u0435\u0440\u044b \/ \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430 Yotube API<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0435 \u0432\u0441\u0435 \u0445\u043e\u0442\u044f\u0442 \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e.<\/p>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043d\u0435 \u0443 \u0432\u0441\u0435\u0445 \u0445\u043e\u0440\u043e\u0448\u043e \u0441 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u043c, \u0434\u0430 \u0438 \u0437\u0430\u0447\u0435\u043c \u043a\u0443\u0440\u0438\u0442\u044c \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u043c\u0430\u043d\u0443\u0430\u043b\u044b, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0443\u0437\u043a\u0430\u044f \u0438 \u043e\u0434\u043d\u043e\u0441\u043b\u043e\u0436\u043d\u0430\u044f.<\/p>\n<p>\u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c, \u0434\u0443\u043c\u0430\u044e \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<\/div>\n<\/details>\n<p><em>\u0427\u0442\u043e\u0431\u044b \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u043e\u0439 \u0438 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0448\u0430\u0433\u043e\u0432, \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438.<\/em><\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043a\u043b\u044e\u0447 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 youtube API (<a href=\"https:\/\/developers.google.com\/youtube\/v3\/getting-started\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/a>)<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0438\u0435 \u0432\u0430\u0448 \u0433\u0443\u0433\u043b-\u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/console.developers.google.com\/\" rel=\"noopener noreferrer nofollow\">https:\/\/console.developers.google.com\/<\/a><\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439 <a href=\"https:\/\/console.developers.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">https:\/\/console.developers.google.com\/apis\/credentials<\/a><\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 API \u043a\u043b\u044e\u0447<\/p>\n<\/p>\n<p>(\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043d\u0435 \u0438\u0441\u043a\u0430\u0442\u044c)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 <a href=\"https:\/\/console.cloud.google.com\/apis\/dashboard\" rel=\"noopener noreferrer nofollow\">https:\/\/console.cloud.google.com\/apis\/dashboard<\/a><\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0434\u043b\u044f API<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 YouTube Data API v3<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0435\u0433\u043e<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 google-api-python-client (<a href=\"https:\/\/github.com\/googleapis\/google-api-python-client\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a<\/a>)<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 <a href=\"https:\/\/www.python.org\/downloads\/\" rel=\"noopener noreferrer nofollow\">python<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<p><code>pip.exe install google-api-python-client<\/code><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442<\/p>\n<ol>\n<li>\n<p>\u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/code.visualstudio.com\/Download\" rel=\"noopener noreferrer nofollow\">visual studio code<\/a><\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 python \u0444\u0430\u0439\u043b \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434<\/p>\n<p>\u0412\u0441\u0451 \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 \u043d\u0451\u043c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u044d\u0442\u043e <\/p>\n<ul>\n<li>\n<p>DEVELOPER_KEY &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u043f\u0443\u043d\u043a\u0442\u0435<\/p>\n<\/li>\n<li>\n<p>VIDEO_ID &#8212; \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/youtu.be\/9b4-G-czN5Y\" rel=\"noopener noreferrer nofollow\">https:\/\/youtu.be\/9b4-G-czN5Y<\/a> \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 9b4-G-czN5Y<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<pre><code class=\"python\"># -*- coding: utf-8 -*-  import os import googleapiclient.discovery import csv  DEVELOPER_KEY = \"AIzaSyB7oKxIsd4690TibZHZPaTLzw7nqzgrr4k\" VIDEO_ID = \"9b4-G-czN5Y\"  # \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 def youtube(nextPageToken=None):     # Disable OAuthlib's HTTPS verification when running locally.     # *DO NOT* leave this option enabled in production.     os.environ[\"OAUTHLIB_INSECURE_TRANSPORT\"] = \"1\"      api_service_name = \"youtube\"     api_version = \"v3\"          youtube = googleapiclient.discovery.build(         api_service_name, api_version, developerKey = DEVELOPER_KEY)      request = youtube.commentThreads().list(         part=\"id,snippet\",         maxResults=100,         pageToken=nextPageToken,         videoId=VIDEO_ID     )     response = request.execute()     return response  # \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u043f\u043b\u0430\u0435\u0432 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 def youtubechild(NextParentId, nextPageToken=None):     # Disable OAuthlib's HTTPS verification when running locally.     # *DO NOT* leave this option enabled in production.     os.environ[\"OAUTHLIB_INSECURE_TRANSPORT\"] = \"1\"      api_service_name = \"youtube\"     api_version = \"v3\"      youtube = googleapiclient.discovery.build(         api_service_name, api_version, developerKey = DEVELOPER_KEY)      request = youtube.comments().list(         part=\"id,snippet\",         maxResults=100, \tpageToken=nextPageToken,         parentId=NextParentId     )     response = request.execute()     return response  # \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f def main():     # \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438     print('download comments')     response = youtube()     items = response.get(\"items\")     nextPageToken = response.get(\"nextPageToken\") # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u0446\u0438\u044f\u043c\u0438, \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c     i=1     while nextPageToken is not None:         print(str(i*100)) # \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0430\u043a\u0430\u044f \u0441\u043e\u0442\u043d\u044f \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0441\u0435\u0439\u0447\u0430\u0441 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f         response = youtube(nextPageToken)         nextPageToken = response.get(\"nextPageToken\")         items = items + response.get(\"items\")         i+=1      print(len(items)) # \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043a\u0430\u0447\u0430\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432      # \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u043f\u043b\u0430\u0438 \u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438     print('download replies')     replies = []     for line in items: # \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u044b\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u043c         if line.get(\"snippet\").get(\"totalReplyCount\") &gt; 0: # \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u043f\u043b\u0430\u0438             print(line.get(\"snippet\").get(\"totalReplyCount\")) # \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u043f\u043b\u0430\u0435\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0435\u043d\u043e             response = youtubechild(line.get(\"snippet\").get(\"topLevelComment\").get(\"id\"))             replies = replies + response.get(\"items\")             nextPageToken = response.get(\"nextPageToken\")             i=1             while nextPageToken is not None: # \u0434\u043e\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0440\u0435\u043f\u043b\u0430\u0438, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043f\u043e\u0440\u0446\u0438\u0438                 response = youtubechild(line.get(\"snippet\").get(\"topLevelComment\").get(\"id\"), nextPageToken)                 nextPageToken = response.get(\"nextPageToken\")                 replies = replies + response.get(\"items\")                 i+=1      print(len(replies)) # \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043a\u0430\u0447\u0430\u043d\u044b\u0445 \u0440\u0435\u043f\u043b\u0430\u0435\u0432      # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u0440\u0435\u043f\u043b\u0430\u0438 \u043d\u0430 \u043d\u0438\u0445 \u0432 \u0444\u0430\u0439\u043b csv     print(\"Open csv file\")     with open('youtuberesults.csv', 'w', encoding=\"utf-8\") as csv_file:  #\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f with, \u0447\u0442\u043e\u0431\u044b \u0444\u0430\u0439\u043b \u0437\u0430\u043a\u0440\u044b\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u0430\u043d\u0434         writer = csv.writer(csv_file, quoting=csv.QUOTE_ALL, lineterminator='\\r') # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u0432\u043e\u0439\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u044f\u0442\u0443\u044e, \u0442\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 LibreOffice Calc          # \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432         row = [               'etag'             , 'parentid'             , 'id'             , 'textDisplay'             , 'textOriginal'             , 'authorDisplayName'             , 'authorProfileImageUrl'             , 'authorChannelUrl'             , 'authorChannelId'             , 'likeCount'             , 'publishedAt'             , 'updatedAt'         ]         print(\"Start write in csv\")           writer.writerow(row) # \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b              # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438         print(\"Write comments in csv\")           for line in items:             topLevelComment = line.get(\"snippet\").get(\"topLevelComment\")             # \u0431\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f             if topLevelComment.get('snippet').get('authorChannelId') is not None:                 authorChannelId = topLevelComment.get('snippet').get('authorChannelId').get('value')             else:                 authorChannelId = ''             row = [                   topLevelComment.get('etag')                 , topLevelComment.get('id')                 , topLevelComment.get('id')                 , topLevelComment.get('snippet').get('textDisplay')                 , topLevelComment.get('snippet').get('textOriginal')                 , topLevelComment.get('snippet').get('authorDisplayName')                 , topLevelComment.get('snippet').get('authorProfileImageUrl')                 , topLevelComment.get('snippet').get('authorChannelUrl')                 , authorChannelId                 , topLevelComment.get('snippet').get('likeCount')                 , topLevelComment.get('snippet').get('publishedAt')                 , topLevelComment.get('snippet').get('updatedAt')             ]             writer.writerow(row)          # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0440\u0435\u043f\u043b\u0430\u0438         print(\"Write replies in csv\")           for line in replies:             # \u0431\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u043a\u0430\u043d\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f             if line.get('snippet').get('authorChannelId') is not None:                 authorChannelId = line.get('snippet').get('authorChannelId').get('value')             else:                 authorChannelId = ''             row = [                   line.get('etag')                 , line.get('snippet').get('parentId')                 , line.get('id')                 , line.get('snippet').get('textDisplay')                 , line.get('snippet').get('textOriginal')                 , line.get('snippet').get('authorDisplayName')                 , line.get('snippet').get('authorProfileImageUrl')                 , line.get('snippet').get('authorChannelUrl')                 , authorChannelId                 , line.get('snippet').get('likeCount')                 , line.get('snippet').get('publishedAt')                 , line.get('snippet').get('updatedAt')             ]             writer.writerow(row)              print(\"done\")    if __name__ == \"__main__\":     main() <\/code><\/pre>\n<p>\u0412 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e YouTube API. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 csv \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 LibreOffice&nbsp;Calc. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f&nbsp;\u0434\u0432\u043e\u0439\u043d\u044b\u0435&nbsp;\u043a\u0430\u0432\u044b\u0447\u043a\u0438&nbsp;\u0438&nbsp;\u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c&nbsp;\u0437\u0430\u043f\u044f\u0442\u0430\u044f, \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 UTF-8.&nbsp;<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043e\u0442 \u0440\u0435\u043f\u043b\u0430\u044f \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0441 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435\u043c parentid \u0441 id &#8212; \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0445 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439, \u0438\u043d\u0430\u0447\u0435 \u0440\u0435\u043f\u043b\u0430\u0439.<\/p>\n<\/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\/565812\/\"> https:\/\/habr.com\/ru\/post\/565812\/<\/a><br \/><\/br><\/br><\/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-325837","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325837","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=325837"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325837\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}