Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'replace' #5

Closed
ddund opened this issue Feb 12, 2022 · 2 comments
Closed

AttributeError: 'NoneType' object has no attribute 'replace' #5

ddund opened this issue Feb 12, 2022 · 2 comments

Comments

@ddund
Copy link

ddund commented Feb 12, 2022

Hey, I get an error when trying to run your script on my library. Not sure if the fault is on my end or if it's something in the script. I'm running python 3.9.5.

Traceback (most recent call last):
  File "/config/subcleaner/subcleaner.py", line 8, in <module>
    main.main(Path(__file__).absolute().parent)
  File "/config/subcleaner/libs/subcleaner/main.py", line 29, in main
    parse_config()
  File "/config/subcleaner/libs/subcleaner/main.py", line 217, in parse_config
    cleaner = Cleaner(package_dir.joinpath("regex"), regex_defaults)
  File "/config/subcleaner/libs/subcleaner/cleaner.py", line 17, in __init__
    self._build_regex(regex_dir, use_default_regex)
  File "/config/subcleaner/libs/subcleaner/cleaner.py", line 156, in _build_regex
    self._add_exclusive_configs()
  File "/config/subcleaner/libs/subcleaner/cleaner.py", line 187, in _add_exclusive_configs
    excluded_languages = parser["META"].get("excluded_language_codes").replace(" ", "").split(",")
AttributeError: 'NoneType' object has no attribute 'replace'
@KBlixt
Copy link
Owner

KBlixt commented Feb 13, 2022

whoops, my bad, this should be fixed now, thank you for letting me know about this issue!

Please update and verify that it works :)

@ddund
Copy link
Author

ddund commented Feb 13, 2022

whoops, my bad, this should be fixed now, thank you for letting me know about this issue!

Please update and verify that it works :)

Yes, it works now.

Here are some of the false positives and some interesting warnings I got if you want to use them to possible improve the regex.

False positives:
    [INFO]: Removed 3 subtitle blocks:
            [---------Removed Blocks----------]
            1
            00:00:01,375 --> 00:00:03,837
            December 31, 1999
[---------------------------------------------------------------------------------]
    [INFO]: Removed 3 subtitle blocks:
            [---------Removed Blocks----------]
            3
            00:00:33,825 --> 00:00:36,161
            UNDERREDSBEHANDLING
[---------------------------------------------------------------------------------]
    [INFO]: Removed 4 subtitle blocks:
            [---------Removed Blocks----------]
            1
            00:00:01,752 --> 00:00:03,837
            <i>Glada nyheter!</i>

            17
            00:01:31,716 --> 00:01:33,802
            UPPFINNAR-
            AKADEMIN
[---------------------------------------------------------------------------------]
    [INFO]: Removed 3 subtitle blocks:
            [---------Removed Blocks----------]
            7
            00:00:45,177 --> 00:00:47,479
            Mars University
[---------------------------------------------------------------------------------]
    [INFO]: Removed 4 subtitle blocks:
            [---------Removed Blocks----------]
            1
            00:00:03,850 --> 00:00:06,730
            Baserad på en sann historia

            2
            00:00:06,939 --> 00:00:09,192
            Xmas Story
[---------------------------------------------------------------------------------]
    [INFO]: Removed 4 subtitle blocks:
            [---------Removed Blocks----------]
            1
            00:00:03,980 --> 00:00:07,732
            Nominerad för tre Glemmys

            2
            00:00:07,942 --> 00:00:10,109
            Raging Bender
[---------------------------------------------------------------------------------]
    [INFO]: Removed 4 subtitle blocks:
            [---------Removed Blocks----------]
            1
            00:00:04,416 --> 00:00:07,461
            Allvarlig varning
            om kommande händelser

            2
            00:00:07,503 --> 00:00:09,672
            Deep South
[---------------------------------------------------------------------------------]
    [INFO]: Removed 3 subtitle blocks:
            [---------Removed Blocks----------]
            1
            00:00:01,895 --> 00:00:06,485
            Futurama presenteras av Smält Bor!
    [INFO]: Removed 4 subtitle blocks:
            [---------Removed Blocks----------]
            1
            00:00:03,480 --> 00:00:07,000
            LARV-TESTAD, PUPPA-GODKÄND

            2
            00:00:07,200 --> 00:00:09,279
            Mother's Day
[---------------------------------------------------------------------------------]
Warnings:
[---------------------------------------------------------------------------------]
    [WARNING]: Potential ads in 2 subtitle blocks, please verify:
               [---------Warning Blocks----------]
               6
               00:01:06,525 --> 00:01:12,781
               Gosskören

               9
               00:03:03,307 --> 00:03:04,977
               Pepinot
               [---------------------------------]
[---------------------------------------------------------------------------------]
    [WARNING]: Potential ads in 1 subtitle blocks, please verify:
               [---------Warning Blocks----------]
               1
               00:00:05,996 --> 00:00:10,877
               Drömmar är meddelanden från djupet.
[---------------------------------------------------------------------------------]
    [WARNING]: Potential ads in 1 subtitle blocks, please verify:
               [---------Warning Blocks----------]
               7
               00:00:57,941 --> 00:01:03,780
               HÄRSKARRINGEN
[---------------------------------------------------------------------------------]
    [WARNING]: Potential ads in 1 subtitle blocks, please verify:
               [---------Warning Blocks----------]
               201
               00:21:10,645 --> 00:21:13,397
               Rymdgetingens
               maginnehåll
[---------------------------------------------------------------------------------]
    [WARNING]: Potential ads in 1 subtitle blocks, please verify:
               [---------Warning Blocks----------]
               1
               00:00:16,099 --> 00:00:19,894
               <i>Åker genom robot-tvätten!</i>
[---------------------------------------------------------------------------------]
    [WARNING]: Potential ads in 1 subtitle blocks, please verify:
               [---------Warning Blocks----------]
               18
               00:02:01,513 --> 00:02:02,873
               Förlorare
[---------------------------------------------------------------------------------]
    [WARNING]: Potential ads in 2 subtitle blocks, please verify:
               [---------Warning Blocks----------]
               13
               00:01:43,504 --> 00:01:45,626
               APPLÅDER

               14
               00:01:46,709 --> 00:01:49,332
               MINDRE APPLÅDER
[---------------------------------------------------------------------------------]

Tack för ett väldigt trevligt skript :)

@ddund ddund closed this as completed Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants