Last active
October 4, 2019 11:27
-
-
Save sashagra/9b325a6f6d6163259d360c8bb82b292d to your computer and use it in GitHub Desktop.
bin/bash sript for extracting subtitles from voot.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo ----------------- START SCRIPT ----------------- | |
echo "You need run script from folder where is lie 1.m3u8, 2.m3u8, 3.m3u8 etc by episode number." | |
echo "You can get m3u8 file from episode page by browser dev console on the NET tab." | |
echo "Just search by "srt" and find "index.m3u8" then open it in new tab and save." | |
echo "Maybe you will need to refresh page by F5 before you find file index.m3u" | |
echo "Put the number of next episode to extract subtitles:" | |
read number | |
echo "Running extracting from episode $number" | |
if [[ !(-e srt) ]] | |
then ` mkdir srt ` | |
echo "Making srt directory for subtitles" | |
fi | |
while [[ -e $number.m3u8 ]] | |
do | |
wget -i $number.m3u8 | |
let j=1 | |
for i in seg-* | |
do | |
filename=`find . -name "seg-$j.*"` | |
cat $filename >> $number.srt | |
j=$(($j + 1)) | |
done | |
mv *.srt srt | |
rm seg* | |
mv $number.m3u8 m3u8 | |
number=$(($number + 1)) | |
done | |
echo ----------------- END SCRIPT ----------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment