Config - libDrive/libDrive Wiki

Original URL: https://github.com/libDrive/libDrive/wiki/Config

Creating config

Generating the config is made simple with the intuitive config generator found at https://config.libdrive.tk

A more in depth tutorial can be found in the setup wiki

Example

{
    "access_token":"ya29.8m7D5u06BYsztiPNGlj-m3hsVdjNLUMdA42qplhmABgdrMGB3tb1cviLSJ_iwQQ64Fn2DuIh5S7LCShHJuNpHvzhtR6Z8Bxy2YV-LsnQPavesoQ98Qk0ixAT3eZNHIgku4AuReikwHsMxRxXiP9qWJBAo2QRZfx4",
    "account_list":[
        {
            "username":"USER_1",
            "password":"PASS_1",
            "auth":"z1w5o1na3v843um9ktr2km9et0shx1ebgh4dmfgorth6ivao71"
        },
        {
            "username":"USER_2",
            "password":"PASS_2",
            "pic":"https://i.ibb.co/3WNmpb0/Logo.png",
            "auth":"q59pl7melx3qy3ikj2w38pxp2cpz5tkgfn9o9sxvyrv5hfk6yx",
            "whitelist":[
                "root"
            ]
        }
    ],
    "adult": false,
    "arcio":"4Q2EAT9P",
    "auth":true,
    "build_interval":360,
    "build_type":"hybrid",
    "category_list":[
        {
            "type":"Movies",
            "name":"Films",
            "id":"RmbpYBrl2GV3pXB8o_ZmxiTCk6jH8uMXci"
        },
        {
            "type":"TV Shows",
            "name":"TV Series",
            "id":"root",
            "whitelist":[
                "q59pl7melx3qy3ikj2w38pxp2cpz5tkgfn9o9sxvyrv5hfk6yx"
            ],
            "language":"en",
            "adult" false,
            "anilist":false
        }
    ],
    "client_id":"123456789012-gyj2sm7lwz28wthzlt8kuttlsntyajlh.apps.googleusercontent.com",
    "client_secret":"pDmb6Gsg2qPV-w5vpHxJBeKI",
    "cloudflare":"https://main.example.workers.dev",
    "fetch_assets":false,
    "language":"en",
    "prefer_mkv": false,
    "prefer_mp4": true,
    "refresh_token":"1//vNlw3nF8DzRyIn7lVKbF1qucZ-wtUH38iLJEcwepW7iwPOZ138fPFg8nBqnFOTc4Ho-fmXIpKxtRMIlxvFsHR2oEgkN7LdclUYThF",
    "remove_duplicates":false,
    "secret_key":"example",
    "service_accounts":[
        {
            "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
            "auth_uri":"https://accounts.google.com/o/oauth2/auth",
            "client_email":"[email protected]",
            "client_id":"xxxxxxxxxxxxxxxxxxxx",
            "client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.iam.gserviceaccount.com",
            "private_key":"-----BEGIN PRIVATE KEY-----xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n",
            "private_key_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "project_id":"xxxxxxxxxxxxxxx",
            "token_uri":"https://oauth2.googleapis.com/token",
            "type":"service_account"
        },
        {
            "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
            "auth_uri":"https://accounts.google.com/o/oauth2/auth",
            "client_email":"[email protected]",
            "client_id":"xxxxxxxxxxxxxxxxxxxx",
            "client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.iam.gserviceaccount.com",
            "private_key":"-----BEGIN PRIVATE KEY-----xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n",
            "private_key_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "project_id":"xxxxxxxxxxxxxxx",
            "token_uri":"https://oauth2.googleapis.com/token",
            "type":"service_account"
        }
    ],
    "signup":false,
    "subtitles":false,
    "tmdb_api_key":"mifx9yzruupc4749ib6muady24dj0621",
    "token_expiry":"2021-01-01 00:00:00.000000",
    "transcoded":false,
    "ui_config":{
        "title":"libDrive",
        "icon":"https://avatars.githubusercontent.com/u/75073550?v=4",
        "icon_on_nav": false,
        "range":"16"
    }
}
}

Variables glossary

access_token

A secret authorization code given by Google, it expires in 1 hour (libDrive automatically generates a new one after expiry)

access_token": ""

account_list

A list of accounts formatted in JSON containing a username, password, authentication code, picture (optional) and whitelist list (optional)

[
    {
        "username": "",
        "password": "",
        "pic": "",
        "auth": ""
    },
    {
        "username": "",
        "password": "",
        "pic": "",
        "auth": "",
        "whitelist": []
    }
]

# username: any string
# password: any string
# pic: any image URL
# auth: randomly generated 50 characters [a-z][0-9]
# whitelist: an optional field which includes a list of folder IDs that a user can access. An empty list means the user cannot access anything

adult

Allow adult content from TMDB and Anilist

"adult": false

arcio (optional)

An arc.io widget ID, it embeds your arc.io widget to the app. Use dev as the value to use my arc.io code and support me!

"arcio": ""

auth

A Boolean value of true or false which enables or disables the need for logging in

"auth": true

build_interval

The minimum time between automatic rebuilding of metadata (in minutes), 0 means never

"build_interval": 360

build_type

Choose between full and hybrid (defaults to hybrid), full means the metadata is built for the entire structure of your folder, hybrid means only the root folder's metadata is built. Full mode takes longer to boot, but requests for each page are made faster.

"build_type": "hybrid"

category_list

A list of Google Drive folders to be used by libDrive formatted in JSON

"category_list": [
    {
        "type": "Movies",
        "name": "",
        "id": ""
    },
    {
        "type": "TV Shows",
        "name": "",
        "id": "",
        "whitelist": [],
        "language": "en",
        "anilist": false
    }
]

# type: any of these 3 options: Movies, TV Shows, Other
# name: any string
# id: the target Google Drive folder ID (you can also use the team drive ID, or 'root')
# whitelist: an optional field which includes a list of user auth IDs, the users in the list are the only people able to access the category. An empty list means no one can access the category
# language: an optional field which sets the TMDB language (doesn't work 100% of the time, mainly works on popular releases, or releases made in the same language). The language codes are ISO 639-1 codes. You can find a list of all the codes [here](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
# anilist: an optional field, either `true` or `false`, it enables/disables the use of anilist instead of TMDB (only use for Anime folders)

client_id

A secret token given by Google after creating a Google Developers console project credential

"client_id": ""

client_secret

A secret token given by Google after creating a Google Developers console project credential

"client_secret": ""

cloudflare (optional)

A cloudflare worker URL used to mirror streams into cloudflare's lightning fast proxy

"cloudflare": ""

fetch_assets

Enable/disable reading a video's parent directory to find subtitles and other qualities for that video. Subtitle searching works for both shows and movies, but quality searching only works for movies.

"language": "en"

language

Set the default language for trailers and TMDB scraping. Use ISO 639-1 strings. The language can be overridden per category too

"language": "en"

prefer_mkv

Determines if an .mkv video is the default quality when transcoded is enabled

"prefer_mkv": false

prefer_mp4

Determines if an .mp4 video is the default quality when transcoded is enabled

"prefer_mp4": true

refresh_token

A secret authorization code given by Google, it never expires and is used to create a new access_token

"refresh_token": ""

remove_duplicates

Determines whether duplicate media should be hidden from the browse pages

"remove_duplicates": false

remove_no_poster

Determines whether media with no banner image are removed from the home page

"remove_no_poster": false

## `secret_key`

A string with no special characters, it is used as a password to access the admin panel on libDrive

"secret_key": ""


## `service_accounts` (optional)

A list of service accounts' JSON files.

Use the [config generator](https://config.libdrive.tk) to automate creating the `service_account` config, just upload a zip file containing all the service account JSON files.

To create the service accounts' zip file, follow one of the guides you can find online such as [this guide](https://telegra.ph/How-to-create-and-use-service-accounts-sa-03-31) (credits to [MsGsuite](https://github.com/MsGsuite)).

"service_accounts":[ { "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs", "auth_uri":"https://accounts.google.com/o/oauth2/auth", "client_email":"[email protected]", "client_id":"xxxxxxxxxxxxxxxxxxxx", "client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.iam.gserviceaccount.com", "private_key":"-----BEGIN PRIVATE KEY-----xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n", "private_key_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "project_id":"xxxxxxxxxxxxxxx", "token_uri":"https://oauth2.googleapis.com/token", "type":"service_account" }, { "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs", "auth_uri":"https://accounts.google.com/o/oauth2/auth", "client_email":"[email protected]", "client_id":"xxxxxxxxxxxxxxxxxxxx", "client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.iam.gserviceaccount.com", "private_key":"-----BEGIN PRIVATE KEY-----xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END PRIVATE KEY-----\n", "private_key_id":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "project_id":"xxxxxxxxxxxxxxx", "token_uri":"https://oauth2.googleapis.com/token", "type":"service_account" } ]


## `signup`

A Boolean value of `true` or `false` which disables or enables user sign up

"signup": false


## `subtitles`

A Boolean value of `true` or `false` which disables or enables subtitle scanning in Google Drive folders (this does not extract subtitles from the video container).

For the subtitle to be identified, the following criteria must be met:

- The subtitle is in the same folder as the video files
- The subtitle has the same file name as the video file

"subtitles": false


## `tmdb_api_key`

A secret token given by TMDB after creating a TMDB API account

"tmdb_api_key": ""


## `transcoded`

Enable or disable pre-transcoded Google Drive videos. With this enabled, video quality will be worse, but it will ensure ability to play almost all types of videos. Accepts Boolean values `true` or `false`

"transcoded": false


## `ui_config`

A config that affects the frontend of libDrive.

"ui_config":{ "title":"libDrive", "icon":"https://avatars.githubusercontent.com/u/75073550?v=4", "icon_on_nav":false, "custom_button":{ "text":"Custom Button", "url":"https://google.com" }, "hide_news": false, "range":"16" }

title: the name displayed on the website

icon: any image URL that will be used as the website's favicon

icon_on_nav: include the icon on the navbar. If disabled, the navbar will have use the title text

custom_button: the custom button will appear under the account menu, clicking it will open the URL provided

hide_news: hide the news menu from the nav bar

range: the number of posters displayed on the home and search pages