A Termux/Python script that reorganizes videos downloaded by the Coursera Android app into a clean, human-readable folder structure — with proper titles, course names, and embedded subtitles, and optional audio boosting. (Requires ROOT)
To be able to follow courses on any media player (e.g. MXPlayer or MPV), or watching them on different platforms locally (without being tied to their app, having to download them on every device, consuming your data).
This tool is intended for personal use only to organize content you have legitimately downloaded through the Coursera Android app. It does not circumvent any DRM or download restrictions. The authors assume no liability for misuse.
When you download courses for offline use, the Coursera app stores files under:
/data/media/0/Android/data/org.coursera.android/files/Download/
with opaque names such as:
Coursera_a4iMn.mp4
Coursera_a4iMn,en
Coursera_FJxRl.mp4
Coursera_FJxRl,en
There is no easy way to figure out which file is which video, because that mapping resides in the app's private SQLite database:
| Database | Table | Useful columns |
|---|---|---|
offline_downloads_database |
downloaded_course_items |
itemId, courseId, itemType, weekNumber, itemName, weekOrder |
offline_downloads_database |
downloaded_course_summary |
courseId, courseName, partner |
coursera-organize reads this database, pairs every video with all of its available subtitles, converts the SRT subtitles to WebVTT, and muxes them into a single MP4 under:
/sdcard/coursera-organize/<Course Name> - [<Partner>]/Week <X>/<Order> - <Video Title>.mp4
The original Coursera files are never modified, everything is copied / remuxed into the output directory.
- 🔍 Auto-discovers the Coursera
Downloadfolder on any Android User or Work Profile. - 🧠 Renames course videos to match their actual Title.
- 📚 Oragnizes videos in their corresponding Course folder.
- 🚚 Custom output directory, using the flag
--output <path>. - 🌐 Multi-language subtitles: Finds all available subtitle tracks for a video, converts them from SRT to WebVTT, and muxes them into the final MP4 as separate soft-subs.
- 🔊 Audio Boost: Optional
--audio-boostargument to multiply audio volume (e.g.2.0for double volume) for quiet lectures. Re-encodes to AAC. - 🛡️ Databases are copied to a temporary file before being opened, so the running Coursera app and its
-wal/-shmfiles are never disturbed. - 🚫 Never alters the original downloaded files, output is written to a separate directory.
- 🔁 Safe to re-run: automatically skips files that have already been processed, saving time.
- A rooted Android device.
- The Coursera app installed, signed in, with at least one video downloaded for offline use.
- Termux with:
pkg update
pkg install python ffmpeg sudo
termux-setup-storage # grants storage permissiongit clone https://github.com/SanctionHunter/coursera-organize.git
cd coursera-organize
chmod +x coursera_organize.py# Default: writes everything to /sdcard/coursera-organize
sudo python coursera_organize.py
# Custom output directory
sudo python coursera_organize.py --output /sdcard/MyCourses
# Boost audio volume by 2x (200%)
sudo python coursera_organize.py --audio-boost 2.0
# Just see what the script would do, without writing anything
sudo python coursera_organize.py --dry-run- Locate inputs. The script scans
/data/media/{0..31}/Android/data/ org.coursera.android/files/Download(covering primary user, work profile, etc.) for Download folders, and/data/user/{0..31}/org.coursera.android/ databases/for theoffline_downloads_database. - Snapshot database. The script copies the
.dbfile and its-wal/-shmsiblings to a temporary file, then opens that copy read-only (?mode=ro). This avoids interfering with the running Coursera app. - Build lookups. - From
downloaded_course_items(whereitemType = 'CONTENT_TYPE_LECTURE'):{ itemId → (courseId, weekNumber, weekOrder, itemName) }- Fromdownloaded_course_summary:{ courseId → (courseName, partner) }. - For every
Coursera_<id>.mp4file, look up its title, week, and order. It resolves the course folder name (<courseName> - [<partner>]) and creates aWeek <weekNumber>subfolder. The file is named<weekOrder + 1> - <itemName>.mp4. - Subtitles & Muxing. It finds all matching subtitles (
Coursera_<id>,<lang>), converts them from SRT to WebVTT, thenffmpeg-muxes the video + all VTT tracks into the final MP4 (-c:v copy -c:s mov_text) with proper 3-letter language metadata. - Audio Boost (Optional). If
--audio-boostis provided, it adds an audio filter (-af volume=<multiplier>) and re-encodes the audio track to AAC (-c:a aac). Otherwise, the audio is copied as-is. - Originals are untouched. Only the output directory is written to.
- Videos are not processed in chronological order.
- Videos are organized in
Week 1, Week 2...folders instead ofModuleName— as it wasn't exposed in any of the app's available databases. - Requires
ffmpegfor muxing and audio boosting. Ifffmpegis not installed, videos are copied without subtitles (a warning is printed). - Only
CONTENT_TYPE_LECTURE(video) rows are processed; other download types (e.g. PDFs, quizzes, reading materials) are ignored. - Tested only on Coursera 6.7.1 (92473), so it may not work on later versions.
This script is provided "as is," without warranty of any kind. While it will meticulously organize your Coursera videos, it will not do your homework, nor will it attend the final exam for you. The author assumes no responsibility for blown eardrums if you set --audio-boost to 15.0, sudden urges to learn sigmoidal curve at 3 AM, or any academic probation resulting from the illusion of productivity that comes with neatly sorted folders. Use responsibly.
Released to the public domain under CC0 1.0 Universal — see LICENSE. You are free to use, modify, and distribute this code for any purpose, with or without attribution.
Contributions, issues, and feature requests are welcome. Feel free to open an issue or submit a pull request.