dbensmith / cbc-video-downloader

Download MP4 videos from CBC by parsing CBC video URLs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cbc-video-downloader

Parses a list of given CBC video URLs and downloads the video files as MP4. Downloads run in parallel but are throttled to three videos at a time to respect CBC's bandwidth.

A separate script takes a single CBC media ID as input and downloads a single file.

Tested to work on (most) video content from the Tokyo 2020 Olympics and the Beijing 2022 Olympics.

Prerequisites

How to use this

Preparation

  • Clone this repo into a local folder of your choice.
  • Extract these three FFmpeg binaries into the same folder as the repo:
    • ffmpeg.exe
    • ffplay.exe
    • ffprobe.exe
  • Copy youtube-dl.exe into the same folder as the repo.

Using Invoke-YouTubeDownloader-CBC.ps1

  • Populate VideoLinks.txt with a list of CBC Video links you want to retrieve, one per line.
  • Open PowerShell 7 and navigate to your working directory.
  • Run ./Invoke-YouTubeDownloader-CBC.ps1 and watch it go.

Using Invoke-YouTubeDownloader-CBC-Single.ps1

  • Run ./Invoke-YouTubeDownloader-CBC-Single.ps1. The script will prompt for a single CBC Media ID.

Considerations

  • PowerShell 7 is required to support parallel threads in the ForEach-Object loop. If you prefer PS 5.1, replace this syntax with foreach ($_ in $CBCmediaID) instead. You will lose parallel downloads, but won't have to install PowerShell 7 (although you should anyway).
  • These scripts will only function when the working directory is the folder containing the script and binaries.
  • Some CBC video content - typically longer recordings - are presented only as HLS in m3u8 format. This parser/downloader cannot handle them and downloads will fail.

Credits

  • The makers of youtube-dl
  • The makers of FFmpeg
  • The CBC for their excellent coverage of sporting events

About

Download MP4 videos from CBC by parsing CBC video URLs.


Languages

Language:PowerShell 100.0%