From e471020dec3192d3dc11a37029da84b934cb628e Mon Sep 17 00:00:00 2001 From: Stephen Macke Date: Sat, 31 Dec 2022 11:30:26 -0800 Subject: [PATCH] completely disable cchardet for python >= 3.11 --- HISTORY.rst | 299 +++++++++++++++++++++++------------------------ README.md | 2 +- requirements.txt | 1 - 3 files changed, 149 insertions(+), 153 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 40b1a32..228ff3d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,96 +1,134 @@ History ======= -0.1.0 (2019-02-24) ------------------- -* Support srt format; -* Support using srt as reference; -* Support using video as reference (via ffmpeg); -* Support writing to stdout or file (read from stdin not yet supported; can only read from file); +0.4.22 (2022-12-31) +------------------- +* Misc maintenance / compatibility fixes; -0.1.6 (2019-03-04) ------------------- -* Misc bugfixes; -* Proper logging; -* Proper version handling; +0.4.19 (2022-01-07) +------------------- +* Blacken code and get rid of future_annotations dependency; -0.1.7 (2019-03-05) ------------------- -* Add Chinese to the list of encodings that can be inferred; -* Make srt parsing more robust; +0.4.18 (2021-11-07) +------------------- +* Allow `--apply-offset-seconds` when only subtitles specified; +* Make golden section search over scale factors option (`--gss`) available from help; +* Use -inf as objective for invalid offsets; -0.2.0 (2019-03-06) ------------------- -* Get rid of auditok (GPLv3, was hurting alignment algorithm); -* Change to alignment algo: don't penalize matching video non-speech with subtitle speech; +0.4.17 (2021-10-03) +------------------- +* Don't remove log file if --log-dir-path explicitly requested; +* Add --suppress-output-if-offset-less-than arg to suppress output for small syncs; -0.2.1 (2019-03-07) +0.4.16 (2021-07-22) +------------------- +* Fix a couple of validation bugs that prevented certain uncommon command line options from use; + +0.4.15 (2021-05-25) +------------------- +* Make typing_extensions a requirement + +0.4.14 (2021-05-10) +------------------- +* Hotfix for pysubs2 on Python 3.6; + +0.4.13 (2021-05-10) +------------------- +* Support SSA embedded fonts using new pysubs2 'opaque_fonts' metadata; +* Set min required pysubs2 version to 1.2.0 to ensure the aforementioned functionality is available; + +0.4.12 (2021-04-13) +------------------- +* Pin auditok to 0.1.5 to avoid API-breaking change + +0.4.11 (2021-01-29) +------------------- +* Misc sync improvements: + * Have webrtcvad use '0' as the non speech label instead of 0.5; + * Allow the vad non speech label to be specified via the --non-speech-label command line parameter; + * Don't try to infer framerate ratio based on length between first and last speech frames for non-subtitle speech detection; + +0.4.10 (2021-01-18) +------------------- +* Lots of improvements from PRs submitted by @alucryd (big thanks!): + * Retain ASS styles; + * Support syncing several subs against the same ref via --overwrite-input flag; + * Add --apply-offset-seconds postprocess option to shift alignment by prespecified amount; +* Filter out metadata in subtitles when extracting speech; +* Add experimental --golden-section-search over framerate ratio (off by default); +* Try to improve sync by inferring framerate ratio based on relative duration of synced vs unsynced; + +0.4.9 (2020-10-11) ------------------ -* Developer note: change progress-only to vlc-mode and remove from help docs; +* Make default max offset seconds 60 and enforce during alignment as opposed to throwing away alignments with > max_offset_seconds; +* Add experimental section for using golden section search to find framerate ratio; +* Restore ability to read stdin and write stdout after buggy permissions check; +* Exceptions that occur during syncing were mistakenly suppressed; this is now fixed; -0.2.2 (2019-03-08) +0.4.8 (2020-09-22) ------------------ -* Allow reading input srt from stdin; -* Allow specifying encodings for reference, input, and output srt; -* Use the same encoding for both input srt and output srt by default; -* Developer note: using sklearn-style data pipelines now; +* Use webrtcvad-wheels on Windows to eliminate dependency on compiler; -0.2.3 (2019-03-08) +0.4.7 (2020-09-05) ------------------ -* Minor change to subtitle speech extraction; +* Misc bugfixes and stability improvements; -0.2.4 (2019-03-19) +0.4.6 (2020-06-10) ------------------ -* Add six to requirements.txt; -* Set default encoding to utf8 to ensure non ascii filenames handled properly; +* Bugfix for writing subs to stdout; -0.2.5 (2019-05-14) +0.4.5 (2020-06-09) ------------------ -* Clamp subtitles to maximum duration (default 10); +* Allow MicroDVD input format; +* Use output extension to determine output format; -0.2.6 (2019-05-15) +0.4.4 (2020-06-08) ------------------ -* Fix argument parsing regression; +* Use rich formatting for Python >= 3.6; +* Use versioneer to manage versions; -0.2.7 (2019-05-28) +0.4.3 (2020-06-07) ------------------ -* Add utf-16 to list of encodings to try for inference purposes; +* Fix regression where stdout not used for default output; +* Add ability to specify path to ffmpeg / ffprobe binaries; +* Add ability to overwrite the input / unsynced srt with the --overwrite-input flag; -0.2.8 (2019-06-15) +0.4.2 (2020-06-06) ------------------ -* Allow user to specify start time (in seconds) for processing; +* Fix Python 2 compatibility bug; -0.2.9 (2019-09-22) +0.4.1 (2020-06-06) ------------------ -* Quck and dirty fix to properly handle timestamp ms fields with >3 digits; +* Add --reference-stream option for selecting the stream / track from the video reference to use for speech detection; -0.2.10 (2019-09-22) +0.4.0 (2020-06-02) ------------------ -* Specify utf-8 encoding at top of file for backcompat with Python2; +* Remove dependency on scikit-learn; +* Implement PyInstaller / Gooey build process for graphical application on MacOS and Windows; -0.2.11 (2019-10-06) +0.3.7 (2020-05-11) ------------------ -* Quick and dirty fix to recover without progress info if `ffmpeg.probe` raises; +* Fix PyPI issues; -0.2.12 (2019-10-06) +0.3.5 (2020-05-08) ------------------ -* Clear O_NONBLOCK flag on stdout stream in case it is set; +* Fix corner case bug that occurred when multiple sync attempts were scored the same; -0.2.14 (2019-10-07) +0.3.4 (2020-03-20) ------------------ -* Bump min required scikit-learn to 0.20.4; +* Attempt speech extraction from subtitle tracks embedded in video first before using VAD; -0.2.15 (2019-10-11) +0.3.3 (2020-03-15) ------------------ -* Revert changes from 0.2.12 (caused regression on Windows); +* Hotfix for test archive creation bug; -0.2.16 (2019-12-04) +0.3.2 (2020-03-13) ------------------ -* Revert changes from 0.2.9 now that srt parses weird timestamps robustly; +* Add ability to merge synced and reference subs into bilingual subs when reference is srt; -0.2.17 (2019-12-21) +0.3.1 (2020-03-12) ------------------ -* Try to correct for framerate differences by picking best framerate ratio; +* Fix bug when handling ass/ssa input, this format should work now; 0.3.0 (2020-03-11) ------------------ @@ -101,134 +139,93 @@ History * Use utf-8 as default output encoding (instead of using same encoding as input); * More robust test framework (integration tests!); -0.3.1 (2020-03-12) +0.2.17 (2019-12-21) ------------------ -* Fix bug when handling ass/ssa input, this format should work now; +* Try to correct for framerate differences by picking best framerate ratio; -0.3.2 (2020-03-13) +0.2.16 (2019-12-04) ------------------ -* Add ability to merge synced and reference subs into bilingual subs when reference is srt; +* Revert changes from 0.2.9 now that srt parses weird timestamps robustly; -0.3.3 (2020-03-15) +0.2.15 (2019-10-11) ------------------ -* Hotfix for test archive creation bug; +* Revert changes from 0.2.12 (caused regression on Windows); -0.3.4 (2020-03-20) +0.2.14 (2019-10-07) ------------------ -* Attempt speech extraction from subtitle tracks embedded in video first before using VAD; +* Bump min required scikit-learn to 0.20.4; -0.3.5 (2020-05-08) +0.2.12 (2019-10-06) ------------------ -* Fix corner case bug that occurred when multiple sync attempts were scored the same; +* Clear O_NONBLOCK flag on stdout stream in case it is set; -0.3.7 (2020-05-11) +0.2.11 (2019-10-06) ------------------ -* Fix PyPI issues; +* Quick and dirty fix to recover without progress info if `ffmpeg.probe` raises; -0.4.0 (2020-06-02) +0.2.10 (2019-09-22) ------------------ -* Remove dependency on scikit-learn; -* Implement PyInstaller / Gooey build process for graphical application on MacOS and Windows; +* Specify utf-8 encoding at top of file for backcompat with Python2; -0.4.1 (2020-06-06) +0.2.9 (2019-09-22) ------------------ -* Add --reference-stream option for selecting the stream / track from the video reference to use for speech detection; +* Quck and dirty fix to properly handle timestamp ms fields with >3 digits; -0.4.2 (2020-06-06) +0.2.8 (2019-06-15) ------------------ -* Fix Python 2 compatibility bug; +* Allow user to specify start time (in seconds) for processing; -0.4.3 (2020-06-07) +0.2.7 (2019-05-28) ------------------ -* Fix regression where stdout not used for default output; -* Add ability to specify path to ffmpeg / ffprobe binaries; -* Add ability to overwrite the input / unsynced srt with the --overwrite-input flag; +* Add utf-16 to list of encodings to try for inference purposes; -0.4.4 (2020-06-08) +0.2.6 (2019-05-15) ------------------ -* Use rich formatting for Python >= 3.6; -* Use versioneer to manage versions; +* Fix argument parsing regression; -0.4.5 (2020-06-09) +0.2.5 (2019-05-14) ------------------ -* Allow MicroDVD input format; -* Use output extension to determine output format; +* Clamp subtitles to maximum duration (default 10); -0.4.6 (2020-06-10) +0.2.4 (2019-03-19) ------------------ -* Bugfix for writing subs to stdout; +* Add six to requirements.txt; +* Set default encoding to utf8 to ensure non ascii filenames handled properly; -0.4.7 (2020-09-05) +0.2.3 (2019-03-08) ------------------ -* Misc bugfixes and stability improvements; +* Minor change to subtitle speech extraction; -0.4.8 (2020-09-22) +0.2.2 (2019-03-08) ------------------ -* Use webrtcvad-wheels on Windows to eliminate dependency on compiler; +* Allow reading input srt from stdin; +* Allow specifying encodings for reference, input, and output srt; +* Use the same encoding for both input srt and output srt by default; +* Developer note: using sklearn-style data pipelines now; -0.4.9 (2020-10-11) +0.2.1 (2019-03-07) ------------------ -* Make default max offset seconds 60 and enforce during alignment as opposed to throwing away alignments with > max_offset_seconds; -* Add experimental section for using golden section search to find framerate ratio; -* Restore ability to read stdin and write stdout after buggy permissions check; -* Exceptions that occur during syncing were mistakenly suppressed; this is now fixed; - -0.4.10 (2021-01-18) -------------------- -* Lots of improvements from PRs submitted by @alucryd (big thanks!): - * Retain ASS styles; - * Support syncing several subs against the same ref via --overwrite-input flag; - * Add --apply-offset-seconds postprocess option to shift alignment by prespecified amount; -* Filter out metadata in subtitles when extracting speech; -* Add experimental --golden-section-search over framerate ratio (off by default); -* Try to improve sync by inferring framerate ratio based on relative duration of synced vs unsynced; - -0.4.11 (2021-01-29) -------------------- -* Misc sync improvements: - * Have webrtcvad use '0' as the non speech label instead of 0.5; - * Allow the vad non speech label to be specified via the --non-speech-label command line parameter; - * Don't try to infer framerate ratio based on length between first and last speech frames for non-subtitle speech detection; - -0.4.12 (2021-04-13) -------------------- -* Pin auditok to 0.1.5 to avoid API-breaking change - -0.4.13 (2021-05-10) -------------------- -* Support SSA embedded fonts using new pysubs2 'opaque_fonts' metadata; -* Set min required pysubs2 version to 1.2.0 to ensure the aforementioned functionality is available; - -0.4.14 (2021-05-10) -------------------- -* Hotfix for pysubs2 on Python 3.6; - -0.4.15 (2021-05-25) -------------------- -* Make typing_extensions a requirement - -0.4.16 (2021-07-22) -------------------- -* Fix a couple of validation bugs that prevented certain uncommon command line options from use; - -0.4.17 (2021-10-02) -------------------- -* Add --suppress-output-if-offset-less-than arg to suppress output for small syncs; +* Developer note: change progress-only to vlc-mode and remove from help docs; -0.4.17 (2021-10-03) -------------------- -* Don't remove log file if --log-dir-path explicitly requested; +0.2.0 (2019-03-06) +------------------ +* Get rid of auditok (GPLv3, was hurting alignment algorithm); +* Change to alignment algo: don't penalize matching video non-speech with subtitle speech; -0.4.18 (2021-11-07) -------------------- -* Allow `--apply-offset-seconds` when only subtitles specified; -* Make golden section search over scale factors option (`--gss`) available from help; -* Use -inf as objective for invalid offsets; +0.1.7 (2019-03-05) +------------------ +* Add Chinese to the list of encodings that can be inferred; +* Make srt parsing more robust; -0.4.19 (2022-01-07) -------------------- -* Blacken code and get rid of future_annotations dependency; +0.1.6 (2019-03-04) +------------------ +* Misc bugfixes; +* Proper logging; +* Proper version handling; -0.4.21 (2022-12-30) -------------------- -* Misc maintenance / compatibility fixes; +0.1.0 (2019-02-24) +------------------ +* Support srt format; +* Support using srt as reference; +* Support using video as reference (via ffmpeg); +* Support writing to stdout or file (read from stdin not yet supported; can only read from file); diff --git a/README.md b/README.md index bb5260b..7bb2f9d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ brew install ffmpeg (Windows users: make sure `ffmpeg` is on your path and can be referenced from the command line!) -Next, grab the script. It should work with both Python 2 and Python 3: +Next, grab the package (compatible with Python >= 3.6): ~~~ pip install ffsubsync ~~~ diff --git a/requirements.txt b/requirements.txt index ea05e60..8ba3560 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ auditok==0.1.5 -cchardet;platform_system!='Windows' cchardet;python_version<'3.11' chardet;python_version>='3.7' charset_normalizer