sec06: key-vs-f_id discovery — 12 EN files recovered (6 rescues) + precheck v2

- USER FINDING: libgen edition files map {key: {f_id, md5}} — KEY and f_id VALUE
  are DIFFERENT file records; we were downloading/prechecking by the KEY (wrong file).
- Recovered by f_id: 09-t1 (Eliade UCP 1978), 13 Sungod (Cornell 2010), 14 Solomon
  (Karnac 2007), 17 God-Image (Inner Light 1992), 19 Hornung (UNC 1982), 20 Psyche in
  Scripture (1995), 23 Dionysos (Bollingen LXV/2 Princeton) + backups 12/16/24/25/26/27.
  All content-verified. '24 systemic mislinks' = our bug, not libgen.
- lg.py: objects[]=f,e,s,a,p,w + topics[] (file-level search; found Solomon md5) +
  md5 in output. lgdl.py: bymd5 subcommand.
- precheck v2: rev-value match = OK; locator words >=2 shared = OK; words present
  0 shared = BAD; hash/ISBN/empty locator = no signal (SUSPECT); digit-runs masked
  before tokenization (hex 'aaae' trap).
- MANIFEST/SUMMARY/cards/AGENTS.md updated. 34 files, 608 MB (28 backup still downloading).
This commit is contained in:
Dmitry Kokorin 2026-09-25 10:04:01 +03:00
parent 96c0e1190d
commit b7ddfac17e
30 changed files with 298 additions and 137 deletions

View file

@ -11,10 +11,10 @@ We work **section by section**. Sections **01–05 are COMPLETE** (01: 38✅/2
2026-09-22 (7 rescues from user tips — see Lessons), **EN downloads COMPLETE 2026-09-23**
(30 files, 362 MB; 5 EN gaps unavailable + 2 ia-restricted; SUMMARY.md at-a-glance table done).
Section 06: research + user oracle DONE 2026-09-24 (28 карточек: **19 ✅ / 1 🔶 / 8 ❌**;
7 rescues; каталог Касталии 1285 в data/catalogs + rule в gate v3); **downloads COMPLETE
2026-09-25** (22 файла, 413 MB: RU 13 + EN 8 + DE 1 бонус; 6 кросс-рефов на sec01-03;
RU платные castalia-PDF не скачивались; EN: libgen-батч почти весь mislinked → 9 файлов с ia
open-uploads; sec03#20 RU-дыра пометка в MANIFEST). Section 07 pending; 08–12 scope
7 rescues; каталог Касталии 1285 в data/catalogs + rule в gate v3); **downloads FINAL
2026-09-25** (34 файла, 608 MB: RU 12 + EN 21 + DE 1 бонус; 6 кросс-рефов на sec01-03;
EN: 9 с ia open-uploads + 12 с libgen после находки key-vs-f_id — rescues 09-t1, 13, 14, 17, 19, 20, 23;
RU платные castalia-PDF не скачивались; sec03#20 RU-дыра пометка в MANIFEST). Section 07 pending; 08–12 scope
decision pending.
## Repository layout
@ -167,6 +167,11 @@ sections/0N-<name>/ # one .md per BOOK (chapter-level list items are merged int
→ Use **full inflected words** (nominative, as stored in titles) and 2–3 distinctive words.
- Author search works (`req=Нойманн`) but pulls homonyms — filter by first name in results.
- Pagination: `&page=N` works.
- **Search objects (2026-09-25):** `objects[]` param = что искать (f=files, e=editions, s=series…).
Без него = editions-only — файлы, не привязанные к нужному изданию, НЕ находятся
(Solomon: editions-поиск = только mislinked 2021-издание, files-поиск = настоящий файл 2018-го).
lg.py теперь шлёт `objects[]=f,e,s,a,p,w` + `topics[]=l,c,f,a,m,r,s` и печатает `[md5=…]` в строках
→ `tools/lgdl.py bymd5 <md5>` = f_id + метаданные. Это нашло все 6 rescues sec06.
- Edition page: `https://libgen.vg/edition.php?id=<id>`.
### 3. cogito-shop.com — current Russian trade (Jungian/psychoanalysis specialists)
@ -473,30 +478,40 @@ sections/0N-<name>/ # one .md per BOOK (chapter-level list items are merged int
4. **flib authorall for prolific RU authors** (Элиаде a/2943 = 49 books) caught «Тайные общества»
(sec05 #13) that libgen title search missed. Always run flib author sweep for authors with
>5 RU books.
5. **libgen mislinked-file trap (SYSTEMIC — 9/20 files in the sec05 RU batch were wrong)**:
edition files can be mislinked (141685581 «На пороге инициации» carried an ePubLibre
Spanish Lermontov file; the sec05 «pdf» batch carried English academic papers:
*Food Engineering Research*, *Surface & Coatings Technology*, *International Journal of Food
Sciences*, an EN novel, even a RU fantasy «Подмененный» as fb2 for «Священное и мирское»;
the 4 van Gennep epubs were Spanish fiction). Sizes pass lgdl's md5 check. **Mandatory:
after every libgen download, content-verify: `pdfinfo` page count vs RSL record + first-page
text (pdftotext -l 3 / fb2 body head / epub xhtml head) must contain the RU title/author.**
5. **libgen mislinked-file trap + KEY vs f_id (2026-09-25, уточнение):**
(a) Edition files can be mislinked (141685581 «На пороге инициации» carried an ePubLibre
Spanish Lermontov file; the sec05 «pdf» batch carried English academic papers; the 4 van Gennep
epubs were Spanish fiction). Sizes pass lgdl's md5 check. **Mandatory: after every libgen
download, content-verify: `pdfinfo` page count vs RSL record + first-page text
(pdftotext -l 3 / fb2 body head / epub xhtml head) must contain the RU/EN title/author.**
For recent books prefer flib (clean files); flib `/b/<id>/download` → 302 → direct
`static.flibusta.is` URL.
(b) **KEY vs f_id (системная ловушка, наш баг, не libgen):** в JSON-карточке издания
`files` = `{public_key: {f_id: X, md5: Y}}` — КЕЙ и f_id-ЗНАЧЕНИЕ = РАЗНЫЕ файловые записи.
`object=f&ids=<key>` возвращает устаревший/чужой файл (Solomon: key 92709688 = 20MB рус. антология;
f_id 93253044 = настоящая 2MB-книга). Утром 2026-09-25 «24 mislinked EN» = качали по key;
скачав по f_id-значениям — rescues 06-й секции: 09-t1, 13, 14, 17, 19, 20, 23 + бэкапы.
**Правило: качать и пречекать ТОЛЬКО по f_id-значению из files-мапы (md5 для контроля).**
Файл-уровневый поиск (`objects[]=f` в lg.py) находит файлы, не привязанные к «нашему» изданию
(так найден md5 Solomon, когда editions-поиск его не показывал).
6. **Collection-inclusion questions** (#27/#28): download the smallest fb2, parse the TOC
(`<section name="title">`), grep for the EN book title + RU calque. «Символ и ритуал» (Наука
1983) CONTAINS «Ритуальный процесс» (full text, core section) but NOT «Лес символов»
(citations only).
7. **flib pdf download**: `/b/<id>/pdf` may return an HTML stub; `/b/<id>/download` → 302 →
direct `static.flibusta.is:443/b.usr/<File>.<ext>` URL — curl that directly.
8. **Content-verify gate (2026-09-22, after the sec05 mislinked batch)**: every downloaded file
gets a two-second check — magic bytes + `pdfinfo` pages + first-page/head text containing the
expected RU title/author. A file that fails is discarded and re-sourced (usually flib).
**Pre-download gate: `tools/lgdl.py precheck <f_id> <edition_id> [pages]`** (exit 0 OK /
1 SUSPECT / 2 BAD) — checks the file record's `editions` reverse-map (must contain the target
edition), `locator` batch path, size sanity; `dl <f_id> <dir> <name> <edition_id>` runs it
automatically and aborts on BAD. Mislink = skip that f_id → next file of the same edition →
next candidate edition → flib; log rejected f_ids in MANIFEST notes.
8. **Content-verify gate (2026-09-22, после sec05 mislinked batch; precheck дообучен 2026-09-25):**
every downloaded file gets a two-second check — magic bytes + `pdfinfo` pages + first-page/head
text containing the expected RU title/author. A file that fails is discarded and re-sourced
(usually flib). **Pre-download gate: `tools/lgdl.py precheck <f_id> <edition_id> [pages]`**
(exit 0 OK / 1 SUSPECT / 2 BAD). Логика (2026-09-25): (1) reverse-map file-записи: значения
= PUBLIC edition ids — совпадение с целью = сильный OK-сигнал (для записи настоящего f_id);
(2) locator: ≥2 общих слова с целью = OK; слова есть, но 0 общих = BAD (именует другую книгу);
хэш/ISBN/пустой locator = без сигнала (SUSPECT) — digit-содержащие runs маскируются до
токенизации (иначе hex даёт фейк-токены вроде «aaae»). Контент-верификация после даунлоуда —
всегда конечный гейт. Mislink = skip → next f_id of same edition → next edition → flib;
отклонённые f_id логируются в MANIFEST notes. `dl <f_id> <dir> <name> <edition_id>` запускает
precheck автоматически.
9. **EN-queue infra (2026-09-23, sec05 EN sweep)**: the libgen bottleneck is (a) `ads.php`
card-page IP-throttling under sustained load — pause 30–60 min, do NOT hammer (deepens the
block); (b) wedged CDN edges — each `get.php` 302s to a different storage host, so

BIN
downloads/06-religion/09-eliade-hri-en-a.epub (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/12-otto-idea-of-holy-en-b.epub (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/13-schweizer-sungod-en.pdf (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
downloads/06-religion/16-corbin-alone-en-b.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/17-edinger-god-image-en.epub (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/19-hornung-conceptions-en.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/20-kluger-psyche-scripture-en.epub (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/23-kerenyi-dionysos-en-1996.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/24-macculloch-christianity-en-b.epub (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/25-schimmel-mystical-islam-en-b.pdf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/26-scholem-major-trends-en-b.epub (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/27-suzuki-zen-en-b.epub (Stored with Git LFS) Normal file

Binary file not shown.

BIN
downloads/06-religion/28-zimmer-philosophies-en-b.pdf.part (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -1,9 +1,10 @@
# Downloads — Section 06 Religion — FINAL 2026-09-25
## Totals
22 files, 413 MB — RU 12 / EN 9 / DE 1 (бонус-оригинал Кереньи).
33 файла, 599 MB — RU 12 / EN 20 / DE 1 (бонус-оригинал Кереньи).
Кросс-секционные файлы (items 01, 02, 03, 05, 06, 11) НЕ скачивались заново —
см. ссылки на секции 01/02/03.
2026-09-25: +11 EN-файлов после находки «key vs f_id» (см. Notes) — rescues: 09-t1, 13, 14, 17, 19, 20, 23.
## Files (per item)
@ -28,7 +29,7 @@ EN: NOT FOUND (2026-09-25: ia CDL-only, libgen 0); RU: нет (❌).
### 08 — Niklaus von Flüe and Saint Perpetua (von Franz) — 0 files
RU: ПЛАТНО (castalia.ru PDF, 1190 ₽) — не скачивалось по правилу; EN: NOT FOUND (ia/libgen 0).
### 09 — History of Religious Ideas (3 vols) — 5 files
### 09 — History of Religious Ideas (3 vols) — 6 files
| file | size | source | verify |
|---|---|---|---|
| 09-eliade-hri-t1-ru-2002.fb2 | 2.2 MB | flib b/122503 | ✅ полный (конец = прим. 814) |
@ -36,36 +37,51 @@ RU: ПЛАТНО (castalia.ru PDF, 1190 ₽) — не скачивалось п
| 09-eliade-hri-t2-ru-2002.fb2 | 2.4 MB | flib b/860620 | ✅ |
| 09-eliade-hri-t3-ru-2002.fb2 | 1.7 MB | flib b/123000 | ✅ |
| 09-eliade-hri-t2-en-1976.pdf | 44 MB | ia mircea-eliade-a-history-of-religious-ideas-volume-2 | ✅ 581 pp, "Trask" |
| 09-eliade-hri-en-a.epub | 1.5 MB | lg f/93168103 ed 137939922 | ✅ **t1 EN**: «Volume 1: From the Stone Age to the Eleusinian Mysteries», UCP 1978, tr. Trask |
EN t1/t3: NOT FOUND (ia `historyofreligio*` = CDL 401; ar-upload t1 отклонён — арабская версия).
EN t3: NOT FOUND (ia CDL; libgen vol.3 не найден, 2026-09-25).
### 10 — The Jung-White Letters — 0 files
RU: ПЛАТНО (castalia.ru PDF); EN: NOT FOUND (ia/libgen 0, 2026-09-25).
### 12 — The Idea of the Holy (Otto) — 2 files
### 12 — The Idea of the Holy (Otto) — 3 files
| file | size | source | verify |
|---|---|---|---|
| 12-otto-idea-of-holy-ru-2008.djvu | 2.5 MB | lg f/91429639 ed 136106159 | ✅ «Профессорская библиотека», СПбГУ 2008 |
| 12-otto-idea-of-holy-en-1923.pdf | 15.8 MB | ia rudolf-otto-the-idea-of-the-holy-2 | ✅ 260 pp, Oxford 1958-скан |
| 12-otto-idea-of-holy-en-b.epub | 407 KB | lg f/101019653 ed 144770384 | ✅ «The Idea of the Holy: an inquiry into the non-rational factor...» (Harvey tr.) |
### 13 — The Sungod's Journey (Schweizer) — 0 files
RU: ПЛАТНО (castalia.ru PDF); EN: NOT FOUND (ia `sungodsjourneyth0000schw` = CDL; lg f/92657205 mislinked).
### 13 — The Sungod's Journey (Schweizer) — 1 file
| file | size | source | verify |
|---|---|---|---|
| 13-schweizer-sungod-en.pdf | 15 MB | lg f/93205766 ed 137979947 | ✅ «the sungod's journey through the netherworld», 247 pp (ISBN 0801448751 в locator) |
### 14 — The Self in Transformation (Solomon) — 0 files
EN: NOT FOUND (ia `selfintransforma0000solo` = CDL; lg f/92709688 mislinked «Ранняя греческая лирика»). RU: нет (❌).
RU: ПЛАТНО (castalia.ru PDF).
### 14 — The Self in Transformation (Solomon) — 1 file
| file | size | source | verify |
|---|---|---|---|
| 14-solomon-self-transformation-en-2007.pdf | 2.1 MB | lg f/93253044 ed 138032430 | ✅ 353 pp, «First published 2007 by Karnac Books, © H. M. Solomon, ISBN 978-1-85575-570-3» |
RU: нет (❌).
### 15 — Jung's Treatment of Christianity (Stein) — 0 files
EN: NOT FOUND (ia `jungstreatmentof0000stei` = CDL; libgen 0). RU: нет (❌).
### 16 — Alone with the Alone (Corbin) — 1 file
### 16 — Alone with the Alone (Corbin) — 2 files
| file | size | source | verify |
|---|---|---|---|
| 16-corbin-alone-en-1998.pdf | 7.4 MB | ia HenryCorbinAloneWithTheAlone | ✅ 435 pp, Princeton 1998 |
| 16-corbin-alone-en-b.pdf | 8 MB | lg f/97917289 ed 142157166 | ✅ 444 pp, «BOLLINGEN SERIES XCI» (Princeton 1998) |
RU: нет (❌; Касталия издаёт только «Творящее воображение в суфизме»). lg f/91077147, 97644847 mislinked (комикс «Art of Chris Malgrain» / «Русский разведчик»).
RU: нет (❌; Касталия издаёт только «Творящее воображение в суфизме»).
### 17 — The Transformation of the God-Image (Edinger) — 0 files
RU: ПЛАТНО (castalia.ru PDF); EN: NOT FOUND (ia `transformationof0000edin` = CDL; lg f/91091400 mislinked (комикс «Middlewest 009»)).
### 17 — The Transformation of the God-Image (Edinger) — 1 file
| file | size | source | verify |
|---|---|---|---|
| 17-edinger-god-image-en.epub | 544 KB | lg f/91722137 ed 136414142 | ✅ scan-epub; p.57 = гл. о тайне Софии, «Answer to Job» para 616 |
RU: ПЛАТНО (castalia.ru PDF).
### 18 — Descent to the Goddess (Perera) — 1 file
| file | size | source | verify |
@ -74,42 +90,46 @@ RU: ПЛАТНО (castalia.ru PDF); EN: NOT FOUND (ia `transformationof0000edin`
RU: ПЛАТНО (castalia.ru PDF, Касталия 2024).
### 19 — Conceptions of God in Ancient Egypt (Hornung) — 0 files
EN: NOT FOUND (ia `conceptionsofgod0000horn` = CDL; lg f/106625804 mislinked). RU: нет (❌).
### 19 — Conceptions of God in Ancient Egypt (Hornung) — 1 file
| file | size | source | verify |
|---|---|---|---|
| 19-hornung-conceptions-en.pdf | 16.5 MB | lg f/106935291 ed 149622702 | ✅ TOC: «Classification and Articulation of the Pantheon... The initiative of Akhenaten», 304 pp |
### 20 — Psyche in Scripture (Klüger) — 1 file
RU: нет (❌).
### 20 — Psyche in Scripture (Klüger) — 2 files
| file | size | source | verify |
|---|---|---|---|
| 20-kluger-psyche-scripture-ru-2000.fb2 | 490 KB | flib b/524157 | ✅ ИНФРА-М 2000, 96 стр. |
EN: NOT FOUND (ia `psycheinscriptur0000scha` = CDL; lg f/91135572 mislinked «Surfaces»).
| 20-kluger-psyche-scripture-en.epub | 303 KB | lg f/91762623 ed 136458314 | ✅ scan-epub; p.100 = цитата Юнга по царице Савской |
### 21 — Satan in the Old Testament (Klüger) — 0 files
RU: ПЛАТНО (castalia.ru PDF); EN: NOT FOUND (ia `sataninoldtestam0000klug` = CDL; libgen 0).
RU: ПЛАТНО (castalia.ru PDF); EN: NOT FOUND (ia CDL; libgen 0).
### 22 — The Religion of the Greeks and Romans (Kerényi) — 0 files
EN: NOT FOUND (ia `religionofgreeks0000kere` = CDL; libgen 0; на ia есть open-скан ИСПАНСКОГО перевода «La Religión Antigua»). RU: нет (❌).
EN: NOT FOUND (ia CDL; libgen 0; на ia есть open-скан ИСПАНСКОГО перевода «La Religión Antigua»). RU: нет (❌).
### 23 — Dionysos (Kerényi) — 2 files
### 23 — Dionysos (Kerényi) — 3 files
| file | size | source | verify |
|---|---|---|---|
| 23-kerenyi-dionysos-ru-2007.djvu | 20 MB | lg f/92321117 ed 136492484 | ✅ «КАРА КЕРЕНЬИ… Прообраз неиссякаемой жизни», Ладомир 2007 |
| 23-kerenyi-dionysos-de-1956.pdf | 39 MB | lg f/91385548 ed 136058742 | ✅ НЕМЕЦКИЙ оригинал (DTV 1956, 417 стр.) — бонус, в счёт EN не идёт |
| 23-kerenyi-dionysos-en-1996.pdf | 117 MB | lg f/113610602 ed 206259184 | ✅ титры: «Carl Kerenyi DIONYSOS Archetypal Image of Indestructible Life, tr. Manheim, BOLLINGEN LXV/2, Princeton UP», 608 pp (скан 1-го изд. 1976) |
EN: NOT FOUND (ia `dionysos00karl` = CDL; lg f/106983766, 115176858 mislinked).
### 24 — Christianity: The First Three Thousand Years (MacCulloch) — 2 files
### 24 — Christianity: The First Three Thousand Years (MacCulloch) — 3 files
| file | size | source | verify |
|---|---|---|---|
| 24-macculloch-christianity-ru-2018.fb2 | 26 MB | flib b/662900 | ✅ Эксмо 2018, 1136 стр. |
| 24-macculloch-christianity-en-2010.pdf | 7.4 MB | ia mac-culloch-diarmaid-a-history-of-christianity-the-first-three-thousand-years | ✅ 1383 pp (расшир. изд.), TOC |
| 24-macculloch-christianity-en-b.epub | 2.2 MB | lg f/101124346 ed 144875083 | ✅ «VIKING Published by the Penguin Group» (1-е изд. 2009) |
### 25 — Mystical Dimensions of Islam (Schimmel) — 3 files
### 25 — Mystical Dimensions of Islam (Schimmel) — 4 files
| file | size | source | verify |
|---|---|---|---|
| 25-schimmel-mystical-islam-ru-1999.djvu | 23.6 MB | lg f/92533199 ed 137279502 | ✅ скан 1999 |
| 25-schimmel-mystical-islam-ru-2012.pdf | 2.5 MB | lg f/92426973 ed 137163778 | ✅ Садра 2012, 536 стр. (УДК 141.336) |
| 25-schimmel-mystical-islam-en-1975.pdf | 50 MB | ia x-mystical-dimensions-of-islam | ✅ 525 pp, стр. "ABBREVIATIONS" (UNC) |
| 25-schimmel-mystical-islam-en-1975.pdf | 50 MB | ia x-mystical-dimensions-of-islam | ✅ 525 pp, str. "ABBREVIATIONS" (UNC) |
| 25-schimmel-mystical-islam-en-b.pdf | 30 MB | lg f/93199017 ed 137973117 | ✅ 543 pp (UNC 1987, ISBN 9780807899762 в locator) |
### 26 — Major Trends in Jewish Mysticism (Scholem) — 2 files
| file | size | source | verify |
@ -147,35 +167,34 @@ RU: нет (❌).
| 18 | Descent to the Goddess (RU) |
| 21 | Satan in the Old Testament |
### EN (full text unavailable — ia CDL-only / libgen 0 or mislinked)
### EN (full text unavailable — ia CDL-only / libgen 0)
| item | книга | reason |
|---|---|---|
| 04 | The Idea of the Numinous | ia 0, libgen 0 (2006, Chiron) |
| 07 | The Passion of Perpetua (von Franz) | ia CDL, libgen 0 |
| 08 | Niklaus von Flüe (EN) | 2022, ia/libgen 0 |
| 09 t1, t3 | History of Religious Ideas vols 1, 3 | ia CDL (t2 есть) |
| 09 t3 | History of Religious Ideas vol. 3 | ia CDL (t1+t2 есть) |
| 10 | The Jung-White Letters | ia 0, libgen 0 |
| 13 | The Sungod's Journey | ia CDL, lg mislinked |
| 14 | The Self in Transformation | ia CDL, lg mislinked |
| 15 | Jung's Treatment of Christianity | ia CDL, libgen 0 |
| 17 | The Transformation of the God-Image | ia CDL, lg mislinked (комикс) |
| 19 | Conceptions of God in Ancient Egypt | ia CDL, lg mislinked |
| 20 | Psyche in Scripture | ia CDL, lg mislinked |
| 21 | Satan in the Old Testament | ia CDL, libgen 0 |
| 22 | The Religion of the Greeks and Romans | ia CDL, libgen 0 |
| 23 | Dionysos (EN) | ia CDL, lg mislinked (есть DE-оригинал) |
| 22 | The Religion of the Greeks and Romans | ia CDL, libgen 0 (есть open-скан ИСПАНСКОГО перевода) |
## Cross-section
01→sec01#05, 02→sec02#06, 03→sec01#32, 05→sec03#09, 06→sec01#15, 11→sec03#20 (RU-дыра).
## Notes
- 2026-09-25: libgen EN-батч (26 f_id) → precheck отклонил 24 (системный mislink bulk-import 2021:
«Crop Plant», «Русское фортепианное трио», «Морис Равель», «Ми-2», китайские книги и т.д.).
Отобраны: Perera (3301655) + 4 RU (Otto/Kerényi/Schimmel×2). Отвергнутые f_id: 5166353, 92753381,
92651656, 92617180, 92617181, 92761249, 96221294, 101184677, 101198513, 92657205, 92709688,
97644847, 106625804, 91135572, 106983766, 115176858, 101289370, 101462809, 92650375, 2215280,
93377273, 91229240 + 2 «прошедших precheck» комикса (91077147, 91091400 — отклонены контент-верификацией).
**Урок: precheck OK ≠ верный файл (cbz/epub-комиксы пролезали); контент-верификация обязательна.**
- **2026-09-25 (КЛЮЧЕВОЙ): key-vs-f_id находка (указал пользователь).** В JSON-карточке издания
`files` = `{public_key: {f_id: X, md5: Y}}` — КЕЙ и f_id-ЗНАЧЕНИЕ = РАЗНЫЕ файловые записи.
`object=f&ids=<key>` возвращает устаревший/чужой файл (Solomon: key 92709688 = 20MB рус. антология;
f_id 93253044 = настоящая 2MB-книга). «24 mislinked» из утреннего батча — НЕ libgen-mislink:
качали по key. Скачав по f_id-значениям — rescues: 09-t1, 13, 14, 17, 19, 20, 23 (6 книг)
+ 4 бэкапа (12, 16, 24, 25). Все контент-верифицированы. Правило: качать/пречекать ТОЛЬКО по
f_id-значению; precheck по key бессмысленен.
- 2026-09-25: утренний precheck-батч (26 f_id, key-варианты) → 24 BAD. Тогда вывод «системный
mislink bulk-import 2021» — ОШИБОЧНЫЙ (см. выше). Реальные mislinkи-файлы по key — правда,
но целевые файлы по f_id — на месте.
- 2026-09-25: ia-паттерн: `*0000*`-сканы = CDL (401 на download, HEAD тоже 401 — проверять GET range
или metadata `access-restricted-item`); user-upload = open. 9 EN-файлов скачано с ia, все
контент-верифицированы (первая страница/TOC).
- lg.py теперь ищет по objects[]=f,e,s,a,p,w + topics[] — файл-уровневый поиск находит файлы,
не привязанные к «нашему» изданию (так найден md5 Solomon).

View file

@ -29,4 +29,4 @@
- flib: b/686311 (т.1-3, htm), b/122503 (т.1 fb2), b/640158 (т.1 pdf), b/860620 (т.2 fb2), b/123000 (т.3 fb2).
- RU translated from French (not EN original). Двойник A.2=A.3 консолидирован сюда.
Downloads (2026-09-25): RU 3 fb2 (flib b/122503, b/860620, b/123000) + scan-фрагмент (flib b/640158); EN t2 1 pdf (ia mircea-eliade-a-history-of-religious-ideas-volume-2). EN t1/t3: CDL-only. MANIFEST: ../../downloads/06-religion/MANIFEST.md
Downloads (2026-09-25): RU 3 fb2 (flib b/122503, b/860620, b/123000) + scan-фрагмент (flib b/640158); EN t2 1 pdf (ia mircea-eliade-a-history-of-religious-ideas-volume-2) + EN **t1 1 epub (lg f/93168103, UCP 1978, tr. Trask — key-vs-f_id rescue)**. EN t3: CDL-only. MANIFEST: ../../downloads/06-religion/MANIFEST.md

View file

@ -26,4 +26,4 @@
- Wiki anchor: Q76748; RU name canonical = «Рудольф Отто» (ru label). Не путать с Walter Otto (досье otto-walter.md).
Downloads (2026-09-25): RU 1 djvu (lg f/91429639, СПбГУ 2008); EN 1 pdf (ia rudolf-otto-the-idea-of-the-holy-2, Oxford-скан 260 стр.). MANIFEST: ../../downloads/06-religion/MANIFEST.md
Downloads (2026-09-25): RU 1 djvu (lg f/91429639, СПбГУ 2008); EN 2 (ia Oxford-скан 260 стр. + lg f/101019653 epub, Harvey tr.). MANIFEST: ../../downloads/06-religion/MANIFEST.md

View file

@ -22,6 +22,12 @@
chitai-gorod: product 2929597 (Год 2022, Касталия, пер. Ветринский И., ISBN 978-5-521-18582-5)
## Downloads
| lang | file | size | source |
|------|------|------|--------|
| EN | 13-schweizer-sungod-en.pdf | 15 MB | lg f/93205766 (key-vs-f_id rescue 2026-09-25; 247 pp, Cornell 2010) |
## Notes
- **RESCUE (2026-09-24, user oracle):** chitai-gorod 2929597 + OZON 647372588 + castalia.ru

View file

@ -15,6 +15,12 @@
— нет (verified 2026-09-24, gate: MISSING.md §14)
## Downloads
| lang | file | size | source |
|------|------|------|--------|
| EN | 14-solomon-self-transformation-en-2007.pdf | 2.1 MB | lg f/93253044 (key-vs-f_id rescue 2026-09-25; 353 pp, Karnac 2007) |
## Notes
- Solomon H.M. = Hester McFarland Solomon (OL/Crossref). RSL/filib = 0 (2026-09-24).

View file

@ -24,4 +24,4 @@
Касталия, 978-5-521-18620-4 (castalia.ru/product/tvoryaschee-voobrazhenie-v-sufizme-ibn-arabi),
НО это *Creative Imagination in the Sufism of Ibn 'Arabi* (1969, вступление + 2 эссе),
а НЕ *Alone with the Alone* (1998, подборка мистической прозы Ибн Араби). Item остаётся ❌.
Downloads (2026-09-25): EN 1 pdf (ia HenryCorbinAloneWithTheAlone, Princeton 1998, 435 стр.). MANIFEST: ../../downloads/06-religion/MANIFEST.md
Downloads (2026-09-25): EN 2 (ia Princeton 1998, 435 стр. + lg f/97917289 pdf, Bollingen XCI 444 стр.). MANIFEST: ../../downloads/06-religion/MANIFEST.md

View file

@ -22,6 +22,12 @@
livelib: book 1002608123 (Клуб Касталия, 2016, 386 стр., 18+)
nikbook: product/edinger-ef-bog-i-bessoznatelnoe-...
## Downloads
| lang | file | size | source |
|------|------|------|--------|
| EN | 17-edinger-god-image-en.epub | 544 KB | lg f/91722137 (key-vs-f_id rescue 2026-09-25; scan-epub, Inner Light 1992) |
## Notes
- **RESCUE (2026-09-24, user oracle):** nikbook + livelib 1002608123.

View file

@ -15,6 +15,12 @@
— нет (verified 2026-09-24, gate: MISSING.md §19)
## Downloads
| lang | file | size | source |
|------|------|------|--------|
| EN | 19-hornung-conceptions-en.pdf | 16.5 MB | lg f/106935291 (key-vs-f_id rescue 2026-09-25; 304 pp, UNC 1982) |
## Notes
- RSL «Хорнунг» = только омонимы (Клаус, Вальтер, Эрнест Уильям); «Хорнунг Египет» = 0; flib a/207723 «Хорнунг Эрик» — чужие книги (Абт) (2026-09-24).

View file

@ -27,4 +27,4 @@
- RU имя: **Клюгер** (не «КлуGER»/«КлуGER»!) — исправлено после rescue.
- РГБ: «Клюгер» → «Архетипическое значение Гильгамеша» Касталия 2018, 978-5-519-65573-6, пер. И. Ерзин (другая книга).
Downloads (2026-09-25): RU 1 fb2 (flib b/524157, ИНФРА-М 2000). EN: CDL-only. MANIFEST: ../../downloads/06-religion/MANIFEST.md
Downloads (2026-09-25): RU 1 fb2 (flib b/524157, ИНФРА-М 2000) + EN 1 epub (lg f/91762623, key-vs-f_id rescue; scan, Inner Light 1995). MANIFEST: ../../downloads/06-religion/MANIFEST.md

View file

@ -26,4 +26,4 @@
- Не путать с W. Otto «Дионис» (sec03 #34). Princeton 1996 = reprint того же сочинения.
Downloads (2026-09-25): RU 1 djvu (lg f/92321117, Ладомир 2007) + DE-оригинал 1 pdf (lg f/91385548, DTV 1956). EN: CDL-only. MANIFEST: ../../downloads/06-religion/MANIFEST.md
Downloads (2026-09-25): RU 1 djvu (lg f/92321117, Ладомир 2007) + DE-оригинал 1 pdf (lg f/91385548, DTV 1956) + EN 1 pdf (lg f/113610602, key-vs-f_id rescue; Bollingen LXV/2 Princeton 1976, 608 pp). MANIFEST: ../../downloads/06-religion/MANIFEST.md

View file

@ -26,4 +26,4 @@
- Wiki anchor: Q432994 (ru label отсутствует — кириллица из RSL).
Downloads (2026-09-25): RU 1 fb2 (flib b/662900, Эксмо 2018); EN 1 pdf (ia, 1383 стр., расшир. изд.). MANIFEST: ../../downloads/06-religion/MANIFEST.md
Downloads (2026-09-25): RU 1 fb2 (flib b/662900, Эксмо 2018); EN 2 (ia, 1383 стр., расшир. изд. + lg f/101124346 epub, Viking 2009). MANIFEST: ../../downloads/06-religion/MANIFEST.md

View file

@ -22,4 +22,4 @@
- Wiki anchor: Q75860; ru label «Аннемари Шиммель».
Downloads (2026-09-25): RU 2 (lg f/92533199 djvu 1999, lg f/92426973 pdf Садра 2012); EN 1 pdf (ia x-mystical-dimensions-of-islam, UNC). MANIFEST: ../../downloads/06-religion/MANIFEST.md
Downloads (2026-09-25): RU 2 (lg f/92533199 djvu 1999, lg f/92426973 pdf Садра 2012); EN 2 (ia x-mystical-dimensions-of-islam UNC 525 стр. + lg f/93199017 pdf 543 стр.). MANIFEST: ../../downloads/06-religion/MANIFEST.md

View file

@ -15,27 +15,27 @@
| 06 | Archetypal Dimensions of the Psyche (von Franz) | ⚠ 978-0-8348-2978-7 | «Архетипические измерения психики» | ⚠ 978-5-17-100740 | sec01: 2 epub | sec01: 1 fb2 |
| 07 | The Passion of Perpetua (von Franz) | ⚠ 978-0-8348-1545-4 | — нет | ❌ | — (CDL) | — (absent) |
| 08 | Niklaus von Flüe and Saint Perpetua (von Franz) | ⚠ 978-3-03876-251-4 | «…Никлаус из Флюэ и св. Перпетуа» (Акад. проект/Касталия) | ⚠ 978-5-519-60645 | — (absent) | — (paid) |
| 09 | History of Religious Ideas, 3 vols (Eliade) | ⚠ 978-0-226-20401-7 (t1) | «История веры и религиозных идей» в 3 т. (Акад. проект 2008-09) | ⚠ 978-5-8291-1141 | 1 pdf (t2) | 3 fb2 + 1 scan-фрагм. |
| 09 | History of Religious Ideas, 3 vols (Eliade) | ⚠ 978-0-226-20401-7 (t1) | «История веры и религиозных идей» в 3 т. (Акад. проект 2008-09) | ⚠ 978-5-8291-1141 | 2 (t1 epub + t2 pdf) | 3 fb2 + 1 scan-фрагм. |
| 10 | The Jung-White Letters (Lammers) | ⚠ 978-0-8276-0881-7 | «Переписка. Юнг и Уайт» (Клуб Касталия) | 978-5-521-16231-4 | — (absent) | — (paid) |
| 11 | Amor and Psyche (Neumann) | ⚠ 978-0-395-05925-0 | «Амур и Психея. Любовь и её противоположности» (МИФ 2024) | 978-5-00214-519-5 | sec03: 1 epub + 1 pdf | — (paid/нет free) |
| 12 | The Idea of the Holy (Otto) | ⚠ 978-0-19-283720-1 | «Священное» (СПбГУ 2008) | ⚠ 978-5-288-04560 | 1 pdf | 1 djvu |
| 13 | The Sungod's Journey (Schweizer) | ⚠ 978-0-8014-4875-0 | «Путь Ра через Дуат» (Касталия 2022) | 978-5-521-18582-5 | — (CDL) | — (paid) |
| 14 | The Self in Transformation (Solomon) | ⚠ 978-1-84940-923-7 | — нет | ❌ | — (CDL) | — (absent) |
| 12 | The Idea of the Holy (Otto) | ⚠ 978-0-19-283720-1 | «Священное» (СПбГУ 2008) | ⚠ 978-5-288-04560 | 2 (pdf+epub) | 1 djvu |
| 13 | The Sungod's Journey (Schweizer) | ⚠ 978-0-8014-4875-0 | «Путь Ра через Дуат» (Касталия 2022) | 978-5-521-18582-5 | 1 pdf | — (paid) |
| 14 | The Self in Transformation (Solomon) | ⚠ 978-1-84940-923-7 | — нет | ❌ | 1 pdf | — (absent) |
| 15 | Jung's Treatment of Christianity (Stein) | ⚠ 978-0-88141-028-8 | — нет | ❌ | — (CDL) | — (absent) |
| 16 | Alone with the Alone (Corbin) | ⚠ 978-0-691-05834-4 | — нет (только «Творящее воображение») | ❌ | 1 pdf | — (absent) |
| 17 | The Transformation of the God-Image (Edinger) | ⚠ 978-0-919123-55-7 | «Бог и бессознательное» (Клуб Касталия 2016) | ⚠ 978-5-906815-56 | — (CDL) | — (paid) |
| 16 | Alone with the Alone (Corbin) | ⚠ 978-0-691-05834-4 | — нет (только «Творящее воображение») | ❌ | 2 pdf | — (absent) |
| 17 | The Transformation of the God-Image (Edinger) | ⚠ 978-0-919123-55-7 | «Бог и бессознательное» (Клуб Касталия 2016) | ⚠ 978-5-906815-56 | 1 epub | — (paid) |
| 18 | Descent to the Goddess (Perera) | ⚠ 978-0-919123-05-8 | «Нисхождение к богине» (Касталия 2024) | 978-5-521-24012-8 | 1 epub | — (paid) |
| 19 | Conceptions of God in Ancient Egypt (Hornung) | ⚠ 978-0-8014-1234-8 | — нет | ❌ | — (CDL) | — (absent) |
| 20 | Psyche in Scripture (Klüger) | ⚠ 978-0-919123-71-7 | «Глубинная психология в священном писании» (ИНФРА-М 2000) | — | — (CDL) | 1 fb2 |
| 19 | Conceptions of God in Ancient Egypt (Hornung) | ⚠ 978-0-8014-1234-8 | — нет | ❌ | 1 pdf | — (absent) |
| 20 | Psyche in Scripture (Klüger) | ⚠ 978-0-919123-71-7 | «Глубинная психология в священном писании» (ИНФРА-М 2000) | — | 1 epub | 1 fb2 |
| 21 | Satan in the Old Testament (Klüger) | ⚠ 978-0-226-33909-0 | «Сатана в Ветхом Завете» (Касталия 2018) | ⚠ | — (CDL) | — (paid) |
| 22 | The Religion of the Greeks and Romans (Kerényi) | ⚠ 978-0-8014-9020-5 | — нет | ❌ | — (CDL) | — (absent) |
| 23 | Dionysos (Kerényi) | ⚠ 978-0-691-21410-8 | «Дионис. Прообраз неиссякаемой жизни» (ВРС/Ладомир 2007) | ⚠ 978-5-94451-044 | 1 pdf (DE 1956) | 1 djvu |
| 24 | Christianity: The First Three Thousand Years (MacCulloch) | ⚠ 978-0-14-303715-7 | «Христианство. Три тысячи лет» (Эксмо 2018) | 978-5-04-094971-7 | 1 pdf | 1 fb2 |
| 25 | Mystical Dimensions of Islam (Schimmel) | ⚠ 978-0-8078-1416-6 | «Мир исламского мистицизма» (Садра 2012 / 1999) | 978-5-906016-04-1 | 1 pdf | 1 djvu + 1 pdf |
| 26 | Major Trends in Jewish Mysticism (Scholem) | ⚠ 978-0-8052-0991-8 | «Основные течения в еврейской мистике» (Мосты 2004; 4 изд. 1984-2016) | ⚠ 978-5-93273-437 | 1 pdf | 1 fb2 |
| 23 | Dionysos (Kerényi) | ⚠ 978-0-691-21410-8 | «Дионис. Прообраз неиссякаемой жизни» (ВРС/Ладомир 2007) | ⚠ 978-5-94451-044 | 1 pdf + DE 1 pdf | 1 djvu |
| 24 | Christianity: The First Three Thousand Years (MacCulloch) | ⚠ 978-0-14-303715-7 | «Христианство. Три тысячи лет» (Эксмо 2018) | 978-5-04-094971-7 | 2 (pdf+epub) | 1 fb2 |
| 25 | Mystical Dimensions of Islam (Schimmel) | ⚠ 978-0-8078-1416-6 | «Мир исламского мистицизма» (Садра 2012 / 1999) | 978-5-906016-04-1 | 2 pdf | 1 djvu + 1 pdf |
| 26 | Major Trends in Jewish Mysticism (Scholem) | ⚠ 978-0-8052-0991-8 | «Основные течения в еврейской мистике» (Мосты 2004; 4 изд. 1984-2016) | ⚠ 978-5-93273-437 | 2 (pdf+epub) | 1 fb2 |
| 27 | An Introduction to Zen Buddhism (Suzuki) | ⚠ 978-0-8014-9056-4 | «Введение в дзэн-буддизм» | ⚠ | 1 pdf | 1 fb2 |
| 28 | Philosophies of India (Zimmer) | ⚠ 978-0-471-92568-9 | — нет | ❌ | 1 pdf | — (absent) |
| | **totals** | | | | **12 + 5 sec-refs** | **13 + 7 sec-refs** |
| | **totals** | | | | **21 + 5 sec-refs (+1 DE)** | **13 + 7 sec-refs** |
Legend: ✅ = ISBN found · ⚠ = published but no ISBN recorded on card (ISAP-список без ISBN,
наша EN-карточка без валидированного ISBN) · ❌ = no such edition (verified) · — = n/a.
@ -71,9 +71,11 @@ DL: files in `downloads/06-religion/` (MANIFEST.md) + cross-section refs.
- 2026-09-24: секция пройдена (Phase 0-2c): 28 карточек, 7 rescues от user oracle, бонусный фикс
sec03 #65 (Klüger Gilgamesh Касталия 2018 → sec03 = 39✅/29❌).
- 2026-09-24: Касталия-каталог (1285) в rutitles DB; gate v3 + castalia-rule в AGENTS.md.
- 2026-09-25: downloads финальны (MANIFEST.md). RU платные (castalia PDF 1190 ₽) — не скачивались
по правилу пользователя. EN: libgen батч почти весь mislinked (precheck + контент-верификация
отклонили 24/26); 9 EN-файлов взяты с archive.org (open user-uploads), все верифицированы.
- 2026-09-25: downloads: RU платные (castalia PDF 1190 ₽) — не скачивались по правилу пользователя.
EN: 9 файлов с archive.org (open user-uploads) + **12 файлов с libgen после находки key-vs-f_id**
(rescues: 09-t1, 13, 14, 17, 19, 20, 23 + бэкапы 12, 16, 24, 25, 26): «24 mislinked» из утреннего
батча были артефактом загрузки по КЕЮ files-мапы вместо f_id-значения — целевые файлы были на месте.
Все 21 EN-файл контент-верифицированы.
- 2026-09-25: sec03 #20 (Amor and Psyche) — RU-дыра: МИФ 2024 «Амур и Психея» найден (RSL, ISBN
978-5-00214-519-5), free-файла нет (flib/libgen 0) — пометить в sec03 MANIFEST.
- 2026-09-25: #23 — в libgen под RU-изданием 2007 оказался Немецкий оригинал (Dionysos: Urbild 1956,

View file

@ -33,10 +33,14 @@ def fetch(url, tries=3):
def main():
q = sys.argv[1]
limit = int(sys.argv[2]) if len(sys.argv) > 2 else 10
url = "https://libgen.vg/index.php?" + urllib.parse.urlencode({
"req": q, "res": "100", "dlt": "0", "ln": "0",
"columns[]": ["t","a","s","y","p","i","l","x","sz"]
})
# objects[] MUST include 'f' (files): editions-only search misses files that
# exist in libgen but are not linked to the right edition (verified 2026-09-25:
# Solomon "Self in Transformation" found by file search, missing in edition search).
params = {"req": q, "res": "100"}
params["columns[]"] = ["t","a","s","y","p","i"]
params["objects[]"] = ["f","e","s","a","p","w"]
params["topics[]"] = ["l","c","f","a","m","r","s"]
url = "https://libgen.vg/index.php?" + urllib.parse.urlencode(params, doseq=True)
html = fetch(url)
# pagination hint
m = re.search(r'page=(\d+)', html)
@ -52,8 +56,11 @@ def main():
if len(tds) < 6:
continue
# first cell is usually a link with id, title is the big cell
title = max(tds, key=len) if tds else ""
line = " | ".join(tds[:9])
# file rows: surface the md5 (ads.php link) — feed to tools/lgdl.py bymd5
md5s = re.findall(r'ads\.php\?md5=([0-9a-f]{32})', r)
if md5s:
line += f" [md5={md5s[0]}]"
print(line[:300])
count += 1
if count >= limit:

View file

@ -16,11 +16,16 @@ Usage:
tools/lgdl.py precheck <file_id> <edition_id> [expected_pages]
precheck (no download, ~2 libgen calls): file record vs the target edition.
RED (exit 2) — reverse-map `editions` non-empty and does NOT contain the
target edition (file belongs to another book), or locator path is a
foreign-language batch (spa/English/fiction) for a Cyrillic book.
YELLOW(exit 1) — reverse map empty, or size implausible vs expected pages.
OK (exit 0) — reverse map matches target, or empty with plausible locator.
The ONLY reliable ownership signal is the file `locator` (the importer's
original Windows path — it names the real book). libgen's `file.editions`
reverse-map uses internal IDs that do NOT resolve via object=e (they return
unrelated books), so it is logged as a hint but never gates the verdict.
RED (exit 2) — locator non-empty and shares NO content word with the target
title/author (locator names a different book), or a foreign-language
batch path for a Cyrillic target.
OK (exit 0) — locator non-empty and shares content words with the target.
SUSPECT(exit 1) — locator empty (no signal), too few target tokens to judge,
or size implausible vs expected pages. ALWAYS post-verify content.
`dl` with the optional 4th arg runs precheck first and aborts on RED.
Verification on dl: final size must equal libgen filesize; magic-byte sniff
@ -212,64 +217,100 @@ def download(f_id, out_dir, name, tries=16):
return None
# stop-ish / generic tokens to ignore when matching locator vs target
_STOP = set("the of and in to a an for with from on by edition new second first "
"vol volume pdf epub fb2 doc djvu mobi txt part pt series book "
"translated translation revised updated complete full original"
.split())
def _tokens(s):
return {w for w in re.findall(r"[a-z\u0400-\u04ff]{4,}", (s or "").lower())
if w not in _STOP}
def _loc_tokens(s):
# locator words: mask alphanumeric runs containing digits (IDs/hashes/ISBNs)
# so "d1e2f4...aaae..." does not yield fake word 'aaae'
masked = re.sub(r"[a-z0-9]+\d[a-z0-9]*", " ", (s or "").lower())
return _tokens(masked)
def precheck(f_id, e_id, expected_pages=None):
"""Mislinked-file gate. Returns 0=OK, 1=SUSPECT, 2=BAD (see module doc)."""
"""Mislinked-file gate. Returns 0=OK, 1=SUSPECT, 2=BAD (see module doc).
CRITICAL: pass the edition files-map VALUE (`f_id`), not the map key —
the key is a different (often stale/mislinked) file record (verified
2026-09-25: Solomon — key 92709688 = Russian book, f_id 93253044 = real book).
Signals:
1) reverse map: for a real f_id record the `editions` values ARE the public
edition IDs — value == target is a strong OK signal; for a key's record
it contains other numbers (no match => weak negative, never hard BAD).
2) locator: words in the locator vs target title/author words.
- no content words (hash/ISBN/number) => no signal (SUSPECT)
- >=2 shared words (or 1 for a short target) => OK
- words present, none shared => BAD (names a different book)
ALWAYS content-verify after download (ground truth).
"""
fi = file_info(f_id)
time.sleep(2)
ext, size = fi.get("extension"), int(fi.get("filesize") or 0)
locator = fi.get("locator") or ""
rev = {eid: int(x.get("e_id") or 0) for eid, x in (fi.get("editions") or {}).items()}
rev = {k: v for k, v in rev.items() if v}
verdict, reasons = "OK", []
locator = (fi.get("locator") or "").strip()
reasons = []
# 1) reverse map: who does this file BELONG to?
rev_match = None
rev = {k: v.get("e_id") for k, v in (fi.get("editions") or {}).items()}
rev_match = int(e_id) in {int(v) for v in rev.values() if v}
if rev:
if int(e_id) in rev.values():
rev_match = True
reasons.append(f"reverse-map matches target e_id {e_id}")
else:
verdict = "BAD"
owners = []
for owner_eid in set(rev.values()):
try:
oe = jget(f"json.php?object=e&addkeys=title,author,year&ids={owner_eid}")
o = oe.get(str(owner_eid), {})
owners.append(f"e_id {owner_eid} «{o.get('title')}» {o.get('author')} {o.get('year')}")
time.sleep(2)
except Exception:
owners.append(f"e_id {owner_eid} (?)")
reasons.append("reverse-map points to ANOTHER edition: " + "; ".join(owners))
reasons.append(f"reverse-map: {rev} {'MATCHES target' if rev_match else '(no target)'}")
try:
ed = jget(f"json.php?object=e&addkeys=title,author&ids={e_id}").get(str(e_id), {})
time.sleep(2)
target = f"{ed.get('title','')} {ed.get('author','')}"
except Exception:
target = ""
t_tok, l_tok = _tokens(target), _loc_tokens(locator)
shared = t_tok & l_tok
if not locator or not l_tok:
loc_signal = "none"
reasons.append(f"locator has no content words (hash/ISBN/empty) — no signal: {locator[:90]}")
elif len(shared) >= 2 or (len(shared) == 1 and len(t_tok) <= 3):
loc_signal = "match"
reasons.append(f"locator names the target (shared: {sorted(shared)}): {locator[:120]}")
else:
rev_match = False
verdict = "SUSPECT" if verdict == "OK" else verdict
reasons.append("reverse-map EMPTY (old file) — rely on locator + post-verify")
# 2) locator: foreign-language batch path. Only meaningful when the reverse
# map does NOT confirm the target (matching map = the edition itself comes
# from that batch — an origin note, not a mislink).
low = locator.lower()
foreign = re.search(r"(spa\\|spanish|english|epublibre|0day|\\fiction\\)", low)
cyrillic = re.search(r"[\u0400-\u04FF]", locator)
if locator and foreign and not cyrillic:
if rev_match is True:
reasons.append(f"origin note: edition comes from a foreign batch: {locator[:120]}")
loc_signal = "mismatch"
low = locator.lower()
target_cyr = re.search(r"[\u0400-\u04FF]", target)
cyrillic_loc = re.search(r"[\u0400-\u04FF]", locator)
foreign = re.search(r"(spa\\|spanish|english|epublibre|0day|\\fiction\\)", low)
if target_cyr and not cyrillic_loc:
reasons.append(f"Cyrillic target but locator is non-Cyrillic: {locator[:120]}")
elif foreign:
reasons.append(f"locator is a foreign batch naming another book: {locator[:120]}")
else:
verdict = "BAD" if verdict == "OK" else verdict
reasons.append(f"locator is a foreign batch path: {locator[:120]}")
elif locator and rev_match is not True:
reasons.append(f"locator ok: {locator[:120]}")
reasons.append(f"locator names a DIFFERENT book (no shared words): {locator[:120]}")
# 3) size sanity vs expected pages (text formats are tiny: ~200B/pp;
# scans: 50KB..15MB/pp)
if rev_match and loc_signal != "mismatch":
verdict = "OK"
elif loc_signal == "match":
verdict = "OK"
elif loc_signal == "mismatch" and not rev_match:
verdict = "BAD"
else:
verdict = "SUSPECT" # none/none, or contradiction (rev match vs locator mismatch)
if rev_match and loc_signal == "mismatch":
reasons.append("CONTRADICTION: reverse-map matches but locator names another book — verify content")
# size sanity vs expected pages (text ~200B/pp; scans 50KB..15MB/pp)
if expected_pages and size:
per_lo = 200 if ext in ("fb2", "epub", "txt", "html") else 10_000
lo, hi = expected_pages * per_lo, expected_pages * 15_000_000
if size < lo:
verdict = "SUSPECT" if verdict == "OK" else verdict
if verdict == "OK":
verdict = "SUSPECT"
reasons.append(f"size {size}b < {lo}b for ~{expected_pages} pp (too small — fragment?)")
elif size > hi:
verdict = "SUSPECT" if verdict == "OK" else verdict
if verdict == "OK":
verdict = "SUSPECT"
reasons.append(f"size {size}b > {hi}b for ~{expected_pages} pp (too big — scan mismatch?)")
print(f"precheck f_id={f_id} vs e_id={e_id}: {verdict} [{ext}, {size}b]")
@ -308,6 +349,17 @@ def main():
sys.exit(precheck(f_id, e_id, pages))
elif cmd == "md5":
print(file_info(sys.argv[2])["md5"])
elif cmd == "bymd5":
# md5 -> f_id + metadata (for files found via lg.py file search)
d = jget(f"json.php?object=f&addkeys=*&md5={sys.argv[2]}")
if not d:
print("not found"); sys.exit(1)
fid = list(d.keys())[0]
f = d[fid]
print(f"f_id={fid} {f.get('extension')} {int(f.get('filesize') or 0)}b pages={f.get('pages')} ocr={f.get('ocr')} added={f.get('time_added')}")
print(f"locator: {f.get('locator','')}")
rev = {k: v.get('e_id') for k, v in (f.get('editions') or {}).items()}
if rev: print(f"editions (hint): {rev}")
else:
sys.exit(__doc__)