refa: download video (#1737)

* opt: save pb danmaku

* refa: download video

* opt: replaceAll

* fix: wait delete

* opt: remove completer

* fix: index.json

* tweaks

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>

---------

Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
My-Responsitories
2025-11-12 19:12:17 +08:00
committed by GitHub
parent 37b1228552
commit 407b31c5c1
16 changed files with 345 additions and 410 deletions

View File

@@ -1,5 +1,6 @@
abstract class Em {
static final _exp = RegExp('<[^>]*>([^<]*)</[^>]*>');
static final _htmlRegExp = RegExp(r'&(lt|gt|quot|apos|nbsp|amp);');
static String regCate(String origin) {
Iterable<Match> matches = _exp.allMatches(origin);
@@ -17,14 +18,21 @@ abstract class Em {
},
onNonMatch: (String str) {
if (str != '') {
str = str
.replaceAll('&lt;', '<')
.replaceAll('&gt;', '>')
.replaceAll('&quot;', '"')
.replaceAll('&apos;', "'")
.replaceAll('&nbsp;', " ")
.replaceAll('&amp;', "&");
res.add((isEm: false, text: str));
res.add((
isEm: false,
text: str.replaceAllMapped(
_htmlRegExp,
(m) => switch (m.group(1)) {
'lt' => '<',
'gt' => '>',
'quot' => '"',
'apos' => "'",
'nbsp' => ' ',
'amp' => '&',
_ => m.group(0)!,
},
),
));
}
return '';
},