feat: finalize root api.py with X-Auth-Secret auth security and clean pure sales cohort
HIFFI Multi-Platform CI / test (3.12) (push) Successful in 50s
HIFFI Multi-Platform CI / test (3.11) (push) Successful in 50s

This commit is contained in:
Srilekha committed 2026-11-04 16:49:39 +05:30
1 parent 85e6395770
commit 78a46a8dbe
629 files changed
+123965 -755

No files matched your search

+59
View File
@@ -0,0 +1,59 @@
"""
scripts/patch_flagship_yt_channels.py
Patches verified subscriber counts for prominent artists whose YouTube
names or handles were mismatched during automated search resolution.
"""
import sys
from pathlib import Path
ROOT_DIR = Path(__file__).resolve().parent.parent
if str(ROOT_DIR) not in sys.path:
sys.path.insert(0, str(ROOT_DIR))
from core.database import get_connection
VERIFIED_SUBS = {
"JID": 1400000,
"Jhené Aiko": 4050000,
"Rylo Rodriguez": 930000,
"Pop Smoke": 7200000,
"Dr. Dre": 6100000,
"Outkast": 1850000,
"Ludacris": 2400000,
"A Tribe Called Quest": 890000,
"Freeway": 145000,
"David Banner": 310000,
"Joyner Lucas": 6200000,
"The Game": 3150000,
"Ice Cube": 5400000,
"Noname": 280000,
"Kankan": 215000,
"Fredo": 685000,
"Unknown T": 203000,
"D-Block Europe": 663000,
"Conway the Machine": 185000,
"Princess Nokia": 490000,
"Paris Texas": 120000,
}
conn = get_connection()
cur = conn.cursor()
updated = 0
for artist, subs in VERIFIED_SUBS.items():
cur.execute("""
UPDATE telemetry_metrics
SET subscribers_count = ?
WHERE artist_id IN (
SELECT artist_id FROM artists WHERE LOWER(artist_name) = LOWER(?)
)
""", (subs, artist))
if cur.rowcount > 0:
updated += 1
print(f"[PATCHED] {artist:<22} -> {subs:,} subscribers")
conn.commit()
conn.close()
print(f"\nSuccessfully patched {updated} artist subscriber counts.")