mihaeu/sub-collector — pull request #1 by martinlindhe (2014-08-29 15:23:01+00:00)
Title: Sub cleaner

added a "clean" command to the sub-collector tool, which takes a directory parameter, finds .srt files and cleans them up. This involves rewriting them to correct numerical index, and also remove various "advertisement" texts from the sub.

Example:

```
ml@mac-martin ~/D/The Strain> sub-collector download .
Downloaded subtitle for the.strain.s01e01.hdtv.x264-2hd
Downloaded subtitle for The.Strain.S01E02.HDTV.x264-KILLERS
Downloaded subtitle for The.Strain.S01E03.HDTV.x264-KILLERS
Downloaded subtitle for The.Strain.S01E04.HDTV.x264-ASAP
Downloaded subtitle for The.Strain.S01E05.PROPER.HDTV.x264-2HD
No exact match found for The.Strain.S01E06.HDTV.x264-2HD
ml@mac-martin ~/D/The Strain> sub-collector clean .
Cleaning subtitles in .
./the.strain.s01e01.hdtv.x264-2hd.srt
Removed cap 66: "Subtitles downloaded from www.OpenSubtitles.org",
Removed cap 131: "Sync and corrected by caioalbanezi"	"www.addic7ed.com",
Removed cap 1183: "Sync and corrected by caioalbanezi",	"www.addic7ed.com",
Removed cap 1184: "Best watched using Open Subtitles MKV Player",
./The.Strain.S01E02.HDTV.x264-KILLERS.srt
EXCEPTION: expected sequence number, found odd data at line 2891: "00:29:38,169 --> 00:29:40,969"
- What are you gonna say?
./The.Strain.S01E03.HDTV.x264-KILLERS.srt
EXCEPTION: expected sequence number, found odd data at line 1975: "omer of mine, he gave me one of those once."

./The.Strain.S01E04.HDTV.x264-ASAP.srt
EXCEPTION: expected sequence number, found odd data at line 2430: "- Here's 400."
- What's that?
./The.Strain.S01E05.PROPER.HDTV.x264-2HD.srt
Removed cap 37: "Subtitles downloaded from www.OpenSubtitles.org",
Removed cap 514: "Best watched using Open Subtitles MKV Player",
```