Skip to content

TechAndCheck/YoutubeArchiver

Repository files navigation

Overview

YoutubeArchiver is a Ruby gem that downloads YouTube Video metadata and media. It works in conjunction with Zenodotus and Hypatia to archive fact-checked image/video posts. YoutubeArchiver exists alongside a collection of other media scrapers created by the Duke Reporters' Lab, including Birdsong (a Twitter scraper), Zorki (an Instagram scraper), and Forki (a Facebook scraper).

Like the other scrapers, YoutubeArchiver follows a standard architecture created by @cguess. The scraper is engaged by one of two methods: Video.lookup or Channel.lookup, which respectively return YoutubeArchiver::Video and YoutubeArchiver::Channel objects. These psuedo JSON object store video/channel metadata and media.

YoutubeArchiver differs from the other scrapers in how it acquires media and metadata for a video or channel lookup. YoutubeArchiver uses yt-dlp to download video media files and the YouTube Data API V3 to download channel and video metadata. For now, the project pecifically uses the Youtube API's Videos: list and Channels: list endpoints.

Installation

Add this line to your application's Gemfile:

gem 'youtubearchiver'

And then execute:

$ bundle install

Requirements

YoutubeArchiver uses yt-dlp to download Youtube Videos. Installation instructions for the project can be found here.

Setup

Acquiring a YouTube API key

  1. Create or select a Google Cloud Project
  2. Find the Youtube Data API v3 in the Google API marketplace. Enable the API for the selected project.
  3. After enabling the API, click on the credentials tab link in the API page sidebar.
  4. Create an "API Key" credential.

Setting environment variables

Set the YOUTUBE_API_KEY environment variable equal to the API key generated above. Make sure not to commit the API key to git!

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published