Linux Notes Index Home Contact

Command Templates

Twitch templates:

(Simply replace /Insert_Channel_Name_Here with the name of the channel you wish to record)

Streamlink:

Download Twitch streams in Source Quality:

streamlink https://www.twitch.tv/Insert_Channel_Name_here best -o insertVODnamehere.mp4

Download a Twitch stream in 1080P:

streamlink https://www.twitch.tv/Insert_Channel_Name_here 1080p -o insertVODnamehere.mp4

Download a Twitch stream in 720P:

streamlink https://www.twitch.tv/Insert_Channel_Name_here 720p -o insertVODnamehere.mp4

Download audio only from Twitch streams:

streamlink https://www.twitch.tv/Insert_Channel_Name_here audio_only -o insertVODnamehere.mp4

Poll a channel every 15 seconds until a channel goes live:

streamlink https://www.twitch.tv/Insert_Channel_Name_here audio_only -o insertVODnamehere.mp4 --retry-streams 15

Like I mentioned, there are many other options you can choose - but for this template, I listed some of the most commonly used ones for quick access. You can find the full list of options here: https://streamlink.github.io/cli.html#general-options

Again, here's the example as to how to make a command by yourself:

streamlink [URL] [QUALITY] -o [OUTPUTNAME].mp4 --[Option]

streamlink https://www.twitch.tv/nyanners 1080p60 -o nyannersVOD.mp4 --retry-streams 15

Twitch Stream Recorder:

python twitch-recorder.py -u Insert_Twitch_Channel_Name_Here

YouTube templates:

(Simply replace the channel name)

First off, open ytarchive in a command line window. Then use the commands for ytarchive:

(For Windows) Put the following into a command line window to change directory to your ytarchive folder, wherever it may be (Windows+R, then type cmd, and press Enter):

cd C:\ffmpeg\ytarchive

Then, copy and paste the command you want to use, or make your own. If you want to use a different command:

Poll if a stream goes live every 15 seconds in 1080p quality:

ytarchive --retry-stream 15 https://www.youtube.com/watch?v=K--bc2nM-JM 1080p -o Vodnamehere

Poll if a stream goes live every 15 seconds in 1080p quality:

ytarchive --retry-stream 15 https://www.youtube.com/watch?v=K--bc2nM-JM 1080p -o Vodnamehere

Like I mentioned in the ytarchive section, there are many more commands, too many to list them all. This has all of them listed:

https://github.com/Kethsar/ytarchive
Mirror of the options: https://pastebin.com/8fm7LPe3

And again, here's the example as to how to make a command by yourself:

ytarchive [insert option here] [Insert YouTube URL here] [ Insert the desired quality here]

ytarchive --retry-stream 60 https://www.youtube.com/watch?v=K--bc2nM-JM 1080p

To Download membership or age restricted streams, you need to feed ytarchive your cookies. You can get the cookies.txt file with the following browser extensions:

Chrome: https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid

Firefox: https://addons.mozilla.org/en-US/firefox/addon/cookie-txt/

After you get the cookies.txt file, place it in the directory where you saved ytarchive into.

Example of an command to use the cookies.txt file:

ytarchive --retry-stream 60 --cookies COOKIES.txt https://www.youtube.com/watch?v=K--bc2nM-JM best

Basically, all you need to do is add "--cookies path-to-COOKIES.txt" to your command that you want to use, and it will use your cookies from that text file.

FFmpeg Templates:

(Just a few commands that might be useful for archiving related things)

Merge two seperate video files:

ffmpeg -i example1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts input1.ts

ffmpeg -i example2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts input2.ts

ffmpeg -i "concat:input1.ts|input2.ts" -c copy MergedVideo.mp4

Remove audio from an Video and overlay it with an new audio file:

ffmpeg -i example1.mp4 -i exampleaudio.mp3 -map 0:v -map 1:a -c:v copy -shortest Fixedunmutedvod.mp4

Convert mp4 into MP3:

ffmpeg -vn -sn -dn -i example1.mp4 -codec:a libmp3lame -qscale:a 4 audioonly.mp3




Linux Notes Index Home Contact