peppelongo96 / UnicalDown

Save locally Microsoft Stream not-download-enabled videos uploaded by Università della Calabria
MIT License
9 stars 0 forks source link
aria2c coffee ffmpeg microsoft-stream miscrosoft-stream-download unical unical-stream-download universit-della-calabria video

UnicalDown v1.7.6

GitHub license made-with-Node.js GitHub contributors Ask Me Anything !

Save locally Microsoft Stream not-download-enabled videos uploaded by Università della Calabria

This project is a fork of PoliDown* that was originally based on destreamer v2.0 project.

Changelog

Initial version

Disclaimer

Hopefully this doesn't break the end user agreement for Microsoft Stream. Since we're simply saving the HLS stream to disk as if we were a browser, this does not abuse the streaming endpoints. However I take no responsibility if either Microsoft or your Office 365 admins request a chat with you in a small white room.

Important notes

  1. Script does not provided yet an effective way to refresh the access token i.e. cookies. So the execution stops on valid URLs also from a certain point onwards, if script runs for one hour or so (seems such a strict max-age session cookies. Damn Microsoft.). Any suggestions (especially) about are accepted. EDIT: Starting from destreamer v2.1, this problem seems resolved. At the same time, authors pushed an important code refactoring of all project logic. The fix could be introduced also in UnicalDown by rebasing only the access tokens managment. Howewer, it requires time to spend on it. This comment summerizes where the rebasing work must to focus on. Nothing else to say... I'm absolutely ready to merge your fork! ;)
  2. Script does not provided yet an effective and universal way to avoid PC autosleeping during the downloading process. This is the only reason for which I provide the Coffee version easy-launcher, that helps the reason in Windows at least but is clearly not the best way to go. Submit a new pull request or a new issue if you have something that could help the cause.
  3. Starting from v1.5, node-notifier module is added to enable (by default) a system of native notification for terminated downloading process. For this and to avoid any not expected bug, if you are upgrading, you need a clean installation or to just update dependencies by $ npm install command.

PREREQS

INSTALLATION INSTRUCTIONS

Windows

Videoguide provided by original PoliDown project. Just intending "UnicalDown" or "unicaldown" instead of "PoliDown" or "polidown". After finishing the installation successfully, reboot to avoid any headless chromium booting issue.

macOS/Linux

Installation is pretty much the same.

EASY-LAUNCHER

Executable .sh and .bat file are provided for a simpler script usage. Before to go, it's necessary to configure them. In general, right-click on file and choose some Edit option.

for Windows

An executable .bat file is provided. After properly settled it, just double-click on to automatically open cmd and start downloading.

Coffee version

Coffee is a portable .exe from https://sourceforge.net/projects/coffee-sc/ open source project. It provides to prevent PC standby when downloading. Coffee version just starts and also kills Coffee task after UnicalDown procedure is finished. In case of "illegal" killing problems (e.g. cmd was prematurely closed), you can exit from Coffee by right-clicking on its properly icon in notification area.

for macOS/Linux

An executable .sh file is provided. It's necessary to make it runnable: execute chmod 777 this_launcher.sh on terminal (obviously, you must navigate to project folder before). Next, always run the .sh script using terminal.

Default usage

$ node unicaldown.js -u fiscalcode -v "https://web.microsoftstream.com/video/VIDEO-1"

$ node unicaldown.js -u fiscalcode -f urlsFile.txt

You can omit the password argument. UnicalDown will ask for it interactively and then save it securely in local system's keychain for the next use.

Show options:

$ node unicaldown.js -h

Options:
  --version                      Show version number                                   [boolean]
  -v, --videoUrls                List of URLs                                            [array]
  -f, --videoUrlsFile            Path to txt file containing the URLs                   [string]
  -u, --username                 Fiscal code                                 [string] [required]
  -p, --password                                                                        [string]
  -o, --outputDirectory                                             [string] [default: "videos"]
  -q, --quality                  Video Quality [0-5]                                    [number]
  -k, --noKeyring                Do not use system keyring            [boolean] [default: false]
  -t, --noToastNotification      Disable system toast notification    [boolean] [default: false]
  -h, --help                     Show help                                             [boolean]

Multiple videos download:

$ node unicaldown.js -u fiscalcode
    -v "https://web.microsoftstream.com/video/VIDEO-1"
                "https://web.microsoftstream.com/video/VIDEO-2"
                "https://web.microsoftstream.com/video/VIDEO-3"

$ node unicaldown.js -u fiscalcode -f path/to/video/urlsFile.txt

You can create a .txt file containing video URLs, one URL for each line. The text file can have any name, only be sure that it is followed by .txt extension. Absolute path is not necessary if the .txt file is located in the unicaldown.js directory.

Define default video quality [0-5] (avoid manual prompt for each video):

$ node unicaldown.js -u fiscalcode -v "https://web.microsoftstream.com/video/VIDEO-1" -q 4

Output directory (relative or absoulte path):

$ node unicaldown.js -u fiscalcode -v "https://web.microsoftstream.com/video/VIDEO-1" -o "/my/path/here"

Do not allow system to save the password:

$ node unicaldown.js -u fiscalcode -v "https://web.microsoftstream.com/video/VIDEO-1" -k

Disable native system toast notification on finished download process:

$ node unicaldown.js -u fiscalcode -v "https://web.microsoftstream.com/video/VIDEO-1" -t