Skip to content

Instantly share code, notes, and snippets.

@SMarioMan
Last active November 20, 2020 07:04
Show Gist options
  • Select an option

  • Save SMarioMan/764a10932f7105cebe26f980d7b91a29 to your computer and use it in GitHub Desktop.

Select an option

Save SMarioMan/764a10932f7105cebe26f980d7b91a29 to your computer and use it in GitHub Desktop.
Guide to downloading and compiling Twitch clips

Guide to downloading and compiling Twitch clips

This guide will detail the process of downloading the top 1,000 or so clips assocoiated with any channel on Twitch.

Load the clips page for the channel you're interested in capturing. Normally, you want to look at top clips from all time. Scroll down until no more clips will load. This will cap out around 1,000 clips.

Example URL: https://www.twitch.tv/SMarioMan/clips?filter=clips&range=all

Press F12 to open the web inspector. Activate the element inspector.

element inspector

Use the inspector to select a clip and jump to its position in the HTML of the page. Select an HTML tag high enough up that all clip HTML elements are contained with it. Currently, this is the class that contains the clips-card-# elements. Right-click on that element and choose "Edit as HTML."

Edit as HTML dialog

Select the whole block and copy it. Paste it into a formatter tool and format it. I suggest https://webformatter.com/, as it runs locally on your machine. We do this so that each element gets its own line. Save the file as html.txt.


Use grep to filter so that only lines that contain links to clips remain. The command to do this is

grep '/clip/' html.txt >> urls.txt

If you did this correctly, you can safely delete html.txt. Open urls.txt in a text editor that supports find and replace all.


Find and replace anything succeeding the clip URL, such as ?filter=clips&range=all&sort=time"> with nothing. Find and replace up to the point of the href= portion of each line with https://www.twitch.tv. Save your changes to urls.txt. Note that you will have two links to each clip now, but our download tool is smart enough to ignore duplicates.


Download youtube-dl.

ffmpeg and AtomicParsely can be installed optionally as well to support additional functions like stitching together audio and video streams and embedding thumbnails.

Run the following command to download all VoDs referenced in urls.txt:

.\youtube-dl.exe -f best --output ".\clips\%(upload_date)s-%(title)s-%(id)s.%(ext)s" --download-archive archive.log --ignore-errors -a urls.txt --add-metadata --all-subs --embed-subs --embed-thumbnail

All VoDs will download, named according to their date clipped.


If you want to make a compilation, open your preferred video editor and insert all clips, sorting by name. Look over the video to make sure you're happy with it and export to a single file. This file can then be uploaded to your video hosting platform of choice, such as YouTube.

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