innertube.js
Version:
A lightweight library to interact with YouTube API using InnerTube.
43 lines (30 loc) • 852 B
Markdown
A lightweight library to interact with YouTube API using InnerTube.
```bash
npm install innertube.js
```
```javascript
const InnerTube = require('innertube.js');
async function example() {
const yt = new InnerTube();
try {
// Get video player information
const playerInfo = await yt.player({ videoId: 'dQw4w9WgXcQ' });
// Search videos
const searchResults = await yt.search({ query: 'JavaScript tutorials' });
// Browse recommendations
const browseResults = await yt.browse({ browseId: 'FEwhat_to_watch' });
} catch (error) {
console.error(error);
}
}
```
- `player(options)`: Fetch video player information
- `search(options)`: Search YouTube videos
- `browse(options)`: Get recommendations
- `next(options)`: Fetch related content
MIT