Skip to content

Instantly share code, notes, and snippets.

@Pmmlabs
Last active June 16, 2016 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pmmlabs/66ba34a845b4faf06a93 to your computer and use it in GitHub Desktop.
Save Pmmlabs/66ba34a845b4faf06a93 to your computer and use it in GitHub Desktop.
Запись стримов с mbco.ru
#!/bin/bash
# http://hlive.mbco.ru/live/280/2016-1-26_11:2:30/34.dat
# http://hlive.mbco.ru/live/280/2016-1-26_11:2:30/z14507/start.dat # bytes 0-3: int, number of start file (starting with 0)
CHANNEL=280
PATH_BASE="hlive.mbco.ru/live/$CHANNEL"
DATE="2015-1-26" # date in YYYY-M-D format
rm all
for i in {10..11}
do
for j in {0..60}
do
for k in {0..60}
do
echo "$i:$j:$k" >> all
done
done
done
cat all | xargs -n1 --max-procs=20 -I {} wget --read-timeout=1 --tries=1 -x http://$PATH_BASE/${DATE}_{}/z1/start.dat # find correct folders
wait
cd $PATH_BASE
for i in */
do
cd $i
wget -T 1 --tries=2 http://$PATH_BASE/${i}{0..3000}.dat # 3000 pieces ~ 3 hours
dd if=z1/start.dat of=result.flv ibs=4 skip=1
for i in {0..3000}.dat
do
dd if=$i ibs=9 skip=1 >> result.flv
done
cd ..
done
# ffmpeg build:
# wget https://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
# tar xvf ffmpeg-snapshot.tar.bz2
# cd ffmpeg
# TMPDIR=`pwd`/tmp ./configure --prefix=`pwd`/dist
# make && make install
# ./ffmpeg -i all.ts -acodec copy -vcodec copy out.mp4
# fftv.mbco.ru/video-flv/16/4811.flv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment