# youtube-scraper-improved

> Youtube scraper

Latest version **0.2.0** (published 2020-05-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install youtube-scraper-improved
pnpm add youtube-scraper-improved
yarn add youtube-scraper-improved
bun add youtube-scraper-improved
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2020-05-16 |
| First published | 2020-05-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 (+26 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | wikiwookie |

## Links

- npm: https://www.npmjs.com/package/youtube-scraper-improved
- npm.io page: https://npm.io/package/youtube-scraper-improved

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.19.2
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.3
- [playwright](https://npm.io/package/playwright.md) ^0.15.0
- [prettify-xml](https://npm.io/package/prettify-xml.md) ^1.2.0

## Recent versions

- 0.2.0 (latest) — 2020-05-16
- 1.0.0 — 2020-05-04

## README

# Youtube Scraper Improved

## Description
Promise based youtube scraper.  Working towards typescript implementation.

### Current functionality
- Get a transcript from a video
- Get a channel id from a username based url
- Get number of public uploaded videos from a channel
- Get all public uploaded video ids from a channel

### Installation
```
npm install youtube-scraper-improved
```

### Usage
```
const ytsi = require('youtube-scraper-improved');

(async function() {
  try {
    const scraper = new ytsi();
    const transcript = await scraper.Transcript.getTranscript('a_TSR_v07m0');
    console.log('transcript', transcript);
  } catch (error) {
    console.log('error');
    console.log(error);
  };
})();

```

### Functions
```
# Get transcript from youtube
# Argument: Id of video
# Returns: string in srv format by default
scraperInstance.Transcript.getTranscript('video-id-goes-here');

# Example URLS
# Channel id: https://www.youtube.com/channel/UCd_3THjYRVujgverdszeGfQ
# Username channel: https://www.youtube.com/user/polynesiancultural

# Get channel id from user name channel url
# Argument: Username channel url string
# Returns: UCd_3THjYRVujgverdszeGfQ
scraperInstance.Channel.getChannelIdByUserChannelUrl('user-channel-url-goes-here');

# Get number of uploaded videos
# Argument: Channel id or username url + '/videos'
# Ex Arg: https://www.youtube.com/user/polynesiancultural/videos
# Returns: Number of videos
scraperInstance.Channel.getNumberOfUploadedVideos('url-goes-here');

# Get all updated video ids
# Argument: Channel id or username url
# Returns: Array of strings
scraperInstance.Channel.getAllUploadedVideoIds('url-goes-here');
```

### TODO
- Add more data endpoints
- Add Youtube API wrapper functionality
- Add testing
 -- Test if transcript does not exist, etc...

---
_Source: https://npm.io/package/youtube-scraper-improved · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
