Giter VIP home page Giter VIP logo

fluminus_cli's Introduction

Looking for new maintainer

I am graduating at the end of this semester (December 2020 == AY2020/2021 Semester 1 == Fall 2020), and so I will most likely not have time to maintain nor the necessary access to test and dogfood the features. If you are interested in maintaining the project, do contact me at the email address I use to author the commits on this repository.

If I can't find a new maintainer by the end of 2020, I will archive the project. Feel free to fork this project, as it was released under the MIT license.

FluminusCLI

Build Status Coverage Status

F LumiNUS! IVLE ftw! Why fix what ain't broken?!

Since IVLE was deprecated on AY2019/2020, and LumiNUS had consistently pushed back its schedule to release an API, I have decided to reverse-engineer the API used by the Angular front-end of LumiNUS.

I try to keep to best coding practices and use as little dependencies as possible. Do let me know if you have any suggestions!

PR's are welcome.

Code coverage is most likely to stay at 0% in the spirit of LumiNUS

demo

Note for Windows Users

FluminusCLI is currently not compatible with Windows. I suggest using Fluminurs instead if all you need is file downloading: https://github.com/indocomsoft/fluminurs

Mostly this is because fluminus is designed with Unix in mind (use of /tmp, file name sanitisation that only looks for null and slash characters, etc.)

If you really need this badly, you can use docker: https://hub.docker.com/r/qjqqyy/fluminus (courtesy @qjqqyy)

CLI Usage

The most important one, to download your files:

mkdir /tmp/fluminus
mix fluminus --download-to=/tmp/fluminus

This will download files of all your modules locally to the directory you speficied. To download all files again next time, simply do:

mix fluminus --download-to=/tmp/fluminus

More information can be found in the help page:

$ mix fluminus --help
mix fluminus [OPTIONS]

--verbose             Enable verbose mode
--show-errors         Show all errors instead of just swallowing them

--announcements       Show announcements
--files               Show files
--download-to=PATH    Download files to PATH

Only with --download-to
--external-multimedia  Download external multimedia files too
--lessons              Download files in the weekly lesson plans too
--multimedia           Download unanchored multimedia files too
--webcasts             Download files in the weekly lesson plans too

Features

  • Storing credentials (in plain text though)
  • Listing of mods being taken and taught
  • Syncing of workbin files
  • Syncing of webcasts
  • Syncing of files in weekly lesson plans
    • This includes downloading of multimedia files using ffmpeg
  • Syncing of unanchored multimedia files (under the multimedia tab)
  • Syncing of external multimedia files (stored on panopto)

Installation

Requirements

  • Elixir (tested with 1.10)
  • Erlang/OTP (tested with 23.0)
  • ffmpeg (optional, only to download multimedia files)

CLI

  1. Install elixir+erlang for your platform
  2. Clone this repo
  3. Get the dependencies:
mix deps.get
  1. Fluminus CLI is available as a mix task:
mix fluminus
  1. If you want to download multimedia files in the weekly lesson plans as well, you will need to download ffmpeg

Note that the first time running the mix task might be a bit slow because the code has to be compiled first.

Hacking Guide

To add a new feature for --download-to, simply implement your feature as a new module in lib/fluminus_cli/work/, implementing @behaviour FluminusCLI.Work. It will be automatically picked up by FluminusCLI, both in argument parsing, processing and help page.

fluminus_cli's People

Contributors

indocomsoft avatar dependabot-preview[bot] avatar dependabot[bot] avatar qjqqyy avatar

Stargazers

Delwynn Lee avatar Tan Yi Guan avatar Christopher Goh avatar Danish Lukawski avatar Eric Han avatar  avatar  avatar Peirong avatar ktaekwon000 avatar  avatar Jack Wong avatar  avatar Raynold Ng  avatar Gabriel Ong avatar

Watchers

James Cloos avatar Danish Lukawski avatar  avatar ktaekwon000 avatar

Forkers

emilyjonathon

fluminus_cli's Issues

[External Multimedia] no support for panopto folder hierarchy

System: WSL2 Ubuntu 20.04
Issue: Unable to download multimedia content [see pictures below]
Expected: Multimedia are downloaded to /tmp/fluminus/<module_code>/Multimedia
Outcome: Multimedia folder are created but no multimedia are downloaded [see picture below]
Command: mix fluminus --download-to=/tmp/fluminus --multimedia --external-multimedia --lessons --webcasts

Issue:
image
image
image

Outcome:
image

How can I use fluminue_cli on Windows?

I downloaded the docker file and fluminus client but am not sure how to use it. Noticed fluminus client does not have .exe and I'm kinda lost how to use it. I want to use fluminus client to download webcasts and have downloaded FFMPEG, Elixir and Erlang but the Elixir and Erlang are the most updated versions.

What do I do?

Use `Briefly` to create temporary dirs

Right now all files are temporarily being downloaded to /tmp before being moved to their final destinations. However, sometimes files have the same names and conflict, and there are potentially some undefined behaviour here as the different Erlang processes step on each other

Unable to download files unless --verbose is added

Hi, I noticed this weird bug where fluminus_cli is unable to download files unless --verbose is enabled.

xxxxxx:~/fluminus_cli$ mix fluminus
Hi (name)
You are taking:
(module list)
And teaching:

xxxxxx:~/fluminus_cli$ mix fluminus --download-to=/tmp/flu
Hi (name)
You are taking:
(module list)
And teaching:

Download to /tmp/flu
^C
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
       (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
a
xxxxxx:~/fluminus_cli$ mix fluminus --show-errors --download-to=/tmp/flu
Hi (name)
You are taking:
(module list)
And teaching:

Download to /tmp/flu

03:40:09.679 [error] %FunctionClauseError{args: nil, arity: 5, clauses: nil, function: :download_file_wrapper, kind: nil, module: FluminusCLI}

03:40:09.679 [error] %FunctionClauseError{args: nil, arity: 5, clauses: nil, function: :download_file_wrapper, kind: nil, module: FluminusCLI}

# (error repeats every millisecond or so)

^C
BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
       (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
a
xxxxxx:~/fluminus_cli$ mix fluminus --verbose --show-errors --download-to=/tmp/flu
Hi (name)
You are taking:
(module list)
And teaching:

Download to /tmp/flu
Downloaded to /tmp/flu/(correct file)
xxxxxx:~/fluminus_cli$

Edit: Commented in the wrong place, sorry.

I'm on WSL, if that matters.

fluminus_cli chokes on empty multimedia

I have a multimedia file in Luminus which appears to have content (the progress bar says that it's >1h long), but the m3u8 playlist from citcastmedia.nus.edu.sg is actually empty:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ENDLIST

As a result, ffmpeg fails when it tries to transcode the stream, which causes fluminus_cli to retry silently, forever.

Windows password hiding issue.

On Windows, when logging in, the password field would look like:

username: e0123456
password: [2KK
[hidden]

The [2KK should not be there. (It is not the password but some sort of hiding character being displayed I guess?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.