manascb1344-youtube-upload 0.1.2
A YouTube bulk video uploader using Selenium
Requires Python: >=3.6
Keywords: youtube, upload, automation, selenium

# YouTube Upload Module

A Python module for automatically uploading videos to YouTube using Selenium WebDriver.

## Features

- Batch upload multiple videos to YouTube automatically
- Upload monitoring dashboard with real-time progress
- Automatic retry mechanism for failed uploads
- Detailed logging and progress tracking
- Set video title, description, and tags
- Configure video visibility (Private, Unlisted, or Public)
- Uses Firefox browser with existing profile for authentication
- Upload speed monitoring and reporting
- Enhanced error handling and recovery
- Robust browser session management

## Requirements

- Python 3.6+
- Selenium WebDriver
- Firefox Browser
- Existing Firefox profile with YouTube account logged in

## Installation

1. Clone this repository
2. Install the required packages:
```bash
pip install -r requirements.txt
```

## Configuration

Create a `.env` file in the root directory with the following variables:

```bash
METADATA_JSON_PATH=/path/to/your/videos_metadata.json
YOUTUBE_STUDIO_URL=your_youtube_studio_url
```

## Usage

### Batch Upload Pipeline

The main script for uploading multiple videos is `batch_upload_pipeline.py`. Run it with:

```bash
python batch_upload_pipeline.py [--check]
```

Options:
- `--check`: Keep checking for new videos even after all current videos are processed

The script will:
1. Start a monitoring dashboard at http://localhost:8051
2. Load video metadata from the configured JSON path
3. Upload videos with automatic retries on failure
4. Track progress and save results to `upload_results` directory
5. Generate performance profiling data in `profiling_results` directory

### Single Video Upload

For uploading a single video, you can use the module directly:

```python
from youtube_upload.uploader import YouTubeUploader, VideoVisibility

uploader = YouTubeUploader(
    video_path="path/to/video.mp4",
    title="My Video Title",
    description="Video description",
    visibility=VideoVisibility.UNLISTED
)

video_url = uploader.upload()
print(f"Video uploaded: {video_url}")
```

### Configuration Options

- `video_path`: Path to the video file to upload (required)
- `title`: Title for the video (optional, defaults to filename)
- `description`: Description for the video (optional)
- `visibility`: VideoVisibility setting (optional, defaults to PRIVATE)
- `firefox_profile_path`: Path to Firefox profile (optional)
- `target_email`: YouTube account email (optional)
- `target_channel`: YouTube channel name (optional)
- `tags`: List of video tags (optional)

### Video Visibility Options

- `VideoVisibility.PRIVATE`: Only you can view the video
- `VideoVisibility.UNLISTED`: Anyone with the link can view the video
- `VideoVisibility.PUBLIC`: Everyone can view the video

## Notes

- Make sure you have a Firefox profile with an active YouTube login
- The browser will close automatically after each upload is complete
- The module includes detailed logging for troubleshooting
- Check `youtube_uploads_pipeline.log` for detailed logs
- View upload statistics in the monitoring dashboard

## License

MIT License