Skip to content

Instantly share code, notes, and snippets.

@mfd
Last active November 12, 2025 22:28
Show Gist options
  • Save mfd/c990a01d626847a6d7e823dceca598e1 to your computer and use it in GitHub Desktop.
Save mfd/c990a01d626847a6d7e823dceca598e1 to your computer and use it in GitHub Desktop.
Download any video from Microsoft Teams, SharePoint and OneDrive
2teams() {
NOW=$(date +"%Y-%m-%d_%H%M")
if [ ! -z $2 ] ; then
echo $NOW"_"$2.mp4
ffmpeg -i $1 -codec copy $NOW"_"$2.mp4
else
echo $NOW"_teamsvid".mp4
ffmpeg -i $1 -codec copy $NOW"_teamsvideo".mp4
fi
}

Download any video from Microsoft Teams, SharePoint and OneDrive

Videos like

- https://{ORGID}.sharepoint.com/personal/{USERID}/_layouts/15/stream.aspx?id={VIDEOID}%2Emp4&ga=1
- https://{ORGID}.sharepoint.com/:v:/p/{USERID}/{VIDEOID}
  1. Run video from SharePoint corporate account or OneDrive,
  2. In Chrome open Web inspector and in Network filter by videomanifest
  3. Copy this url
  4. Run ffmpeg -i "%URL%" -codec copy outputvideo.mp4

chrome

@agaramja
Copy link

agaramja commented Jun 5, 2025

2. videomanifest

But didn't find any URL to copy. The "videomanifest" is just an empty search.

Uhere is the URL

@tom10271
Copy link

tom10271 commented Jun 13, 2025

I created an extension (with ChatGPT) that generates an FFmpeg command for downloading videos from SharePoint. It also allows you to download the transcription file. You can try it out here: https://github.com/MexxDirkx/SharePoint-Video-Downloader-Extension.

How to use can you please guide in detail.

It is a Google Chrome extension. The current master commit is working fine for me. You can download and unzip the extension by https://github.com/MexxDirkx/SharePoint-Video-Downloader-Extension/archive/refs/heads/main.zip. Once unzipped go to chrome://extensions/ using Google Chrome and enable Developer mode on the top right corner, click Load unpacked, go to the unzipped folder and click select. You should see the extension enabled.
Screenshot 2025-06-13 at 4 55 06 PM

Go to the Sharepoint video page you would like to download and click the extension icon then Detect video and copy the generated FFMPEG command to download the video.
Screenshot 2025-06-13 at 4 53 20 PM

@groovyle
Copy link

groovyle commented Sep 2, 2025

this still works for me, some notes:

  • copy the url fully decoded/raw (no escapes)
  • copy the url up to the query param &format=dash
  • from that url, remove the query param cTag (the one that has quotes in its value)
  • i'm on windows terminal, so i put quotes around the url; idk if i needed to remove the cTag also because of this, i tried escaping those quotes with "" but it failed anyway, so i tried to just remove cTag and it worked

@haskyhub-ctrl
Copy link

I created an extension (with ChatGPT) that generates an FFmpeg command for downloading videos from SharePoint. It also allows you to download the transcription file. You can try it out here: https://github.com/MexxDirkx/SharePoint-Video-Downloader-Extension.

Is there any way to download other files like pdf, word?

@diegofenner
Copy link

For anyone using ffmepg by default ffmpeg automatically picks the first or lowest index, stream. SharePoint has the lowest quality streams being the first index and the highest quality streams are the higher indexes.

If you'd like higher quality streams use ffprobe then ffmpeg.

ffprobe -i "VIDEO_MANIFEST_URL" -show_streams

Identify the best video and audio stream indexes

then ffmpeg -i "VIDEO_MANIFEST_URL_HERE" -map 0:3 -map 0:7 -c copy output.mp4 (Replace 3 and 7 with your desired video and audio stream indexes)

Great answer! I hope it reduces the downloaded file, since my specific situation has 3 video and 4 audio streams. Testing it right now. Thanks!

image image

@diegofenner
Copy link

update:
Despite the error at the end, I can watch the video.
image

@JavierSolis
Copy link

until dash work for me

@mm-rpl
Copy link

mm-rpl commented Oct 24, 2025

@Adamus2396 @guangxuanliu @IronWill2024 @vitkolar This solution works for me for sharepoint videos, it uses yt-dlp downloader
yt-dlp "URL until dash" -o "video.mp4"

Thank u. it work!

Error: This video is DRM protected :(

@mm-rpl
Copy link

mm-rpl commented Oct 24, 2025

For anyone using ffmepg by default ffmpeg automatically picks the first or lowest index, stream. SharePoint has the lowest quality streams being the first index and the highest quality streams are the higher indexes.
If you'd like higher quality streams use ffprobe then ffmpeg.
ffprobe -i "VIDEO_MANIFEST_URL" -show_streams
Identify the best video and audio stream indexes
then ffmpeg -i "VIDEO_MANIFEST_URL_HERE" -map 0:3 -map 0:7 -c copy output.mp4 (Replace 3 and 7 with your desired video and audio stream indexes)

Error: Error when loading first fragment of playlist

@dsmabulage
Copy link

Is there a method to speed up the download

@yousaf2k
Copy link

yousaf2k commented Nov 8, 2025

I created a desktop application in C# WPF for easy downloading.
https://github.com/yousaf2k/SharepointVideoDownloader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment