Giter VIP home page Giter VIP logo

pydestreamer's Introduction

PyDestreamer


Python port of destreamer - Microsoft Stream video downloader.

This project was inspired by https://github.com/snobu/destreamer, rewritten into Python from https://github.com/sup3rgiu/MStreamDownloader.

Latest python script is available here on github.


Setup

You need Python 3.x to run the script.

Windows-specific steps

Extract the latest ffmpeg release (download from https://github.com/BtbN/FFmpeg-Builds/releases) and aria2c (download from https://github.com/aria2/aria2/releases) either into arbitrary directory and don't forget to add paths to PATH environtment variable, or simply into the directory containing the python script.

Linux-specific steps

On a fresh Debian install, run

sudo apt-get update
sudo apt-get install ffmpeg aria2 python3 python3-pip

Make sure you have installed all required modules. Most of them should be included in default python3 installation, the rest can be installed using pip:

pip install m3u8 nest_asyncio pyppeteer requests_async termcolor prompt_toolkit

Login process settings

The function async def defaultLogin(page, email, password) tries to find specific HTML elements in the login form on Microsoft Stream website. It is usually composed of default Microsoft login form and a form specific for your university/company. Element identifiers used in the python script are working for the CTU login, but you will probably need to change them slightly.

Elements corresponding to input[type="email"], input[type="submit"] and div[id="usernameError"] are common as they are located at the default Microsoft login form. When username is entered and submit button pressed the form brings you to your university/company login form - username is copied automatically, but elements input[type="password"], span[id="submitButton"] and span[id="errorText"] may be different in your case. The easiest way to find the correct identifiers is to perform the login manually with Chrome DevTools opened and focused on the required elements, then you should be able to find them in the HTML code. If the login is successful it will redirect you back to Microsoft login form to choose if password should be remembered, the "No" button corresponds to input[id="idBtn_Back"]. That is the end of the login process followed by a redirection to the Microsoft Stream homepage.

Usage

usage: PyDestreamer [-h] -v VIDEOURLS [VIDEOURLS ...] [-u USERNAME] [-p PASSWORD] [-o OUTPUTDIRECTORY] [-q QUALITY]
                    [-k NOKEYRING] [-c CONN] [-f FORMAT] [--noHeadless] [--manualLogin] [--overwrite] [--keepTemp]
                    [--showCmd]

Python port of destreamer.
Project originally based on https://github.com/snobu/destreamer.
Fork powered by @vrbadev.

optional arguments:
  -h, --help            show this help message and exit
  -v VIDEOURLS [VIDEOURLS ...], --videoUrls VIDEOURLS [VIDEOURLS ...]
                        One or more links to Microsoft Stream videos
  -u USERNAME, --username USERNAME
                        Your Microsoft Account e-mail
  -p PASSWORD, --password PASSWORD
                        Your Microsoft Account password
  -o OUTPUTDIRECTORY, --outputDirectory OUTPUTDIRECTORY
                        Save directory for videos and temporary files
  -q QUALITY, --quality QUALITY
                        Video Quality, usually [0-5]
  -k NOKEYRING, --noKeyring NOKEYRING
                        Do not use system keyring (saved password)
  -c CONN, --conn CONN  Number of simultaneous connections [1-16]
  -f FORMAT, --format FORMAT
                        Output video format, supported by ffmpeg
  --noHeadless          Don not run Chromium in headless mode
  --manualLogin         Force login manually
  --overwrite           Overwrite downloaded temporary files
  --keepTemp            Do not remove temporary files
  --showCmd             Show aria2c and ffmpeg commands executed (for debugging)

examples:
        Standard usage:
                python PyDestreamer.py -v https://web.microsoftstream.com/video/...

pydestreamer's People

Contributors

cxrloskenobi avatar vrbadev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pydestreamer's Issues

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.