Code Monkey home page Code Monkey logo

polidown's Introduction

PoliDown

Saves Microsoft Stream videos uploaded by Politecnico di Milano.

This project was originally based on https://github.com/snobu/destreamer

Improvements in this fork:

  • PoliMi autologin
  • Multithreading download through aria2c
  • Possibility to choose the video resolution

PREREQS

  • Node.js: anything above v8.0 seems to work.
  • [NO MORE REQUIRED] youtube-dl: you'll need a fairly recent version that understands encrypted HLS streams. This needs to be in your $PATH (for example, copy youtube-dl.exe to c:\windows). PoliDown calls youtube-dl with a bunch of arguments.
  • aria2: this needs to be in your $PATH (for example, copy aria2c.exe to c:\windows). PoliDown calls aria2c with a bunch of arguments in order to improve the download speed.
  • ffmpeg: a recent version (year 2019 or above), in $PATH. On Windows, the nightly build is required.

Windows Installation instructions

(On others OS is pretty much the same)

https://user-images.githubusercontent.com/7725068/76635047-21a89080-6547-11ea-8da9-31831ca7620a.png

USAGE

  • Clone this repo
  • cd into the cloned folder
  • npm install to install dependencies

Default usage:

$ node polidown.js --username CODICEPERSONA --videoUrls "https://web.microsoftstream.com/video/VIDEO-1"

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

Show options:

$ node polidown.js -h

Options:
  --version              Show version number                           [boolean]
  -v, --videoUrls                                             [array] [required]
  -u, --username         Codice Persona PoliMi               [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]
  -h, --help             Show help                                     [boolean]

Multiple videos download:

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

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

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

Output directory (relative or absoulte path):

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

Do not use system keyring to save the password:

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

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

EXPECTED OUTPUT

Project originally based on https://github.com/snobu/destreamer
Fork powered by @sup3rgiu
Improvements: PoliMi Autologin - Multithreading download (much faster) - Video Quality Choice
Using aria2 version 1.35.0
Using ffmpeg version git-2020-03-06-cfd9a65 Copyright (c) 2000-2020 the FFmpeg developers

Launching headless Chrome to perform the OpenID Connect dance...
Navigating to STS login page...
Filling in Servizi Online login form...
We are logged in.

Start downloading video: https://web.microsoftstream.com/video/d1e6c909-3189-488f-8172-e88947249f02
Got required authentication cookies.
Looking up AMS stream locator...

Video title is: SALIONI ALBERTO  088805-FISICA TECNICA (712804)

[0] 320x180
[1] 480x270
[2] 640x360
[3] 960x540
[4] 1280x720
[5] 1920x1080
Choose the desired resolution: 5

03/10 20:47:14 [NOTICE] Downloading 898 item(s)

[...]

At this point Chrome's job is done, shutting it down...
Done!

The video is now saved under videos/, or whatever the outputDirectory argument points to.

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.