Skip to content

Python script to check if a YouTube live stream is online

Notifications You must be signed in to change notification settings

hizkifw/youtube-stream-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

youtube-stream-status

Small Python3 script to check the status of a YouTube live stream.

Usage: python3 ./check.py [options] <youtube url>
 -q, --quiet  Do not output anything to stdout
 -w, --wait   Keep polling until the stream starts, then exit

The script will exit with code 0 if the stream is online. If used without --wait, will exit with code 2 if the stream is not online.

Use case

Automatically start downloading a live stream once it goes online

STREAM_URL=<url> python3 ./check.py --wait "$STREAM_URL" && ffmpeg -i $(youtube-dl -g "$STREAM_URL") -c copy stream.ts

About

Python script to check if a YouTube live stream is online

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages