Video Organization¤
PyTube provides tools to automatically organize conference videos based on their target YouTube channel.
Overview¤
The video organization system:
1. Downloads videos to a central downloads/ directory
2. Analyzes Pretalx session data to determine channel assignments
3. Moves videos to channel-specific directories for upload
4. Tracks unassigned videos for manual review
Directory Structure¤
video_dir/
├── downloads/ # Original downloaded videos
│ ├── ABC123-talk-title.mp4
│ └── DEF456-another-talk.mp4
├── pycon/ # Videos for PyCon channel
│ └── ABC123-talk-title.mp4
├── pydata/ # Videos for PyData channel
│ └── DEF456-another-talk.mp4
├── do_not_release/ # Videos marked as do-not-record
└── tracks_map.json # Channel assignments
Video Naming Convention¤
Videos must follow the naming pattern: {SESSION_CODE}-{title}.mp4
- SESSION_CODE: The 6-character Pretalx session code
- title: Any descriptive title (used for reference only)
Example: ABC123-introduction-to-python.mp4
Channel Assignment Logic¤
Videos are assigned to channels using a priority system:
- Do Not Record: Sessions with
do_not_record: true→no_publishingchannel - Direct Mapping: Session codes listed in
pretalx.video_to_trackconfig - Track Matching: Track names matching patterns in
pretalx.track_to_channel - AI Heuristics: Claude/OpenAI analyze title+abstract (if configured and above methods fail)
- Unmatched: Remains in
downloads/for manual handling
Configuration Example¤
pretalx:
# Direct session-to-channel mapping
video_to_track:
ABC123: "pycon"
DEF456: "pydata"
# Track name pattern matching
track_to_channel:
pycon: "pycon" # Tracks containing "pycon" → PyCon channel
pydata: "pydata" # Tracks containing "pydata" → PyData channel
data: "pydata" # Tracks containing "data" → PyData channel
# Optional: AI heuristics for unmatched videos
openai:
api_key: "sk-..."
anthropic:
api_key: "sk-..."
Special Cases¤
- Do Not Record: Videos marked with
do_not_record: truein Pretalx are automatically moved todo_not_release/directory - No Publishing: These videos are tracked but not uploaded or published
Important Safety Note
NEVER upload videos from the do_not_release/ directory to YouTube!
These videos are marked as do_not_record for privacy reasons.
The pytube youtube map command will automatically skip these videos and warn if they are found on YouTube.
Workflow¤
1. Assign Videos to Channels¤
# Preview assignments
pytube video assign-channels --dry-run
# Create assignment files
pytube video assign-channels
This creates:
- tracks.json: Full video-to-channel mapping
- tracks_map.json: Session ID to channel lookup
2. Move Videos to Channel Directories¤
# Preview moves
pytube video move --dry-run
# Move videos
pytube video move
This:
- Moves videos to pycon/ or pydata/ directories
- Moves do-not-record videos to do_not_release/
- Keeps unmatched videos in downloads/
3. Review Unassigned Videos¤
pytube video report
This generates a report of videos that couldn't be assigned automatically.
Handling Unassigned Videos¤
If videos cannot be automatically assigned:
- Check the report:
pytube video report - Add direct mappings to your config:
pretalx: video_to_track: XYZ789: "pycon" # Add session code here - Re-run assignment:
pytube video assign-channels - Move the newly assigned videos:
pytube video move
Best Practices¤
- Always use dry-run first: Preview operations before making changes
- Check video naming: Ensure files follow the
{CODE}-{title}.mp4pattern - Review assignments: Check
tracks_map.jsonfor accuracy - Handle edge cases: Add direct mappings for special sessions
Troubleshooting¤
Videos Not Being Assigned¤
- Check filename format - must start with 6-character code
- Verify session exists in Pretalx data
- Check if session is marked as "confirmed"
- Look for track name in configuration
Wrong Channel Assignment¤
- Add direct mapping in
video_to_trackconfig - Re-run assignment process
- Move corrected videos
Missing Videos¤
Run pytube video report to see which sessions are missing video files.