abstract class ParserBase {
static final RegExp _htmlRegExp = RegExp(
'(<[^>]*>)',
multiLine: true,
);
RegExp get regExp;
Subtitles getSubtitlesData(String subtitlesContent);
String removeAllHtmlTags(String htmlText) {
var newHtmlText = htmlText;
_htmlRegExp.allMatches(htmlText).toList().forEach(
(RegExpMatch regExpMatch) {
newHtmlText = regExpMatch.group(0) == '
'
? newHtmlText.replaceAll(regExpMatch.group(0)!, '\n')
: newHtmlText.replaceAll(regExpMatch.group(0)!, '');
},
);
return newHtmlText;
}
}
class Subtitles {
Subtitles({
required this.subtitles,
});
late String languageCode;
final List subtitles;
}
class Subtitle {
Subtitle({
required this.startTime,
required this.endTime,
required this.text,
});
Time startTime;
Time endTime;
String text;
List