Add permanent Adpingid-level exclusions

exclude.json gains an "adpings" map (18 ids, value = package for
reference) alongside the existing package list. build_data.py drops those
Adpingids from both the 投手 ownership counts and the spend rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
FANGKK
2026-08-31 10:43:53 +08:00
co-authored by Claude Opus 5
parent b917f9bccf
commit ef86d383f8
3 changed files with 38 additions and 17 deletions
+9 -3
View File
@@ -2,13 +2,16 @@
# 从 xlsx 重算 data.json。
# 平台消耗统计: B=Date, C=Adpingid, D=包名, E=地区, I=花费
# 投手: B=Adpingid, D=pkg, L=Media Buyer投放人
# 规则:@某某 == 某某;未填投放人的 Adpingid 丢弃;exclude.json 里的包名永久剔除(精确匹配)。
# 规则:@某某 == 某某;未填投放人的 Adpingid 丢弃;
# exclude.json 的 packages(按包名)与 adpings(按 Adpingid)永久剔除,均为精确匹配。
# 每个 package 明细:Geo 后缀 = 该 package 花费最高的地区;Adpingid = 该地区内花费最高的 Adping。
import openpyxl, collections, json, datetime, os, sys
HERE = os.path.dirname(os.path.abspath(__file__))
SRC = os.path.join(HERE, '2608每日数据-武汉萌奇熊.xlsx')
EXCL = set(json.load(open(os.path.join(HERE, 'exclude.json')))['packages'])
_cfg = json.load(open(os.path.join(HERE, 'exclude.json')))
EXCL = set(_cfg['packages']) # 按包名剔除
EXCL_ADP = set(_cfg.get('adpings', {})) # 按 Adpingid 剔除
NON_BUYER = {'GP下架'}
WINDOW_DAYS = 3
@@ -20,12 +23,15 @@ def key(v):
wb = openpyxl.load_workbook(SRC, data_only=True)
# --- 投手表:Adpingid -> 投放人 ---
amap, dropped_ids = {}, set()
amap = {}
dropped_ids = set(EXCL_ADP) # 先纳入按 Adpingid 剔除的,再补上按包名命中的
for r in wb['投手'].iter_rows(min_row=2, values_only=True):
adp, pkg, buyer, status = r[1], r[3], r[11], r[0]
if adp is None or str(status).strip() == '示例':
continue
k = key(adp)
if k in EXCL_ADP:
continue
if pkg is not None and str(pkg).strip() in EXCL: # 精确匹配,避免误伤 in.swiggy.android
dropped_ids.add(k)
continue
+6 -11
View File
@@ -2,12 +2,12 @@
"meta": {
"week": "Last 3 Days: 8/25-8/27",
"source": "数据已处理(平台消耗统计 × 投手表匹配,已剔除未填写投放人的 Adpingid 及排除包名)",
"generated_at": "2026-08-28",
"generated_at": "2026-08-31",
"date_range": "2026/08/25-2026/08/27",
"note": "投放人以「投手」表 Media Buyer 列为准,@某某 已与某某合并计算;未填写投放人的 Adpingid 不计入;exclude.json 所列包名已排除。Package 后缀为该 Package 花费最高的投放地区,Adpingid 为该地区内花费最高的 Adping。"
},
"grand_total": 12114.2664,
"week34_id_count": 123,
"grand_total": 12022.4358,
"week34_id_count": 120,
"buyers": [
{
"name": "黄政",
@@ -188,9 +188,9 @@
{
"name": "詹涵粤",
"@name": "詹涵粤",
"total": 1720.3579,
"active_ids": 20,
"owned_ids": 148,
"total": 1628.5273,
"active_ids": 17,
"owned_ids": 143,
"pkgs": [
{
"pkg": "com.king.candycrushsaga",
@@ -231,11 +231,6 @@
}
],
"unmatched": [
{
"adping": "91551415",
"pkg": "com.ddup.zombiewaves.zw",
"spend": 4.0
},
{
"adping": "91538334",
"pkg": "cn.com.vtmarkets",
+22 -2
View File
@@ -1,5 +1,5 @@
{
"_comment": "永久排除的包名(精确匹配,不做子串匹配)。用户 2026-08-26 指定,以后每次生成报告都不计入。",
"_comment": "永久排除项,每次生成报告都不计入。packages=按包名精确匹配剔除;adpings=按 Adpingid 精确剔除(值为包名,仅作备注)。用户 2026-08-26 / 2026-08-28 指定。",
"packages": [
"com.levelinfinite.sgameGlobal",
"com.igg.android.lordsmobile",
@@ -13,5 +13,25 @@
"id891130066",
"id886443637",
"id1014949597"
]
],
"adpings": {
"91513416": "org.megapari.client",
"91513572": "org.megapari.client",
"91544865": "com.qookkagames.xczyw.gp.hk",
"91544866": "com.sialiagames.xczyw.gp.tw",
"91544867": "net.mbc.shahid",
"91544868": "com.igg.android.lordsmobile",
"91545518": "com.cathayholdings.vdrf",
"91545519": "com.vuclip.viu",
"91546637": "com.igg.android.lordsmobile",
"91546638": "net.mbc.shahid",
"91546639": "com.sialiagames.xczyw.gp.tw",
"91546640": "com.qookkagames.xczyw.gp.hk",
"91550106": "com.sialiagames.xczyw.gp.tw",
"91550107": "net.mbc.shahid",
"91551412": "com.ddup.zombiewaves.zw",
"91551415": "com.ddup.zombiewaves.zw",
"91551606": "com.ddup.zombiewaves.zw",
"91552556": "com.ddup.zombiewaves.zw"
}
}