Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 1,494 Bytes
d15f07c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #!/bin/bash
# Update All LocalView Data Sources
#
# Runs all LocalView scraper scripts to update the dataset
set -e
echo "๐๏ธ LocalView Data Update Pipeline"
echo "===================================="
echo ""
cd "$(dirname "$0")/../.."
# Activate virtual environment
if [ -f .venv/bin/activate ]; then
source .venv/bin/activate
elif [ -f venv/bin/activate ]; then
source venv/bin/activate
fi
# Check for API key
if [ -z "$YOUTUBE_API_KEY" ]; then
echo "โ ๏ธ YOUTUBE_API_KEY not set"
echo ""
echo "Add to .env file:"
echo " YOUTUBE_API_KEY=your_api_key_here"
echo ""
echo "Get an API key at: https://console.cloud.google.com/apis/credentials"
exit 1
fi
echo "โ
YouTube API key found"
echo ""
# Step 1: Scrape YouTube channels
echo "๐น Step 1: Scraping YouTube channels..."
python scripts/localview/scrape_youtube_channels.py --update --since-days 60
# Step 2: Extract transcripts
echo ""
echo "๐ Step 2: Extracting transcripts..."
python scripts/localview/extract_transcripts.py --year $(date +%Y)
# Step 3: Load into database
echo ""
echo "๐พ Step 3: Loading into database..."
if [ -f discovery/localview_ingestion.py ]; then
python discovery/localview_ingestion.py
else
echo "โ ๏ธ Ingestion script not found, skipping database load"
fi
echo ""
echo "โ
LocalView update complete!"
echo ""
echo "Data saved to:"
echo " - data/cache/localview/videos_$(date +%Y).csv"
echo " - data/cache/localview/transcripts/*.txt"
|