learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
457 stars 304 forks source link

Enhancement Request - load videos from local storage using topic tree #5425

Closed tim-moody closed 7 years ago

tim-moody commented 7 years ago

It would be nice to be able to provision videos to the content directory from some other local storage, either internal or external disk, usb stick, etc., using the topic tree selection process to determine which videos to load.

benjaoming commented 7 years ago

I know this probably doesn't answer your question... but you have 3 options for pointing KA Lite to use a non-default video folder:

  1. Customize your KALITE_HOME environment variable. This way, ALL user data of KA Lite can have a custom location.
  2. Symlink ~/.kalite/content/ to where you store your videos.
  3. Set CONTENT_ROOT="/path/to/my/videos" in your ~/.kalite/settings.py file.

After this, just run kalite manage videoscan or press "Scan Video Folder" in Manage->Videos.

I'm not sure exactly what part of the UI you refer to by "topic tree selection process", but generally speaking, these settings are at a very deep level of KA Lite, so it's hard (as in not impossible) to receive user configuration input from the browser UI and store it as an application setting.

As for importing videos and copy them to the content folder, we could accept a PR for this, but since it's already high up on the feature list of Kolibri, I don't think it will be done for KA Lite.

Meanwhile, I would also warn against:

1) Using a conventional Python library to copy/move 40-80 GB of data (depending on how videos were obtained, the torrent with resized videos is 45 GB). This requires process scheduling, user feedback, resume functionality, and some guarantees of consistency. 2) Doing a quick implementation and adding it to the UI... for inexperienced users, an unstable copy mechanism with loads of data will be quite costly.

I really sympathize with the need for a "discover and import videos" function for scanning and copying from a removable drive.

For now, the best advice is for users to copy contents into ~/.kalite/content, using their file browser, and then clicking Scan Video Folder.

Btw. on Linux, the kalite_gtk UI has an "open" button for the contents folder, which will open up the file browser.

screenshot from 2017-03-22 19-35-01

tim-moody commented 7 years ago

I wrote a utility to do this. Uses content_khan_XX.sqlite and copies all videos belonging to a tree node such as khan/math/