ADS.md: per-site spot inventory (8161 mapping) + 1thumb_a-f single-banner pattern + migration checklist (videojs4 → PlayerJS+ad-bundle, 30+ checkpoints)
This commit is contained in:
105
docs/ADS.md
105
docs/ADS.md
@@ -139,6 +139,111 @@ ASG керує цими SDK runtime-no — ми бачимо тільки iframe
|
|||||||
|
|
||||||
⚠️ **Не забути `layout.etlua` cooldown regex** — окрема hardcoded reference на popunder spot ID (для localStorage `asgsl` cookie matching).
|
⚠️ **Не забути `layout.etlua` cooldown regex** — окрема hardcoded reference на popunder spot ID (для localStorage `asgsl` cookie matching).
|
||||||
|
|
||||||
|
### Native 1thumb_a..f — single-banner-per-thumb pattern
|
||||||
|
|
||||||
|
`views/modules/banners/native_allpg_1thumb_{a,b,c,d,e,f}.etlua` — **6 окремих banner модулів**, кожен:
|
||||||
|
- ОДИН `<div id="thmb<N>">` (унікальний DOM ID `#thmb1` … `#thmb6`)
|
||||||
|
- ОДИН spot URL `//a5.g--o.info/api/spots/<id>?p=1`
|
||||||
|
- script `tb.load_frame_baner_v2(spotURL, "#thmb<N>", ...)` injects iframe всередину
|
||||||
|
|
||||||
|
**Призначення:** заміняти thumbnail у grid-листингах (`cat_list_thumb`, `video.etlua`, `related_video`, `recommended_video`) на native banner imp що виглядає як thumb.
|
||||||
|
|
||||||
|
**Render умова:** if `i == 8 and not isMobile()` (desktop) **OR** `i == 5 and isMobile()` (mobile) — позиція у grid де banner injects.
|
||||||
|
|
||||||
|
⚠️ **Унікальність DOM ID per page:** один render = один module = один `#thmbN`. Якщо рендериш 1thumb_a у двох різних модулях (наприклад related_video AND recommended_video) на одній сторінці — отримаєш **DUPLICATE `#thmb1`** (HTML5 violation, ad iframe injects only into first match). Fix: використовуй РІЗНІ модулі (`1thumb_a` + `1thumb_b`) у різних блоках.
|
||||||
|
|
||||||
|
### Per-site spot inventory
|
||||||
|
|
||||||
|
#### 8148 (xn--3dsq7teoyo9d.com — pilot site)
|
||||||
|
|
||||||
|
Канонічний reference. Spot IDs у git history; перелік типів — у matrix вище.
|
||||||
|
|
||||||
|
#### 8161 (adultmovz.com)
|
||||||
|
|
||||||
|
Migrated 2026-05-03 (videojs4 → PlayerJS+ad-bundle). URL pattern `/v-arch/`.
|
||||||
|
|
||||||
|
| Spot ID | Тип | DOM target | File |
|
||||||
|
|---------|-----|------------|------|
|
||||||
|
| **514125** | popunder | — | `static/js/ad-config.js` + cooldown regex у `layout.etlua` |
|
||||||
|
| **514120** | VAST in-video | `pjs_play_btn` click | `static/js/ad-config.js` |
|
||||||
|
| 514116 | desktop footer A | `#da_a` | `modules/banners/footer_descktop_adspy.etlua` |
|
||||||
|
| 514117 | desktop footer B | `#da_b` | same |
|
||||||
|
| 514118 | desktop footer C | `#da_c` | same |
|
||||||
|
| 514119 | desktop footer D | `#da_d` | same |
|
||||||
|
| 514123 | mobile header | `#hdm` | `modules/banners/header_mobile_adspy.etlua` |
|
||||||
|
| 514124 | mobile footer | `#ftm` | `modules/banners/footer_mobile_adspy.etlua` |
|
||||||
|
| 514138 | mobile middle | `#mdm` | `modules/banners/middle_mobile_adspy.etlua` |
|
||||||
|
| 514121 | desktop sidebar A | `#sdd_a` | `modules/banners/embed_sidebar_adspy.etlua` |
|
||||||
|
| 514122 | desktop sidebar B | `#sdd_b` | same |
|
||||||
|
| 514139 | mobile sidebar A | `#dsd_a` | `modules/banners/embed_mobile_sidebar_adspy.etlua` |
|
||||||
|
| 514140 | mobile sidebar B | `#dsd_b` | same |
|
||||||
|
| 514295 | native desktop allpg | `#tbn1` | `modules/banners/native_allpg_desktop_adspy.etlua` |
|
||||||
|
| 514297 | native mobile allpg | `#tbn2` | `modules/banners/native_allpg_mobile_adspy.etlua` |
|
||||||
|
| 514296 | native embed | `#tbn3` | `modules/banners/native_embed_adspy.etlua` |
|
||||||
|
| 514371 | native 1thumb A | `#thmb1` | `modules/banners/native_allpg_1thumb_a.etlua` (use: related_video, cat_list_thumb, video) |
|
||||||
|
| 514372 | native 1thumb B | `#thmb2` | `1thumb_b.etlua` (use: recommended_video, cat_list_thumb, video) |
|
||||||
|
| 514373 | native 1thumb C | `#thmb3` | `1thumb_c.etlua` (cat_list_thumb, video) |
|
||||||
|
| 514374 | native 1thumb D | `#thmb4` | `1thumb_d.etlua` (cat_list_thumb, video) |
|
||||||
|
| 514375 | native 1thumb E | `#thmb5` | `1thumb_e.etlua` (cat_list_thumb, video) |
|
||||||
|
| 514376 | native 1thumb F | `#thmb6` | `1thumb_f.etlua` (cat_list_thumb, video) |
|
||||||
|
|
||||||
|
## Migration checklist — legacy (videojs4) → modern (PlayerJS + ad-bundle)
|
||||||
|
|
||||||
|
Контрольні чекпоінти при міграції наступного site (template після 8148/8161 досвіду). Кожен ✓ — окремий atomic commit.
|
||||||
|
|
||||||
|
### Pre-flight
|
||||||
|
- [ ] **Identify URL pattern.** `/v/` (default), `/v-arch/`, `/video/`, etc. Це йде у `ad-bootstrap.js` path checks (2 occurrences) і у тестових URL-ах.
|
||||||
|
- [ ] **Get spot IDs from ASG admin.** Мінімум 16 spots (popunder + VAST + 4 desktop footer + 1 mobile header + 1 mobile footer + 1 mobile middle + 2 desktop sidebar + 2 mobile sidebar + 3 native + опціонально 6 1thumb_a-f). Записати mapping.
|
||||||
|
- [ ] **Verify ASG spot config:** **frequency capping ENABLED** на popunder + VAST (інакше cooldown поломається — див. `## ⚠️ ASG spot config gotcha` вище).
|
||||||
|
|
||||||
|
### Banner modules
|
||||||
|
- [ ] **Replace banner spot IDs** у всіх `views/modules/banners/*adspy*.etlua` + `1thumb_*.etlua` (per inventory). Sed-batch friendly.
|
||||||
|
- [ ] **Verify zero stale IDs** після replace: `grep -r '<old_id>' views/` повинен returnати empty (test/comments OK).
|
||||||
|
|
||||||
|
### JS bundle (port from 8148)
|
||||||
|
- [ ] **Copy 5 source files** → `views/static/js/`: `ad-config.js`, `ad-bootstrap.js`, `ad-core.js`, `ad-mute.js`, `vast-preroll.js` + `build-ad-bundle.sh`.
|
||||||
|
- [ ] **Edit `ad-config.js`:** set `popunder.spot`, `vast.spot`, `_adConfigBuildId` (унікальний marker для cache-bust verify).
|
||||||
|
- [ ] **Edit `ad-bootstrap.js`:** додати site URL pattern до **обох** path checks (HUD interval + `_adCtx` init), напр. `||location.pathname.indexOf('/v-arch/')===0`.
|
||||||
|
- [ ] **Build bundle:** `bash views/static/js/build-ad-bundle.sh` (concat + terser).
|
||||||
|
|
||||||
|
### layout.etlua
|
||||||
|
- [ ] **Add `class="no-js"` на `<html>`** + inline script `<head>` swap до `.js` (для iOS Safari `.js .vi-limiter video::-webkit-media-controls{display:none}` selector).
|
||||||
|
- [ ] **Add `<link rel="preconnect" href="https://a5.g--o.info" crossorigin>`.**
|
||||||
|
- [ ] **Add `_adSel` inline config** у `mysettings.location_css == "id"` block з selector mapping (native classes — `vi-limiter` у 8161, `vdo-blk-lmtr` у 8148).
|
||||||
|
- [ ] **Tabunder pre-detect script** з popunder spot ID regex `(?:^|\|)<popunder_id>=` (синхронізовано з ad-config!).
|
||||||
|
- [ ] **`<script src="/static/js/ad-bundle.min.js?v=<md5>" defer></script>`** з cache-bust md5.
|
||||||
|
- [ ] **Inline `lazyLoadFunc` definition** (з `views/static/js/lazysizes.min.js` content) ПІСЛЯ inline lazysizes core block — інакше `timeline-pjs.min.js` кине `ReferenceError: lazyLoadFunc is not defined` (8161 fix 2026-05-04).
|
||||||
|
- [ ] **Body inline scripts** (port 8148 lines 184-434): `_initPjs()`, `_revealPjs()`, `_playAt()`, click handler на `.<lmtr_class>` capture phase, VAST overlay click forwarder.
|
||||||
|
- [ ] **Guard counter calls:** `tb.start_events_v2(() => { if(typeof c==="function") c(<%-video.video_id%>,0,"click",0); }, ...)` — `c()` defined у async-loaded `counters.v2.min.js`, без guard race-error (`c is not defined`).
|
||||||
|
|
||||||
|
### id_index.etlua
|
||||||
|
- [ ] **Replace videojs4 DOM** з PlayerJS structure: `<div class="<lmtr_class> is-loading"><div class="<vdo_class> js-cleanVideo" id="pjs_container">` + `<video>` + `<div id="pjs_poster">` + `<img id="pjs_poster_img">` + `<div id="pjs_play_btn">` SVG + `<div id="pjs_loader">` SVG.
|
||||||
|
- [ ] **Use site-NATIVE classes** (не copy 8148 `vdo-blk-lmtr`/`vdo-blk-vdo`). Map до існуючих сайту: 8161 → `vi-limiter`/`vi-player`. Foreign classes створюють **footprint** і CSS дублі.
|
||||||
|
- [ ] **Inline styles target NATIVE classes** теж (`<style>.vi-limiter ...</style>`). Без дзеркал sed.
|
||||||
|
- [ ] **Timeline click handler:** `<a onClick="_playAt(_SECOND_)">` (НЕ legacy `player.setTime`).
|
||||||
|
- [ ] **Poster touch handler script:** localStorage `_pw` mark на `touchstart`/`mousedown` для tabunder pre-detect.
|
||||||
|
|
||||||
|
### CSS site-side (адаптивні правки)
|
||||||
|
- [ ] **Tooltip overlap:** `.<actions>{position:relative;z-index:5001}` — підняти actions row над `.asg-container{z-index:5000}`. Plus `.<msg-class>{z-index:10000}` як defense.
|
||||||
|
- [ ] **Timeline thumb hover-play:** `.<thumbs-block> .<item>.<can-play> a:hover .<img-class>:after{display:block}` + mobile `@media(max-width:768px){.<thumbs> ... :after{transform:translate(-50%,-50%) scale(.6)}}`.
|
||||||
|
- [ ] **Title wrap (`.heading-2` truncation):** `.<title-head> .<heading-2>{white-space:normal;overflow-wrap:anywhere;...}` — override будь-який single-line ellipsis.
|
||||||
|
- [ ] **`.<thumbs-block>` mobile scaling** — adapt 8148 patterns до native classes site-у.
|
||||||
|
|
||||||
|
### Verification
|
||||||
|
- [ ] **`ad-test "<test_url>"`** → 6/6 PASS.
|
||||||
|
- [ ] **Empirical Playwright probe:** capture `pageerror` array — має бути empty. Перевірити specifically `c is not defined`, `lazyLoadFunc is not defined`, `c2.min.js Unexpected identifier 'o'`.
|
||||||
|
- [ ] **Validate `c2.min.js` syntax:** `node --check views/static/js/c2.min.js` — passing. Якщо source `c2.js` edited без re-minify → broken `let` declarations у comma-sequence; fix: `terser views/static/js/c2.js -c -m -o views/static/js/c2.min.js`.
|
||||||
|
- [ ] **Banner DOM uniqueness:** `await page.evaluate(() => Array.from(document.querySelectorAll('iframe[src*="api/spots"]')))` collect → no duplicate parent IDs (`#thmb1` 2× = bug).
|
||||||
|
- [ ] **VAST endpoint probe:** `curl 'https://a5.g--o.info/api/users/<vast_spot>?v2=1&fill=0&url=<page-url>'` returns `<Ad>` (не empty `<VAST/>` — no-fill).
|
||||||
|
- [ ] **Popunder endpoint probe:** `curl 'https://a5.g--o.info/api/users/<popunder_spot>?host=<domain>&...'` returns `window.__NA.renderSpot({...})`.
|
||||||
|
- [ ] **t1 CDN serves fresh bundle:** `curl -sL "https://t1.<domain>/static/js/ad-bundle.min.js" | grep -oE 'spot:"[0-9]+"'` — bundle reflects новий config.
|
||||||
|
- [ ] **Real-browser smoke:** click play → VAST shows (after popunder cooldown set), click like → tooltip opens above player chrome, hover related thumb → play icon, hover timeline scene → smaller play icon (mobile) / regular (desktop).
|
||||||
|
|
||||||
|
### Post-deploy
|
||||||
|
- [ ] **Monitor adspyglass dashboard** після prod deploy — graph має продовжувати ріст; падіння = регресія.
|
||||||
|
- [ ] **Update site row у [SITES.md](SITES.md)** з generation tag (`v3 PlayerJS`).
|
||||||
|
- [ ] **Update memory `project_player_roadmap.md`** — додати site до v3 list.
|
||||||
|
|
||||||
## Monitoring
|
## Monitoring
|
||||||
|
|
||||||
### adspyglass dashboard — best diagnostic signal
|
### adspyglass dashboard — best diagnostic signal
|
||||||
|
|||||||
Reference in New Issue
Block a user