Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/riencroonenborghs/yt_streams
- Owner: riencroonenborghs
- License: mit
- Created: 2014-09-29T03:42:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-08T00:34:39.000Z (about 10 years ago)
- Last Synced: 2024-03-15T22:03:45.144Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 137 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
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 exampleAdd 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**.