Orjinal Repo olup tarafımca sadece çevirilmiş ve buildi alınmıştır.
Umarız ki, Microsoft Stream için son kullanıcı sözleşmesini bozmaz. HLS akışını sanki bir web tarayıcısıymış gibi diske kaydetmekte, ve akışın uçnoktalarını kötüye kullanmamaktayız. Ancak, Microsoft veya Office 365 yöneticileriniz sizinle küçük beyaz bir odada sohbet etmek isterse hiç bir sorumluluk kabul etmiyorum :)
Direk kullanmak için (built packages) içinden işletim sisteminize göre olan ZİP dosyasınını indirin ve çalıştırın.
Nasıl kullanacağınız kısmında alt kısımda bulunan örnek kullanımlar kısmını inceleyin.
-
Node.js: 8.0 ve üstü bir Nodejs'e sahip olmanız gerekmekte, tavsiye edilen versiyon 10+ dır.
-
npm: npm genelde NodeJS indirilip kurulduktan sonra yanında kurulur, terminale
npm
yazarak varlığını kontrol edebilirsiniz. -
ffmpeg: 2019 ve üstü çıkışlı ffmpeg
$PATH
sisteminizde ortam değişkenlerinde tanımlı veya projenin ana dizininde bulunmalıdır.
ffmpeg windows için kurulum tıklayarak kurabilirsiniz.
- git: NPM paketlerinden bazıları git gerekitirmekte.
Destreamer Linux,Windows ve MacOS üzerinde test edilmiş ve çalışmaktadır.
isteğe bağlı, bu kısmı atlayabilirsiniz destramer default olarak chromium kuracak ve bu tarayıcı üzerinden MS Streame giriş yapıp indirme işlemi başlatabilir
Evet kulanabilirsiniz, Eğer tarayıcınız bir takım kimlik doğrulamak eklentileri kullanıyor ise bu doğru olur, bunu yapmak için src/destreamer.ts
dosyası içinde aşşağıdaki kod parçacığına konumlanın
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'
]
});
executablePath
kısmına kendi tarayıcınızın yolunu aşşağıdaki biçimde ekleyin
executablePath: 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe',
Dosya yolu linux ve macOS'da daha farklı gözükecektir.
Her yaptığınız konfigrasyon için (npm run build
) ile tekrardan build almanız gerektiğini unutmayın.
destrameri build etmek için üste belirtilen öngereksinimleri kurduktan sonra aşşağıdaki işlemleri izleyin.
$ git clone https://github.com/snobu/destreamer
veya
git clone https://github.com/emirkivrak/destreamer (türkçe)
$ cd destreamer
$ npm install
$ npm run build
destreamer ile yapabilecekleriniz yazmaktadır, bu standart çıktı sizde türkçe gözükecek.
$ ./destreamer.sh
Options:
--help Show help [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
you). [string]
--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.
[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.
[string] [default: "{title} - {publishDate} {uniqueId}"]
--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]
--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]
--verbose, -v Print additional information to the console (use this before opening an issue on GitHub).
[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.
[string] [default: "copy"]
--acodec Re-encode audio track. Specify FFmpeg codec (e.g. libopus) or set to "none" to disable audio.
[string] [default: "copy"]
--format Output container format (mkv, mp4, mov, anything that FFmpeg supports).
[string] [default: "mkv"]
--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). -
-o
parametresi ile tam dizin yolu vererek dosyanın nereye indirileceğini söyleyebilirsiniz/mnt/videos
. -
default olarak çıkış formatı
mkv
dir bunu--format mp4
şeklinde değiştirebilirsiniz.
örnekler linux üzerinde yapıldı, işletim sisteminize göre powershell/terminal/cmd kullanabilirsiniz
Bir video indir
$ ./destreamer.sh -i "https://web.microsoftstream.com/video/VIDEO-1"
Download a video and re-encode with HEVC (libx265) -
$ ./destreamer.sh -i "https://web.microsoftstream.com/video/VIDEO-1" --vcodec libx265
Username girişi ile msteamse bağlanma süreni kısalt -
$ ./destreamer.sh -u [email protected] -i "https://web.microsoftstream.com/video/VIDEO-1"
Download a video to a custom path -
$ ./destreamer.sh -i "https://web.microsoftstream.com/video/VIDEO-1" -o /Users/hacker/Downloads
Download two or more videos -
$ ./destreamer.sh -i "https://web.microsoftstream.com/video/VIDEO-1" \
"https://web.microsoftstream.com/video/VIDEO-2"
Download many videos but read URLs from a file -
$ ./destreamer.sh -f list.txt
You can create a .txt
file containing your video URLs, one video per line. The text file can have any name, followed by the .txt
extension.
Additionally you can have destreamer download each video in the input list to a separate directory.
These optional lines must start with white space(s).
Usage -
https://web.microsoftstream.com/video/xxxxxxxx-aaaa-xxxx-xxxx-xxxxxxxxxxxx
-dir=videos/lessons/week1
https://web.microsoftstream.com/video/xxxxxxxx-aaaa-xxxx-xxxx-xxxxxxxxxxxx
-dir=videos/lessons/week2"
The -t
option allows users to input a template string for the output file names.
You can use one or more of the following magic sequence which will get substituted at runtime. The magic sequence must be surrounded by curly brackets like this: {title} {publishDate}
title
: Video titleduration
: Video duration in HH:MM:SS formatpublishDate
: The date when the video was published in YYYY-MM-DD formatpublishTime
: The time the video was published in HH:MM:SS formatauthor
: Name of video publisherauthorEmail
: E-mail of video publisheruniqueId
: An unique-enough ID generated from the video metadata
Example -
Input:
-t '{title} - {duration} - {publishDate} - {publishTime} - {author} - {authorEmail} - {uniqueId}'
Expected filename:
This is an example - 0:16:18 - 2020-07-30 - 10:30:13 - lukaarma - [email protected] - #3c6ca929.mkv
Windows Terminal -
iTerm2 on a Mac -
By default, downloads are saved under project root Destreamer/videos/
( Not the system media Videos folder ), unless specified by -o
(output directory).
İşletim sistemninize göre doğru scripti ve kaçış karakterini kullandığınıza emin olun (.sh
, .ps1
or .cmd
)
PowerShell backtick [ ` ] ve cmd.exe caret kullanmakta[ ^ ].
Note that destreamer won't run in an elevated (Administrator/root) shell. Running inside Cygwin/MinGW/MSYS may also fail, please use cmd.exe or PowerShell if you're on Windows.
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) and exporting the default display to it (export DISPLAY=:0
) before running destreamer. See this issue for more on WSL v1 and v2.
Contributions are welcome. Open an issue first before sending in a pull request. All pull requests require at least one code review before they are merged to master.
Please open an issue and we'll look into it.