Closed f870103 closed 3 months ago
The current implementation of the
cn2an
library in strict mode throws aValueError
exception when encountering season names containing Arabic numerals. This issue is observed while processing season name like "第2季".$ python subtitle_downloader.py https://www.iq.com/play/%E7%84%A1%E8%81%B7%E8%BD%89%E7%94%9F%EF%BD%9E%E5%88%B0%E4%BA%86%E7%95%B0%E4%B8%96%E7%95%8C%E5%B0%B1%E6%8B%BF%E5%87%BA%E7%9C%9F%E6%9C%AC%E4%BA%8B%EF%BD%9E%E7%AC%AC2%E5%AD%A3-1pq3ov9tyy4?lang=zh_tw Traceback (most recent call last): File "/home/user/Subtitle-Downloader/subtitle_downloader.py", line 151, in <module> main() File "/home/user/Subtitle-Downloader/subtitle_downloader.py", line 140, in main service['class'](args).main() File "/home/user/Subtitle-Downloader/services/iqiyi/iqiyi.py", line 370, in main self.series_subtitle( File "/home/user/Subtitle-Downloader/services/iqiyi/iqiyi.py", line 118, in series_subtitle season_name = cn2an( File "/home/user/.local/lib/python3.10/site-packages/cn2an/cn2an.py", line 58, in cn2an sign, integer_data, decimal_data, is_all_num = self.__check_input_data_is_valid(inputs, mode) File "/home/user/.local/lib/python3.10/site-packages/cn2an/cn2an.py", line 155, in __check_input_data_is_valid raise ValueError(f"当前为{mode}模式,输入的数据不在转化范围内:{data}!") ValueError: 当前为strict模式,输入的数据不在转化范围内:2!
Seems this will also happen in other platform with the same parsing logic.
Fixed, please try again.
Confirm fixed, thanks.
The current implementation of the
cn2an
library in strict mode throws aValueError
exception when encountering season names containing Arabic numerals. This issue is observed while processing season name like "第2季".Seems this will also happen in other platform with the same parsing logic.
https://github.com/wayneclub/Subtitle-Downloader/blob/2c4d4ca45ca2234a9688266648b380585340d260/services/iqiyi/iqiyi.py#L115-L121