PyCTracker is a terminal based program that can show you how much course you watched. Usually i watch my courses on Udemy but sometimes when i am out of town where i don't have good net, i download course for offline use.
This is one of my first programs that i wrote in Python and to be true with you i fell in love with it. This repo don't have some pratical usage except that you can see one of the methods how to read metadata of videos.
- Download MediaInfo and install it. I installed it in PROGRAMFILES if you install it somewhere else you need to change it in code in VideoLength.py file.
# (LINE 20) mediainfo folder location ( place where you installed mediainfo )
os.chdir(os.environ["PROGRAMFILES"] + "\\mediainfo")
- Download libmediainfo and extract it somewhere
- Find file MediaInfoDLL3.py in libmediainfo_0.7.62_AllInclusive.7z\MediaInfoLib\Source\MediaInfoDLL\MediaInfoDLL3.py
- Put this file in same folder where you want to place VideoLength.py file
To make this work you need to change few things.
- Path to videoplayer you want to use i am using KMPlayer
-
#(Line 23)this is video player you want to use change it to your location videoPlayer = "C://Program Files//KMPlayer 64X//KMPlayer64.exe"
-
- Path to file where we are storing data.
-
#(LINE 473)location where we save data, replace "path" with your folder location with open('"path"\\data.txt','w') as outfile:
-
Open your favorite terminal program and navigate to place where you put MediaInfoDLL3.py and VideoLength.py files.
python VideoLength.py "path"
for example
python VideoLength.py "D:\Udemy\Beginner Python and Coding Intro - Scripting a Virtual Car"
If you execute script without arguments you get total time for each course section
You can pass some arguments
Argument | Usage | Example |
---|---|---|
-s | length of specified section | VideoLength.py "path" -s 1 |
-v | open folder location of course | VideoLength.py "path" -s 1 -v |
-p | play all section videos with video player | VideoLength.py "path" -s 1 -v -p |
-t | get course progress | VideoLength.py "path" -s 1 -v -p -t |
Argument -t must be used with -s argument