From 17b069dc9ba7002c7c71c844e5e5df75cf5a5f34 Mon Sep 17 00:00:00 2001 From: chanukab7 <79735289+chanukab7@users.noreply.github.com> Date: Mon, 27 Sep 2021 00:56:13 +0530 Subject: [PATCH 1/2] Created using Colaboratory --- YT_upload_CLI.ipynb | 82 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 YT_upload_CLI.ipynb diff --git a/YT_upload_CLI.ipynb b/YT_upload_CLI.ipynb new file mode 100644 index 0000000..5738de8 --- /dev/null +++ b/YT_upload_CLI.ipynb @@ -0,0 +1,82 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "YT upload CLI.ipynb", + "provenance": [], + "authorship_tag": "ABX9TyMRZFgJwckvoXd3SbKBdQfg", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "O_wpy89nf_TQ" + }, + "source": [ + "!sudo pip install --upgrade google-api-python-client progressbar2\n", + "!pip install gdown\n", + "!wget https://github.com/chanukab7/youtube-upload\n", + "!unzip master.zip\n", + "%cd youtube-upload-master\n", + "!sudo python setup.py install" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "-fTmcuxmgfmL" + }, + "source": [ + "!gdown #drive link" + ], + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "xyPaeKFyhgLZ" + }, + "source": [ + "#if client secret file is uploaded newly,\n", + "#upload client secrets to /content/ folder then run\n", + "!mv /content/client*.json client_secrets.json" + ], + "execution_count": 7, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "S5wdwA-6guO_" + }, + "source": [ + "!youtube-upload --title=\"#Title\" #vid_path --client-secrets /content/youtube-upload-master/client_secrets.json" + ], + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file From 505278ab8a24a54ab1e44418a5ac98f40e22d854 Mon Sep 17 00:00:00 2001 From: chanukab7 <79735289+chanukab7@users.noreply.github.com> Date: Mon, 27 Sep 2021 01:03:46 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 65f62a6..20543f9 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,14 @@ You'll see that there is no email/password options. Instead, the Youtube API use The package used to include a default ```client_secrets.json``` file. It does not work anymore, Google has revoked it. So you now must [create and use your own OAuth 2.0 file](https://developers.google.com/youtube/registering_an_application), it's a free service. Steps: -* Go to the Google [console](https://console.developers.google.com/). +* Go to the Google [console](https://console.developers.google.com/). using your youtube channel's google account * _Create project_. -* Side menu: _APIs & auth_ -> _APIs_ -* Top menu: _Enabled API(s)_: Enable all Youtube APIs. +* Side menu: _APIs & services -> Dashboard_ +* Top menu: _Enabled API(s) and services_: Search and Enable all Youtube APIs. * Side menu: _APIs & auth_ -> _Credentials_. -* _Create a Client ID_: Add credentials -> OAuth 2.0 Client ID -> Other -> Name: youtube-upload -> Create -> OK +* Set up OAuth consent screen with setting s external and add your youtube channel's google account email address. +* Side menu: _APIs & auth_ -> _Credentials_. +* _Create a Client ID_: create credentials -> OAuth Client ID -> Application type: TVs and Limited Input devices -> Name: youtube-upload -> Create -> OK * _Download JSON_: Under the section "OAuth 2.0 client IDs". Save the file to your local system. * Use this JSON as your credentials file: `--client-secrets=CLIENT_SECRETS` or copy it to `~/client_secrets.json`.