Skip to content

Instantly share code, notes, and snippets.

@hsj51
Last active March 18, 2021 21:40
Show Gist options
  • Save hsj51/9e3936d1f6c93efddc1e16ecae6f7188 to your computer and use it in GitHub Desktop.
Save hsj51/9e3936d1f6c93efddc1e16ecae6f7188 to your computer and use it in GitHub Desktop.
old notebook to generate credentials.json.
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "generate_credentials.json.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyMd7XAoTA250pWLEef8TZ4G",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/hsj51/9e3936d1f6c93efddc1e16ecae6f7188/generate_credentials-json.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "fv6zYwfcMMiA"
},
"source": [
"!apt install nodejs\n",
"!git clone https://github.com/arghyac35/aria-telegram-mirror-bot bot;cd bot; npm install"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "c2FFaNsBPBWa"
},
"source": [
"#Create client_secret.json\n",
"\n",
"Create a new file named `client_secret.json` in `bot` folder and copy the contents of `client_secret.json` which you got by following Step 2 of [heroku_guide](https://github.com/arghyac35/aria-telegram-mirror-bot/blob/master/heroku_guide.md#pre-requisites-not-to-be-followed-while-using-service-account-skip-to-deployment)\n",
"\n",
"**Or**\n",
"\n",
"If you have alredy created a github gist/direct link for client_secret.json, enter its url in below code cell and run the cell.\n",
"\n",
"Eg.\n",
"\n",
"```\n",
"!wget -q https://gist.githubusercontent.com/hsj51/04c2e78a89f00b21303dd45274b2c4c4/raw/4182c22062b80072b82ab0c290ed40784752dd48/client_secret.json -O client_secret.json\n",
"```\n",
"\n",
"\n",
"Do not run the below cell if you have already created client_secret.json"
]
},
{
"cell_type": "code",
"metadata": {
"id": "0ch38C_cNXdT"
},
"source": [
"!wget -q <url> -O bot/client_secret.json"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "0ETy6EFRU6iG"
},
"source": [
"# Generate credentials.json\n",
"\n",
"\n",
"So finally we are at the part for which we came here for...\n",
"\n",
"\n",
"\n",
"1. Run the below cell\n",
"2. Visit the authorization url from output\n",
"3. Authorize the app and copy the authorization code\n",
"4. Paste it here and hit enter\n",
"\n",
"Now you the the `credentials.json`"
]
},
{
"cell_type": "code",
"metadata": {
"id": "RDmMvoUVOg1k"
},
"source": [
"!cd bot; npm run generateDriveCredentials"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "Owlk_WD0WcE0"
},
"source": [
"#All done\n",
"\n",
"If you have any issues regarding this notebook,*italicized text* contact me using Telegram: [@hsj51](https://t.me/hsj51)"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment