-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseed_videos.py
More file actions
53 lines (43 loc) · 2.15 KB
/
seed_videos.py
File metadata and controls
53 lines (43 loc) · 2.15 KB
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
from models import videos_collection
from datetime import datetime
def seed_videos():
"""Seed database with 2 startup-focused videos"""
print("=" * 50)
print("🌱 Seeding database with startup videos...")
print("=" * 50)
# Clear existing videos (optional - for clean testing)
result = videos_collection.delete_many({})
print(f"Cleared {result.deleted_count} existing videos")
# Video 1: Y Combinator - How to Start a Startup
# This is Sam Altman's famous lecture series at Stanford
video1 = {
'title': 'How to Start a Startup - Sam Altman (Y Combinator)',
'description': 'Learn the fundamentals of building a successful startup from Y Combinator president Sam Altman. Covers ideas, products, teams, and execution strategies used by the world\'s most successful startups.',
'youtube_id': 'CBYhVcO4WgI', # Sam Altman's lecture at Stanford
'thumbnail_url': 'https://i.ytimg.com/vi/CBYhVcO4WgI/hqdefault.jpg',
'is_active': True,
'created_at': datetime.utcnow()
}
# Video 2: Steve Jobs - Stanford Commencement Speech
# Inspirational speech about entrepreneurship and following your passion
video2 = {
'title': 'Steve Jobs Stanford Commencement Address',
'description': 'Steve Jobs delivers an inspiring commencement speech at Stanford University about connecting the dots, love and loss, and living each day as if it were your last. A must-watch for aspiring entrepreneurs.',
'youtube_id': 'UF8uR6Z6KLc', # Steve Jobs Stanford speech
'thumbnail_url': 'https://i.ytimg.com/vi/UF8uR6Z6KLc/hqdefault.jpg',
'is_active': True,
'created_at': datetime.utcnow()
}
# Insert videos
videos_collection.insert_one(video1)
print(f"✅ Added: {video1['title']}")
videos_collection.insert_one(video2)
print(f"✅ Added: {video2['title']}")
print("=" * 50)
print("✅ Database seeded successfully!")
print("=" * 50)
# Verify by counting
count = videos_collection.count_documents({'is_active': True})
print(f"Total active videos: {count}")
if __name__ == '__main__':
seed_videos()