Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philbot9/youtube-info
Fetch meta information about YouTube videos
https://github.com/philbot9/youtube-info
Last synced: 4 months ago
JSON representation
Fetch meta information about YouTube videos
- Host: GitHub
- URL: https://github.com/philbot9/youtube-info
- Owner: philbot9
- License: isc
- Archived: true
- Created: 2015-12-09T02:52:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-01-31T15:44:02.000Z (almost 4 years ago)
- Last Synced: 2024-08-06T17:54:27.024Z (4 months ago)
- Language: JavaScript
- Size: 138 KB
- Stars: 43
- Watchers: 6
- Forks: 20
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Youtube Info
## Deprecation Notice
This package has been deprecated and no longer works.
## Purpose
A Node.js module that fetches meta information about YouTube videos. The information is scraped directly from the YouTube website, so no need for a Google API-key.
**This project is in no way affiliated with YouTube.**
## Installation
Install as a module via npm.
```bash
$ npm install youtube-info
```## Usage
`http//www.youtube.com/watch?v={videoId}`
```javascript
var fetchVideoInfo = require('youtube-info')
fetchVideoInfo(videoId, cb)
```| Parameter | Meaning |
| :-------- | :--------------------------- |
| videoId | ID of youtube Video |
| callback | (optional) callback function |### Promises API
```javascript
var fetchVideoInfo = require('youtube-info')
fetchVideoInfo('{videoId}').then(function (videoInfo) {
console.log(videoInfo)
})
```### Callback API
```javascript
var fetchVideoInfo = require('youtube-info')
fetchVideoInfo('{videoId}', function (err, videoInfo) {
if (err) throw new Error(err)
console.log(videoInfo)
})
```## Result
```
{
videoId: '{video Id}',
url: '{video url}',
title: '{video title}',
description: '{video description as HTML}',
owner: '{video owner}',
channelId: '{owner channel id}',
thumbnailUrl: '{video thumbnail url}',
embedURL: '{video embed url}',
datePublished: '{video publication date}',
genre: '{video genre}',
paid: {true/false},
unlisted: {true/false},
isFamilyFriendly: {true/false},
duration: {video duration in seconds},
views: {number of views},
regionsAllowed: [ '{two letter country code}', ... ],
commentCount: {number of comments},
likeCount: {number of likes},
dislikeCount: {number of dislikes},
channelThumbnailUrl: {channel thumbnail url}
}```