# youtube-audio **Repository Path**: mingzh/youtube-audio ## Basic Information - **Project Name**: youtube-audio - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-11 - **Last Updated**: 2025-02-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # YouTube Audio Downloader This application downloads audio from a specified YouTube channel and displays a list of downloadable audio files on a web page. ## Prerequisites - Docker and Docker Compose should be installed on your system. - Python 3.9 or higher should be installed on your system (for local development). - You need to obtain a YouTube Data API v3 key from Google Cloud Console. ## Setup 1. **Clone the repository (if applicable)**: If you downloaded the code as a zip, extract it to a directory. 2. **Navigate to the project directory**: `cd youtube-audio-downloader` 3. **Configure API Key and Channel ID**: - Open `config.json` and replace `"YOUR_API_KEY"` with your actual YouTube Data API v3 key. - Replace `"YOUR_CHANNEL_ID"` with the ID of the YouTube channel you want to download audio from. 4. **Build the Docker image**: ```bash docker build -t youtube-audio-downloader . ``` 5. **Run with Docker Compose**: ```bash docker-compose up -d ``` This command will build the Docker image (if not already built) and start the application using Docker Compose in detached mode. 6. **Access the application**: Open your web browser and go to `http://localhost:5000`. You should see a list of downloaded audio files. **Detailed Docker Compose Instructions:** - Ensure you have Docker and Docker Compose installed. - Navigate to the `youtube-audio-downloader` directory containing the `docker-compose.yml` file. - Run `docker-compose up -d` to build and start the application in detached mode. - To stop the application, run `docker-compose down`. - The application will be accessible at `http://localhost:5000`. ## Running without Docker (for development) 1. **Navigate to the project directory**: `cd youtube-audio-downloader` 2. **Install Python dependencies**: ```bash pip install -r requirements.txt ``` 3. **Run the Flask application**: ```bash python app.py ``` 4. **Access the application**: Open your web browser and go to `http://localhost:5000`. ## Docker Compose Configuration The `docker-compose.yml` file is configured to run the application in a Docker container. It defines a service named `web` that builds from the Dockerfile in the current directory and maps port 5000 on the host to port 5000 in the container. ## Important Notes - **YouTube API Quota**: Be mindful of the YouTube API daily quota limits. - **Legal Considerations**: Ensure that downloading audio from YouTube channels complies with YouTube's Terms of Service and copyright laws. - **Configuration**: Double-check that your `config.json` file is correctly configured with your API key and channel ID. - **"Sign in to confirm you're not a bot" Error**: If you encounter this error, it indicates YouTube's bot detection is preventing audio download. This is often temporary or due to YouTube's restrictions. You can try: - **Updating youtube-dl**: Ensure you are using the latest version of youtube-dl. If running locally, you can update using `pip install -U youtube-dl`. When using Docker, rebuilding the Docker image will use the latest version available at build time. - **Trying again later**: The bot detection might be temporary. - **Checking video/channel restrictions**: Some videos or channels might have stricter access controls. ## Contributing Feel free to contribute to this project by submitting pull requests or reporting issues. ## License [Your License] (Optional)