This project provides tools to search YouTube for videos containing specific phrases related to Duma Boko's statements, and a standardized CSV template for collecting cross-source evidence.
- search_boko_youtube.py - Python script to search YouTube via Data API v3
- evidence_template.csv - CSV template with schema and example rows
- requirements.txt - Python dependencies
- Go to Google Cloud Console
- Create a new project or select existing
- Navigate to APIs & Services > Library
- Search for "YouTube Data API v3" and click Enable
- Go to APIs & Services > Credentials
- Click Create Credentials > API Key
- Copy the key (starts with
AIza...) - (Optional) Restrict the key to YouTube Data API v3 for security
pip install -r requirements.txtOr manually:
pip install google-api-python-clientOpen search_boko_youtube.py and replace:
API_KEY = "YOUR_YOUTUBE_API_KEY_HERE"With your actual API key.
python search_boko_youtube.pyOutput: boko_youtube_results.csv with columns:
search_phrase- The query that found this videotitle- Video titlevideo_id- YouTube video IDurl- Full YouTube URLpublished_at- Publication date (ISO 8601)description- First 200 characters of description
Open boko_youtube_results.csv and filter for Botswana/Duma Boko related videos.
For each relevant video:
- Open the URL
- Use YouTube's transcript panel to find timestamps
- Copy evidence into
evidence_template.csv
| Column | Description |
|---|---|
source_type |
clip, full_speech, repost, news |
source_url |
Full URL of video/post |
video_id_or_shortcode |
Platform-specific ID |
platform |
youtube, facebook, tiktok, instagram, web_article |
posted_at |
Date posted (YYYY-MM-DD) |
mentioned_date |
Date mentioned in content |
event_type |
kgotla, press_conference, SONA, campaign_rally, interview, parliament |
event_name |
e.g., "Kgagodi kgotla (Jan 2026)" |
speaker |
Person speaking (e.g., Duma Boko) |
quote_type |
promise_fulfil, not_legal_contract, social_contract, manifesto_quote |
quote_text |
Verbatim quote |
start_time |
Timestamp start (HH:MM or HH:MM:SS) |
end_time |
Timestamp end |
context_summary |
1-2 sentence context |
case_id |
CASE_1, CASE_2, etc. |
case_type |
Claim_A, Claim_B |
contradiction_type |
Framing inversion, Promise vs outcome, etc. |
ds_score |
Float 0-1 (e.g., 0.85) |
notes |
Additional notes |
- Run script → Get YouTube results
- Manually search Facebook/TikTok with same phrases
- Paste URLs and timestamps into
evidence_template.csv - Join rows by
case_idandcase_typefor analysis - Mark ΔS-HIGH when same quote_type appears in different events/time ranges
The script searches for:
- "A promise to voters is not a legal contract"
- "election promises are not legal or social contracts"
- "election promises are not legally binding contracts"
- "Votes aren't contracts"
- "government will fulfil promises"
- "no backing down from our promises"
- "President Duma Boko"
- "Duma Boko kgotla"
- "Duma Boko 2024 election promises"
- API quota: 100 units per search, 10,000 units/day default
- Each phrase uses 1 search = 100 units
- 9 phrases = 900 units per full run
- Results are sorted by date (most recent first)
- Current Canonical Validation:
test_v3_divergence_pipeline.pyis the canonical validation for the active v3.0 Governance Promise-Delivery Divergence Engine. - Legacy Validation:
test_semantic_pipeline.pybelongs to the legacy semantic transcript pipeline. It may fail in fresh clones because it depends on raw transcript assets underdownloads/TRANSCRIPTS/, which are omitted from version control. - Verification Command (WSL):
To run the active validation suite within WSL, execute:
cd /home/mopati_ramaologa/dev/duma-boko-contradiction-engine-v2 source .venv/bin/activate python3 test_v3_divergence_pipeline.py