Invidious API

Invidious tools in one library

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/451803-invidious-api/code/Invidious%20API.js?version=1096615

Author
NotYou
Version
1.0.0
Created
2022-09-22
Updated
2022-09-22
License
LGPL-3.0

Invidious API

Description:

Invidious tools in one library

How to Use

If you see after type of argument *, then that argument is optional, so you can not use it.


instances

Returns some saved invidious instances. (Onion and Http)

var instances = new Invidious().instances()

instancesAsync

Returns currently available invidious instances.

var instances

new Invidious().instancesAsync().then(r => {
  instances = r
})

videoInfo

Returns get some video information such as video source, thumbnails and captions.

var info2 = new Invidious().videoInfo('QB7ACr7pUuE', 'yewtu.be')

get

Object with various asynchronous functions.

You can get parameters for function at Invidious API.

Notes:

  • ID (if needed) is always first argument.
  • Parameters (if available) is always second argument.
  • Host (optional argument) is always third argument.
Name Parameters Available Needs ID
video yes yes
comments yes yes
captions no yes
mixes no yes
search yes no
searchSuggestions no no
playlists yes yes
channel yes yes
channelVideos yes yes
channelPlaylists yes yes
channelComments no yes
channelSearch yes yes
trending yes no
popular no no
stats no no
// yes|yes
var answer = await (new Invidious().get().video('QB7ACr7pUuE', undefined, 'invidious.snopyta.org'))

// no|yes
var answer2 = await (new Invidious().get().mixes('QB7ACr7pUuE', 'invidious.snopyta.org')) 

// yes|no
var answer3 = await (new Invidious().get().search('some search query', {
  page: 2,
}, 'invidious.snopyta.org')) 

// no|no
var answer4 = await (new Invidious().get().stats('invidious.snopyta.org'))