redeat17 / youtube-trending-videos-scraper

A scraper for videos that are trending on YouTube (https://www.youtube.com/feed/trending)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Youtube Trending Videos Scraper

This is a Python scraper for YouTube's feed of videos that are trending.

Contents

Requirements/Installation

  1. Install requirement(s):
  1. Clone repository:
git clone https://github.com/jessecordeiro/youtube-trending-videos-scraper.git
cd youtube-trending-videos-scraper
  1. Install dependencies:
python setup.py develop

Usage

import youtube_trending_scraper

youtube_trending_scraper.Scraper.scrape()

Optional argument: country code

Domain defaults to .com if no argument is provided

# Example: scrape Canada's trending videos
youtube_trending_scraper.Scraper.scrape("ca")

Output

[{
  "profile_name": "Lorem ipsum",
  "profile_url": "/user/loremipsumdolor",
  "upload_date": "1 day ago",
  "video_desc": "Lorem ipsum dolor sit amet, hymenaeos sodales in, scelerisque at.",
  "video_thumbnail": "https://..",
  "video_time": "2:12",
  "video_title": "Lorem ipsum dolor sit amet",
  "video_url": "/watch?v=loR3MIpSUMgd",
  "view_count": "3,151,740"
}]

Contribute

  1. Fork the repository
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Implemented x feature'
  4. Push to the feature branch: git push origin x-feature
  5. Open a pull request

About

A scraper for videos that are trending on YouTube (https://www.youtube.com/feed/trending)

License:MIT License


Languages

Language:Python 100.0%