0.0
No release in over 3 years
Low commit activity in last 3 years
Gem for parsing youtube data
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
>= 0
~> 10.0
~> 3.0

Runtime

 Project Readme

YoutubeParser

Installation

Add this line to your application's Gemfile:

gem 'youtube_parser'

And then execute:

$ bundle

Or install it yourself as:

$ gem install youtube_parser

Usage

To fetch youtube channel info:

require 'youtube_parser'

user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 '\
    '(KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
options = { channel_url: 'https://www.youtube.com/channel/channel_id',
            user_agent: user_agent }

YoutubeParser::Channel.new(options).info

To search channels by query:

require 'youtube_parser'

user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 '\
    '(KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
options = { search_query: 'search query',
            user_agent: user_agent }

# Search with pagination
YoutubeParser::Search::Channels.new(options).for_each_channel do |channel|
  channel
end

# First page channels
YoutubeParser::Search::Channels.new(options).info

To parse channel related channels:

require 'youtube_parser'

user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 '\
    '(KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
options = { search_query: 'search query',
            user_agent: user_agent }

YoutubeParser::Channels::ChannelsSection.new(options).info

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/youtube_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the YoutubeParser project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.