Subjects without a quoted file name: the name from the rest of the subject
Most "obfuscated" subjects of older and smaller groups name their file
without quotes ("DVDFab 8.2.0.5.rar (006/332)", fta's "q3B9…part023.rar
(104/137)", "New_Super_Mario_Bros._[Keygen].exe (1/2)") or with one
quote ("[keira_s04_0037_l.jpg\" yEnc] (2/2)"): 100% of ath 2013's and
fta's, 94% of models' (LOG.md 2026-10-11 (5)). With a segment counter and
no quoted name, unquotedName takes the name before a lone quote (after a
"[", else after the last space), else the text when it ends in a file
name (after "] " or " - "), else its first word that is one; a file
counter stuck in a bracket is dropped. The release identity takes such a
name out of the subject as it would quotes (else every image of a set
was a release: 9,130 instead of 267 on the models fixture).
Both implementations; a fourth fixture (fta, 25k lines) and tests; check
identical on all four. Truly random subjects (ngPost hex = message-id,
random tokens) stay obfuscated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
18b9ffdca3
commit
90f30f445d
13 files changed
+174
-25
No files matched your search
@@ -41,6 +41,26 @@ test.group('subject / parseSubject', () => {
|
||||
assert.isNull(parseSubject('"name.rar" yEnc (0/5)'))
|
||||
assert.isNull(parseSubject('"name.rar" yEnc (6/5)'))
|
||||
assert.isNull(parseSubject('"" yEnc (1/5)'))
|
||||
// A counter but no file name: still obfuscated.
|
||||
assert.isNull(parseSubject('[7w] - 9BbEV2MrTi59GBTEFlVrssBrXNwXf2SK9cQEeDjg yEnc (1/12432)'))
|
||||
assert.isNull(parseSubject('Re: Will somebody answer the question? (1/2)'))
|
||||
})
|
||||
|
||||
test('finds the file name of subjects without a quoted one (unquotedName)', ({ assert }) => {
|
||||
const cases: [string, string, number, number, number?][] = [
|
||||
['DVDFab 8.2.0.5.rar (006/332)', 'DVDFab 8.2.0.5.rar', 6, 332],
|
||||
['q3B9OrpKiCxUnzgtUGnp.part023.rar (104/137)', 'q3B9OrpKiCxUnzgtUGnp.part023.rar', 104, 137],
|
||||
['New_Super_Mario_Bros._[Keygen].exe (1/2)', 'New_Super_Mario_Bros._[Keygen].exe', 1, 2],
|
||||
['Emily_18_-_Bed.part01.rar Emily 18 bed video FULL NUDE (01/24)', 'Emily_18_-_Bed.part01.rar', 1, 24],
|
||||
['[33/117] 674a37548b09.dat (1/1)', '674a37548b09.dat', 1, 1, 33],
|
||||
["pal! [Mivina high(1).wmv\" yEnc] (323/349)", 'Mivina high(1).wmv', 323, 349],
|
||||
['[03/21 Geroellheimer - S03E16.part01.rar" yEnc (1/50)', 'Geroellheimer - S03E16.part01.rar', 1, 50],
|
||||
]
|
||||
for (const [subject, name, segment, total, fileIndex] of cases) {
|
||||
const parsed = parseSubject(subject)
|
||||
assert.include(parsed, { name, segment, totalSegments: total }, subject)
|
||||
if (fileIndex) assert.equal(parsed!.fileIndex, fileIndex)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user