pypi installation - panuozzo77/StreamingCommunity GitHub Wiki

PyPI Installation

This guide walks you through installing the StreamingCommunity package using Python's package manager, pip. This is the recommended installation method for Python users as it handles dependency management automatically.

Prerequisites

Before installing StreamingCommunity via pip, ensure you have the following prerequisites:

  • Python: Version 3.8 or higher

    • Verify with: python --version or python3 --version
    • Download Python if needed (make sure to check "Add Python to PATH" during Windows installation)
  • pip: Python's package installer (usually included with Python)

Installation Steps

1. Create a Virtual Environment (Recommended)

Using a virtual environment is highly recommended to isolate project dependencies and avoid conflicts with other Python projects.

On Windows:

# Create a virtual environment
python -m venv .venv

# Activate the virtual environment
.venv\Scripts\activate

On macOS/Linux:

# Create a virtual environment
python3 -m venv .venv

# Activate the virtual environment
source .venv/bin/activate

Your terminal prompt should change to show the environment name (e.g., (.venv)), indicating that the virtual environment is active.

2. Install StreamingCommunity

Once your virtual environment is activated, install the package from PyPI:

pip install StreamingCommunity

This command downloads and installs the latest version of the StreamingCommunity package and all its dependencies.

3. Verify Installation

Verify that the installation was successful by checking the installed version:

pip show StreamingCommunity

Updating StreamingCommunity

To update to the latest version of StreamingCommunity:

pip install --upgrade StreamingCommunity

Running StreamingCommunity

After installation, you can run StreamingCommunity by creating a simple Python script:

1. Create a Script File

Create a file named run_streaming.py with the following content:

from StreamingCommunity.run import main

if __name__ == "__main__":
    main()

2. Run the Script

# Make sure your virtual environment is activated
python run_streaming.py

Using StreamingCommunity Modules

StreamingCommunity provides several modules that you can use in your own Python scripts:

HLS Downloader

For downloading HTTP Live Streaming (HLS) content from m3u8 URLs:

from StreamingCommunity.Download import HLS_Downloader

# Initialize with m3u8 URL and optional output path
downloader = HLS_Downloader(
    m3u8_url="https://example.com/stream.m3u8",
    output_path="/downloads/video.mp4"  # Optional
)

# Start the download
downloader.download()

MP4 Downloader

For direct MP4 file downloads:

from StreamingCommunity.Download import MP4_downloader

# Basic usage
downloader = MP4_downloader(
    url="https://example.com/video.mp4",
    path="/downloads/saved_video.mp4"
)

# Start download
downloader.download()

Torrent Client

For downloading content via torrent magnet links:

from StreamingCommunity.Download import TOR_downloader

# Initialize torrent client
client = TOR_downloader()

# Add magnet link
client.add_magnet_link("magnet:?xt=urn:btih:example_hash&dn=example_name", save_path=".")

# Start download
client.start_download()

Deactivating the Virtual Environment

When you're done working with StreamingCommunity, you can deactivate the virtual environment:

deactivate

This will return your terminal to its normal state.

Troubleshooting

Common Issues

  1. "Command not found" error when running pip

    • Ensure Python is correctly installed and added to your PATH
    • Try using python -m pip instead of just pip
  2. Permission errors during installation

    • On Linux/macOS, you might need to use sudo pip install StreamingCommunity
    • Alternatively, use the --user flag: pip install --user StreamingCommunity
  3. Dependency conflicts

    • Always use a virtual environment to avoid conflicts
    • If conflicts occur, try pip install --upgrade --force-reinstall StreamingCommunity

Getting Help

If you encounter issues not covered here:

Next Steps

⚠️ **GitHub.com Fallback** ⚠️