A Bash Script To Watch Live TV Streams
Hi,
In this post I’ll introduce a very simple and basic Bash script, which uses VLC and a plain text file to let you watch Live TV streams of your favorite channels.
First of all, make sure you have VLC installed in your system.
Now to the script:
1
2
3
4
5
6 #!/bin/bash
#a script to watch TV streams with vlc
list_file=~/.tvlist
channel=$1
channel_url=`grep -w "#$channel" $list_file | cut -f3 -d#`
vlc -f "$channel_url" 2> /dev/null #run vlc in Full Screen mode and don't display warnings
Save the file (I’ll assume you’ll call it wtv) in /usr/local/bin/ (or anywhere else. saving it in /usr/local/bin/ will allow you to call it from anywhere).
Make the file executable: chmod +x wtv
The script assumes you have the file .tvlist in your home directory, with the following format:
#channel_name #channel URL #comments
A line per channel.
Here is an example file:
#bbc #mms://a1482.v373745.c37374.g.vm.akamaistream.net/7/1482/37374/498f5ea4/clipdownloads.bbc.co.uk/windowsmedia-acl/news/n5ctrl/summaries/world/bb/video/world_bb.wmv
#jazeera #mms://88.191.45.161/channel13 #arabic
#cnn #mms://a779.l2584224778.c25842.g.lm.akamaistream.net/D/779/25842/v0001/reflector:24778
#jazeera_en #mms://skinkers-livestation-client-d0ac-aljazeer-en.wm.llnwd.net/skinkers_livestation_client_d0ac_aljazeer_en
#islam_channel #mms://webcast.islamchannel.tv/IslamVideo
#haroon #mms://ib2.islambox.tv/harunyahyatv #haroon yahia tv
Save this file as .tvlist in your home directory (or wherever you want, but remember to modify the script).
Now you can run the script like this:
wtv cnn
The script is very basic, it assumes that the user gives it legal input. I may modify it in the future, but this is good for my needs for now. Any ideas will be appreciated.
P.S.
I’m thinking of making a large database of such streams and providing a script/program which will fetch the channels from this database. I don’t know if I’ll have time to do and maintain this alone, so please let me know if you’re interested to help. (It can be a Bash, Python, CSh script, or a C, C++ program).
Enjoy
No related posts.
2 Comments to A Bash Script To Watch Live TV Streams
Leave a Reply
About Me
Tags
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- iPhone
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Regular Expressions
- Science
- Security
- Shell Scripts
- Short Posts
- Social Networks
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Archives
- July 2010 (5)
- June 2010 (1)
- May 2010 (1)
- April 2010 (3)
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (2)

cool script i have only recently fully converted to ubuntu, i have a mediaportal windows pc, so i can config all my network streams with this. Next step maybe is for an interactive shell script so typing 1 would open bbc1 etc, sort of like the british tv thing you can get
thanks though its a great start
none of these are working
Do you know other live tv streams which are working for sure in VLC? Thanks.