Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cemerson/57be14a554d2f94f243189867d11abd2 to your computer and use it in GitHub Desktop.
Save cemerson/57be14a554d2f94f243189867d11abd2 to your computer and use it in GitHub Desktop.
Download CSPAN videos/clips to MP4 with YouTube-DL

How to download CSPAN clips to MP4 in Windows with YouTube-DL

  1. Install Youtube-DL so it's in your path/command line (https://github.com/ytdl-org)

  2. Get Two URLs ready to copy/paste. Both the URL of the CSPAN page w/the video and the M3U8 URL of the video. Get the M3U8 by viewing the page source and looking for ".m3u8". Examples (page): https://www.c-span.org/video/?c4990755/user-clip-johnson-covid-response (m3u8): https://m3u8-1.c-spanvideo.org/clip/clip.4954874.m3u8

  3. Run the line below in a Windows command prompt. Make sure to first replace the #M3U8_URL# and #CSPAN_VIDEO_PAGE_URL# with your URLs from step #2

youtube-dl #M3U8_URL# --referer #CSPAN_VIDEO_PAGE_URL# --user-agent "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36"

Notes/Unknown:

  • May have use Google Chrome to get the M3U8 URL? (TBD)
  • Only tested on a CSPAN "clip". May work on full videos but they are normally VERY LONG (5-10 hours) so you may want to stick to shorter clips you or someone else has made.

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment