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

duplicate detection fails on small differences in filenames #4491

Open
milahu opened this issue Jul 2, 2024 · 0 comments
Open

duplicate detection fails on small differences in filenames #4491

milahu opened this issue Jul 2, 2024 · 0 comments
Assignees
Labels
bug Something isn't working pyLoad Next

Comments

@milahu
Copy link

milahu commented Jul 2, 2024

pyload should download only one of these files
they all have the same file size
they have no .part1.rar .part2.rar ... extensions

Carl.R.Trueman.Der.Siegeszug.des.modernen.Selbst.(Ungekürzt).rar
CARL.R.TRUEMAN.DER.SIEGESZUG.DES.MODERNEN.SELBST.(UNGEKÜRZT).RAR
Carl R. Trueman - Der Siegeszug des modernen Selbst (Ungekürzt).rar
Carl_R._Trueman_-_Der_Siegeszug_des_modernen_Selbst_(Ungekürzt).rar

filenames could be normalized with

filenames = """
Carl.R.Trueman.Der.Siegeszug.des.modernen.Selbst.(Ungekürzt).rar
CARL.R.TRUEMAN.DER.SIEGESZUG.DES.MODERNEN.SELBST.(UNGEKÜRZT).RAR
Carl R. Trueman - Der Siegeszug des modernen Selbst (Ungekürzt).rar
Carl_R._Trueman_-_Der_Siegeszug_des_modernen_Selbst_(Ungekürzt).rar
"""

import re

def replace_match(match):
    m = match.group(0)
    if m == "ä": return "ae"
    if m == "ö": return "oe"
    if m == "ü": return "ue"
    if m == "ß": return "ss"
    return "."

print(
    re.sub("[.]{2,}", ".",
        re.sub("[^a-zA-Z0-9\n]", replace_match, filenames.lower())
    )
)
carl.r.trueman.der.siegeszug.des.modernen.selbst.ungekuerzt.rar
carl.r.trueman.der.siegeszug.des.modernen.selbst.ungekuerzt.rar
carl.r.trueman.der.siegeszug.des.modernen.selbst.ungekuerzt.rar
carl.r.trueman.der.siegeszug.des.modernen.selbst.ungekuerzt.rar
@milahu milahu added bug Something isn't working pyLoad Next labels Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pyLoad Next
Development

No branches or pull requests

2 participants