diff options
author | vidiot720 <128325907+vidiot720@users.noreply.github.com> | 2023-04-19 09:46:57 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 23:46:57 +0000 |
commit | 6a765f135ccb654861336ea27a2c1c24ea8e286f (patch) | |
tree | 8870c663384f30abaa3dce71ca06a2f2347e1118 /yt_dlp/utils.py | |
parent | ab29e47029e2f5b48abbbab78e82faf7cf6e9506 (diff) | |
download | hypervideo-pre-6a765f135ccb654861336ea27a2c1c24ea8e286f.tar.lz hypervideo-pre-6a765f135ccb654861336ea27a2c1c24ea8e286f.tar.xz hypervideo-pre-6a765f135ccb654861336ea27a2c1c24ea8e286f.zip |
[extractor/sbs] Overhaul extractor for new API (#6839)
Closes #6543
Authored by: vidiot720, dirkf, bashonly
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 40533c2cb..746a2885d 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -4093,6 +4093,10 @@ def dfxp2srt(dfxp_data): def close(self): return self._out.strip() + # Fix UTF-8 encoded file wrongly marked as UTF-16. See https://github.com/yt-dlp/yt-dlp/issues/6543#issuecomment-1477169870 + # This will not trigger false positives since only UTF-8 text is being replaced + dfxp_data = dfxp_data.replace(b'encoding=\'UTF-16\'', b'encoding=\'UTF-8\'') + def parse_node(node): target = TTMLPElementParser() parser = xml.etree.ElementTree.XMLParser(target=target) |