Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/riencroonenborghs/yt_streams

... is a gem for YouTube video streams.
https://github.com/riencroonenborghs/yt_streams

Last synced: 1 day ago
JSON representation

... is a gem for YouTube video streams.

Awesome Lists containing this project

README

        

# Yt Streams

A little library to fetch video stream info from a YouTube video.

**YouTube is very fickle with its responses and results may vary.**

## Install
### Rails example

Add this line to your Gemfile:

```
gem 'yt_streams', github: 'riencroonenborghs/yt_streams'
```

and run:

```
bundle install
```

That's it really. Now you can add a controller and some views that will lookup a URL and return the streams.

See [Yt](https://github.com/riencroonenborghs/yt) as an example.

### Ruby example

In the project folder run `irb`

```
> require './lib/yt_streams'
=> true

> require 'pp'
=> true

> PP.pp YtStreams.info('https://www.youtube.com/watch?v=VIDEOID')
#],
@title="video title",
@url="https://www.youtube.com/watch?v=VIDEOID">
=> #>
```

## Usage

```
YtStreams.info()
```

If everything goes well, you will get a YtStreams::VideoInfo object back.

This will contain the title and all associated video streams for the YouTube video.

Typically a YtStreams::Stream will have stream related information like the codec used. Most likely you'd be more interested in **url**.