Skip to Content

streaming video capture on linux

#!/bin/bash
#      
# mplayer auto dump stream script
#this script will download all the stream files in the ./zam_list files
#this script by (mohammed tawfeek) [email protected]
#i have do this to be able to watch the video on Linux
#if you think it is illegally or some thing just  don't tel me that ha
#(c) #bash 6/6/2006
download_folder="./video/"
#grep -e HREF ./asx/*.asx > ./list1.txt
#sed -i 's/[^"]*"\([^"]*\).*/\1/' ./list1.txt
#nl ./list1.txt >./list.txt
let max=`grep -c [:alnum:] ./list.txt`
echo "$max files will be downloaded"


if [ -d $download_folder ]
then
for ((i=1; i<=$max; i++))
do
download_src=`gawk '$1 =="'$i'" {print $2}' ./list.txt`
download_file=${download_folder}${download_src##*/}
    printf "please wite...\ndownloading file number:%d of:%d \nfile is : %s\n" "$i" "$max" "$download_file"
mplayer -dumpstream -dumpfile "$download_file" "$download_src" 


done


else 
echo "folder "$download_folder" notfound created "
mkdir "$download_folder"

for ((i=1; i<=$max; i++))
do
download_src=`gawk '$1 =="'$i'" {print $2}' ./list.txt`
download_file=${download_folder}${download_src##*/}
    printf "please wite...\ndownloading file number:%d of:%d \nfile is : %s\n" "$i" "$max" "$download_file"
mplayer -dumpstream -dumpfile "$download_file" "$download_src" 


done

fi



reated " mkdir ./asx

fi

#!/bin/bash

asx_folder="./asx"
asx_list=./asx_list


if [ -d $asx_folder ]
then

echo "folder "$asx_folder" notfound created "
mkdir "$asx_folder"



fi


if [ -r $asx_list ]
then 
wget -T 60  -t 0 -c -nd -P ./asx -i ./asx_list

else 

echo "error: no file list found 
 pleases add the list of '*.asx' fils you wish do download to file './asx_list' "
fi


if [ -d $asx_folder ]
then
grep -e HREF ./asx/*.asx > ./list1.txt
sed -i 's/[^"]*"\([^"]*\).*/\1/' ./list1.txt
nl ./list1.txt >./list.txt

else

echo "folder './asx' notfound created "
mkdir ./asx



fi

fell free to edit this script as you like under "gnu gpl" linsses :D



Dr. Radut | forum