Video Duration Calculator is a Python script that calculates the total duration of a list of YouTube videos provided in a text file. It utilizes the pytube
library to fetch the duration of each video and then sums them up to provide the total duration.
- Video Duration Retrieval: Retrieves the duration of each YouTube video using the
pytube
library. - Total Duration Calculation: Calculates the total duration of all videos in the list.
- Input from Text File: Accepts a list of YouTube video links from a text file.
- Graphical User Interface (GUI): Provides a simple GUI for selecting the input file and displaying the result.
- Error Handling: Handles errors gracefully and continues processing the remaining videos.
- Run the script (
python video_duration_calculator.py
). - Click the "Select" button to choose a text file containing the list of YouTube video links.
- Click the "Process" button to calculate the total duration.
- The total video time will be displayed in the GUI.
- Python 3.x
pytube
library
Suppose the input text file (video_links.txt
) contains the following list of YouTube video links:
https://www.youtube.com/watch?v=dQw4w9WgXcQ
https://www.youtube.com/watch?v=3GwjfUFyY6M
...
After running the script and selecting video_links.txt
, the GUI will display the total duration of all videos combined.