📺 iptv-channels-monitoring is a Python script built using FastAPI and VLC media player that enables monitoring and tracking of IPTV channels' activity and statistics. The script allows you to add and manage multiple channels, providing functionalities such as playing channels
- Linux (Tested ✔️)
- Windows (Not Tested ❌)
- MacOS (Not Tested ❌)
To begin with, observe and download dependencies:
To run this project, you need to have the following dependencies installed:
-
🐍 Python >= 3.7: Python is a programming language used by this project.
-
📦 pip: pip is the package installer for Python.
-
⚡️ FastAPI: FastAPI is a modern, fast (high-performance) web framework for building APIs with Python.
-
🦄 Uvicorn: Uvicorn is a lightning-fast ASGI server for running FastAPI applications.
-
📺 VLC: VLC is a free and open-source multimedia player that can handle various streaming formats.
-
🐍 vlc-python: vlc-python is a Python binding for the VLC media player library, allowing you to interact with VLC in your Python scripts.
sudo apt update
sudo apt install python3
sudo apt install python3-pip
pip3 install --upgrade pip
pip3 install fastapi
sudo apt install vlc
pip3 install python-vlc
pip3 install uvicorn
sudo dnf update
sudo dnf install python3
sudo dnf install python3-pip
pip3 install --upgrade pip
pip3 install fastapi
sudo dnf install vlc
pip3 install python-vlc
pip3 install uvicorn
-
Install Python:
- Visit the Python website.
- Download the latest Python installer for Windows.
- Run the installer and follow the instructions. Make sure to check the option "Add Python to PATH" during the installation process.
-
Install pip:
- Open the command prompt.
- Run the following command to upgrade pip:
python -m pip install --upgrade pip
-
Install FastAPI, Uvicorn, VLC, and vlc-python:
- Open the command prompt.
- Run the following command to install the necessary packages:
pip install fastapi uvicorn python-vlc
-
Install VLC:
- Visit the VLC website.
- Download the VLC installer for Windows.
- Run the installer and follow the instructions.
Please make sure to install these dependencies before running the script. Follow the installation instructions for each dependency based on your operating system.
- Create a CSV File:
First, create a CSV file namedall_channels.csv
and write the names and links of the channels in the following format:<channel_name>,<channel_link>
(without any spaces). Here's an example of how it should look:
DiscoveryScience,http://example.com/DiscoveryScience
Scifi,http://example.com/Scifi
Nickelodeon,http://example.com/Nickelodeon
-
Run the ASGI Server:
Useuvicorn
to run the ASGI server for the application. Open your terminal and navigate to the project directory. Run the following command to start the server:-
If you want to run the server on the default host and port (localhost:8000), use:
uvicorn <your_app_name>:app
-
If you want to make the server accessible on all interfaces, use:
uvicorn <your_app_name>:app --host 0.0.0.0
-
If you want to specify a custom port, use:
uvicorn <your_app_name>:app --port <your_port>
Replace
<your_app_name>
with the name of your Python application file (without .py). -
-
Access the Application:
Once the server is running, you can access the application by opening a web browser and navigating tohttp://localhost:8000
(replace the port number if you specified a custom port).The application provides various endpoints for monitoring and interacting with the IPTV channels. Refer to the API documentation or code comments for more details on available endpoints and their functionalities.
Following URLs are available:
-
Stats of All Channels:
Visithttp://localhost:8000/stats
to view the statistics of all channels collectively. -
Stats of a Specific Channel:
To analyze the statistics of a specific channel, replace <channel_name> in the URLhttp://localhost:8000/stats/<channel_name>
with the desired channel's name. -
Current Image Frame of a Channel:
For accessing the current image frame of a channel, go tohttp://localhost:8000/screen/<channel_name>
. Replace <channel_name> with the name of the channel you wish to view.
-
This project is licensed under the MIT License 📜.
🙌 Contributions to AudioVisualizer are welcome! If you have any ideas, improvements, or bug fixes, please submit a pull request 🛠️. For major changes, please open an issue to discuss your ideas beforehand 💡.
- rio51 - Primary Author
- Thanks to @diniliaqil and David Sitnikov for the idea and inspiration to create this project.
✅ This project has been successfully completed and is ready for use. All the desired features have been implemented, and the script is fully functional. You can now monitor IPTV channels, track their activity and statistics, and perform various operations such as playing channels, updating video frames, retrieving channel statistics, and clearing channel buffers. Feel free to use and customize this script according to your specific requirements.
🐛 If you encounter any issues or have suggestions for improvement, please open an issue or submit a pull request.
🎉 Happy monitoring! 📺🔍📊