This is a Python scraper for YouTube's feed of videos that are trending.
- Install requirement(s):
- Clone repository:
git clone https://github.com/jessecordeiro/youtube-trending-videos-scraper.git
cd youtube-trending-videos-scraper
- Install dependencies:
python setup.py develop
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")
[{
"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"
}]
- Fork the repository
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Implemented x feature'
- Push to the feature branch:
git push origin x-feature
- Open a pull request