Skip to content

Instantly share code, notes, and snippets.

@brett-schneider
Forked from mfd/teams.sh
Last active October 6, 2025 11:53
Show Gist options
  • Select an option

  • Save brett-schneider/c5ba5f5247e6d3e71275a0db2aed43e6 to your computer and use it in GitHub Desktop.

Select an option

Save brett-schneider/c5ba5f5247e6d3e71275a0db2aed43e6 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 up to and including &format=dash
  4. Run ffmpeg -i "%URL%" -codec copy outputvideo.mp4yt-dlp '${URL}' -o <filename>

chrome

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