mirror of
https://github.com/snobu/destreamer.git
synced 2026-02-21 13:59:44 +00:00
Merge branch 'master' of https://github.com/snobu/destreamer into aria2c_forRealNow
This commit is contained in:
20
.github/ISSUE_TEMPLATE/report-trouble.md
vendored
20
.github/ISSUE_TEMPLATE/report-trouble.md
vendored
@@ -7,6 +7,24 @@ assignees: ''
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## PLEASE NEVER PASTE YOUR ACCESS TOKEN INTO A GITHUB ISSUE AS IT MAY CONTAIN PRIVATE INFORMATION
|
<!--
|
||||||
|
# BEFORE OPENING A NEW ISSUE CHECK THE EXISTING ONES AND RUN DESTREAMER WITH THE -v/--verbose flag and paste down below the output
|
||||||
|
|
||||||
|
# NEVER PASTE YOUR ACCESS TOKEN INTO A GITHUB ISSUE AS IT MAY CONTAIN PRIVATE INFORMATION
|
||||||
When you paste in output from destreamer, locate your access token (it looks like this: `Authorization: Bearer eyJ....<a lot more base64 encoded text>.....`) and redact it.
|
When you paste in output from destreamer, locate your access token (it looks like this: `Authorization: Bearer eyJ....<a lot more base64 encoded text>.....`) and redact it.
|
||||||
|
|
||||||
|
# Please fill the form below to give us some more info.
|
||||||
|
-->
|
||||||
|
|
||||||
|
OS:
|
||||||
|
|
||||||
|
Launch command used:
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Verbose log</summary>
|
||||||
|
|
||||||
|
```
|
||||||
|
PASTE VERBOSE LOG HERE
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|||||||
66
README.md
66
README.md
@@ -2,6 +2,15 @@
|
|||||||
<img src="https://github.com/snobu/destreamer/workflows/Node%20CI/badge.svg" alt="CI build status" />
|
<img src="https://github.com/snobu/destreamer/workflows/Node%20CI/badge.svg" alt="CI build status" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
# BREAKING
|
||||||
|
|
||||||
|
**destreamer v3.0** is just around the corner. Download speed improvement is astonishing and we have a never before seen photo from the design sessions:<br><br>
|
||||||
|

|
||||||
|
|
||||||
|
Help us pick a codename for the new release:<br><br>
|
||||||
|
<br><br>
|
||||||
|
Comment in this thread: https://github.com/snobu/destreamer/issues/223
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
_(Alternative artwork proposals are welcome! Submit one through an Issue.)_
|
_(Alternative artwork proposals are welcome! Submit one through an Issue.)_
|
||||||
@@ -52,6 +61,33 @@ Note that destreamer won't run in an elevated (Administrator/root) shell. Runnin
|
|||||||
|
|
||||||
**WSL** (Windows Subsystem for Linux) is not supported as it can't easily pop up a browser window. It *may* work by installing an X Window server (like [Xming][xming]) and exporting the default display to it (`export DISPLAY=:0`) before running destreamer. See [this issue for more on WSL v1 and v2][wsl].
|
**WSL** (Windows Subsystem for Linux) is not supported as it can't easily pop up a browser window. It *may* work by installing an X Window server (like [Xming][xming]) and exporting the default display to it (`export DISPLAY=:0`) before running destreamer. See [this issue for more on WSL v1 and v2][wsl].
|
||||||
|
|
||||||
|
## Can i plug in my own browser?
|
||||||
|
|
||||||
|
Yes, yes you can. This may be useful if your main browser has some authentication plugins that are required for you to logon to your Microsoft Stream tenant.
|
||||||
|
To use your own browser for the authentication part, locate the following snippet in `src/destreamer.ts`:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const browser: puppeteer.Browser = await puppeteer.launch({
|
||||||
|
executablePath: getPuppeteerChromiumPath(),
|
||||||
|
headless: false,
|
||||||
|
userDataDir: (argv.keepLoginCookies) ? chromeCacheFolder : undefined,
|
||||||
|
args: [
|
||||||
|
'--disable-dev-shm-usage',
|
||||||
|
'--fast-start',
|
||||||
|
'--no-sandbox'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, change `executablePath` to reflect the path to your browser and profile (i.e. to use Microsoft Edge on Windows):
|
||||||
|
```typescript
|
||||||
|
executablePath: "'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' --profile-directory=Default",
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that for Mac/Linux the path will look a little different but no other changes are necessary.
|
||||||
|
|
||||||
|
You need to rebuild (`npm run build`) every time you change this configuration.
|
||||||
|
|
||||||
## How to build
|
## How to build
|
||||||
|
|
||||||
To build destreamer clone this repository, install dependencies and run the build script -
|
To build destreamer clone this repository, install dependencies and run the build script -
|
||||||
@@ -72,31 +108,35 @@ Options:
|
|||||||
--help Show help [boolean]
|
--help Show help [boolean]
|
||||||
--version Show version number [boolean]
|
--version Show version number [boolean]
|
||||||
--username, -u The username used to log into Microsoft Stream (enabling this will fill in the email field for
|
--username, -u The username used to log into Microsoft Stream (enabling this will fill in the email field for
|
||||||
you) [string]
|
you). [string]
|
||||||
--videoUrls, -i List of video urls [array]
|
--videoUrls, -i List of urls to videos or Microsoft Stream groups. [array]
|
||||||
--inputFile, -f Path to text file containing URLs and optionally outDirs. See the README for more on outDirs.
|
--inputFile, -f Path to text file containing URLs and optionally outDirs. See the README for more on outDirs.
|
||||||
[string]
|
[string]
|
||||||
|
--outputDirectory, -o The directory where destreamer will save your downloads. [string] [default: "videos"]
|
||||||
--outputTemplate, -t The template for the title. See the README for more info.
|
--outputTemplate, -t The template for the title. See the README for more info.
|
||||||
[string] [default: "{title} - {publishDate} {uniqueId}"]
|
[string] [default: "{title} - {publishDate} {uniqueId}"]
|
||||||
--outputDirectory, -o The directory where destreamer will save your downloads [string] [default: "videos"]
|
--keepLoginCookies, -k Let Chromium cache identity provider cookies so you can use "Remember me" during login.
|
||||||
--keepLoginCookies, -k Let Chromium cache identity provider cookies so you can use "Remember me" during login
|
Must be used every subsequent time you launch Destreamer if you want to log in automatically.
|
||||||
[boolean] [default: false]
|
[boolean] [default: false]
|
||||||
--noExperiments, -x Do not attempt to render video thumbnails in the console [boolean] [default: false]
|
--noExperiments, -x Do not attempt to render video thumbnails in the console. [boolean] [default: false]
|
||||||
--simulate, -s Disable video download and print metadata information to the console[boolean] [default: false]
|
--simulate, -s Disable video download and print metadata information to the console.
|
||||||
--verbose, -v Print additional information to the console (use this before opening an issue on GitHub)
|
|
||||||
[boolean] [default: false]
|
[boolean] [default: false]
|
||||||
--closedCaptions, --cc Check if closed captions are aviable and let the user choose which one to download (will not
|
--verbose, -v Print additional information to the console (use this before opening an issue on GitHub).
|
||||||
ask if only one aviable) [boolean] [default: false]
|
[boolean] [default: false]
|
||||||
--noCleanup, --nc Do not delete the downloaded video file when an FFmpeg error occurs [boolean] [default: false]
|
--closedCaptions, --cc Check if closed captions are available and let the user choose which one to download (will not
|
||||||
|
ask if only one available). [boolean] [default: false]
|
||||||
|
--noCleanup, --nc Do not delete the downloaded video file when an FFmpeg error occurs.[boolean] [default: false]
|
||||||
--vcodec Re-encode video track. Specify FFmpeg codec (e.g. libx265) or set to "none" to disable video.
|
--vcodec Re-encode video track. Specify FFmpeg codec (e.g. libx265) or set to "none" to disable video.
|
||||||
[string] [default: "copy"]
|
[string] [default: "copy"]
|
||||||
--acodec Re-encode audio track. Specify FFmpeg codec (e.g. libopus) or set to "none" to disable audio.
|
--acodec Re-encode audio track. Specify FFmpeg codec (e.g. libopus) or set to "none" to disable audio.
|
||||||
[string] [default: "copy"]
|
[string] [default: "copy"]
|
||||||
--format Output container format (mkv, mp4, mov, anything that FFmpeg supports)
|
--format Output container format (mkv, mp4, mov, anything that FFmpeg supports).
|
||||||
[string] [default: "mkv"]
|
[string] [default: "mkv"]
|
||||||
--skip Skip download if file already exists [boolean] [default: false]
|
--skip Skip download if file already exists. [boolean] [default: false]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- both --videoUrls and --inputFile also accept Microsoft Teams Groups url so if your Organization placed the videos you are interested in a group you can copy the link and Destreamer will download all the videos it can inside it! A group url looks like this https://web.microsoftstream.com/group/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
||||||
|
|
||||||
- Passing `--username` is optional. It's there to make logging in faster (the username field will be populated automatically on the login form).
|
- Passing `--username` is optional. It's there to make logging in faster (the username field will be populated automatically on the login form).
|
||||||
|
|
||||||
- You can use an absolute path for `-o` (output directory), for example `/mnt/videos`.
|
- You can use an absolute path for `-o` (output directory), for example `/mnt/videos`.
|
||||||
@@ -178,7 +218,7 @@ iTerm2 on a Mac -
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
By default, downloads are saved under `videos/` unless specified by `-o` (output directory).
|
By default, downloads are saved under project root `Destreamer/videos/` ( Not the system media Videos folder ), unless specified by `-o` (output directory).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ export class ApiClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to initialize/retrive the active ApiClient
|
||||||
|
*
|
||||||
|
* @param session used if initializing
|
||||||
|
*/
|
||||||
public static getInstance(session?: Session): ApiClient {
|
public static getInstance(session?: Session): ApiClient {
|
||||||
if (!ApiClient.instance) {
|
if (!ApiClient.instance) {
|
||||||
ApiClient.instance = new ApiClient(session);
|
ApiClient.instance = new ApiClient(session);
|
||||||
@@ -51,6 +56,16 @@ export class ApiClient {
|
|||||||
return ApiClient.instance;
|
return ApiClient.instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setSession(session: Session): void {
|
||||||
|
if (!ApiClient.instance) {
|
||||||
|
logger.warn("Trying to update ApiCient session when it's not initialized!");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.session = session;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call Microsoft Stream API. Base URL is sourced from
|
* Call Microsoft Stream API. Base URL is sourced from
|
||||||
* the session object and prepended automatically.
|
* the session object and prepended automatically.
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ export const argv: any = yargs.options({
|
|||||||
username: {
|
username: {
|
||||||
alias: 'u',
|
alias: 'u',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
describe: 'The username used to log into Microsoft Stream (enabling this will fill in the email field for you)',
|
describe: 'The username used to log into Microsoft Stream (enabling this will fill in the email field for you).',
|
||||||
demandOption: false
|
demandOption: false
|
||||||
},
|
},
|
||||||
videoUrls: {
|
videoUrls: {
|
||||||
alias: 'i',
|
alias: 'i',
|
||||||
describe: 'List of video urls',
|
describe: 'List of urls to videos or Microsoft Stream groups.',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
demandOption: false
|
demandOption: false
|
||||||
},
|
},
|
||||||
@@ -30,7 +30,7 @@ export const argv: any = yargs.options({
|
|||||||
},
|
},
|
||||||
outputDirectory: {
|
outputDirectory: {
|
||||||
alias: 'o',
|
alias: 'o',
|
||||||
describe: 'The directory where destreamer will save your downloads',
|
describe: 'The directory where destreamer will save your downloads.',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: 'videos',
|
default: 'videos',
|
||||||
demandOption: false
|
demandOption: false
|
||||||
@@ -44,28 +44,29 @@ export const argv: any = yargs.options({
|
|||||||
},
|
},
|
||||||
keepLoginCookies: {
|
keepLoginCookies: {
|
||||||
alias: 'k',
|
alias: 'k',
|
||||||
describe: 'Let Chromium cache identity provider cookies so you can use "Remember me" during login',
|
describe: 'Let Chromium cache identity provider cookies so you can use "Remember me" during login.\n' +
|
||||||
|
'Must be used every subsequent time you launch Destreamer if you want to log in automatically.',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
demandOption: false
|
demandOption: false
|
||||||
},
|
},
|
||||||
noExperiments: {
|
noExperiments: {
|
||||||
alias: 'x',
|
alias: 'x',
|
||||||
describe: 'Do not attempt to render video thumbnails in the console',
|
describe: 'Do not attempt to render video thumbnails in the console.',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
demandOption: false
|
demandOption: false
|
||||||
},
|
},
|
||||||
simulate: {
|
simulate: {
|
||||||
alias: 's',
|
alias: 's',
|
||||||
describe: 'Disable video download and print metadata information to the console',
|
describe: 'Disable video download and print metadata information to the console.',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
demandOption: false
|
demandOption: false
|
||||||
},
|
},
|
||||||
verbose: {
|
verbose: {
|
||||||
alias: 'v',
|
alias: 'v',
|
||||||
describe: 'Print additional information to the console (use this before opening an issue on GitHub)',
|
describe: 'Print additional information to the console (use this before opening an issue on GitHub).',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
demandOption: false
|
demandOption: false
|
||||||
@@ -92,13 +93,13 @@ export const argv: any = yargs.options({
|
|||||||
demandOption: false
|
demandOption: false
|
||||||
},
|
},
|
||||||
format: {
|
format: {
|
||||||
describe: 'Output container format (mkv, mp4, mov, anything that FFmpeg supports)',
|
describe: 'Output container format (mkv, mp4, mov, anything that FFmpeg supports).',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: 'mkv',
|
default: 'mkv',
|
||||||
demandOption: false
|
demandOption: false
|
||||||
},
|
},
|
||||||
skip: {
|
skip: {
|
||||||
describe: 'Skip download if file already exists',
|
describe: 'Skip download if file already exists.',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false,
|
default: false,
|
||||||
demandOption: false
|
demandOption: false
|
||||||
|
|||||||
Reference in New Issue
Block a user