Skip to content

Instantly share code, notes, and snippets.

@mfd
Last active May 21, 2026 18:38
Show Gist options
  • Select an option

  • Save mfd/c990a01d626847a6d7e823dceca598e1 to your computer and use it in GitHub Desktop.

Select an option

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

@fernandohenriquecm-ops
Copy link
Copy Markdown

Error opening input: Server returned 401 Unauthorized (authorization failed)
Error opening input file https:// ...

@Mohamed-Tawfik-DS
Copy link
Copy Markdown

any update regarding this issue ? is there any other way

@dsmabulage
Copy link
Copy Markdown

any update

@majid3612
Copy link
Copy Markdown

I fixed error 401 in this branch:
https://github.com/majid3612/SharePointVideoDownloader/tree/feature/already-installed-browser-support

dotnet run -- --browser-path "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" -v -u "https://your-tenant-my.sharepoint.com/.../stream.aspx?id=..." --capture -o "meeting.mp4" --ffmpeg-path "PATH-TO-YOUR-ffmpeg.exe"

@shebenu
Copy link
Copy Markdown

shebenu commented May 17, 2026

I fixed error 401 in this branch: https://github.com/majid3612/SharePointVideoDownloader/tree/feature/already-installed-browser-support

dotnet run -- --browser-path "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" -v -u "https://your-tenant-my.sharepoint.com/.../stream.aspx?id=..." --capture -o "meeting.mp4" --ffmpeg-path "PATH-TO-YOUR-ffmpeg.exe"

Capture: no video element appeared within 30 s.

@majid3612
Copy link
Copy Markdown

I fixed error 401 in this branch: https://github.com/majid3612/SharePointVideoDownloader/tree/feature/already-installed-browser-support
dotnet run -- --browser-path "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" -v -u "https://your-tenant-my.sharepoint.com/.../stream.aspx?id=..." --capture -o "meeting.mp4" --ffmpeg-path "PATH-TO-YOUR-ffmpeg.exe"

Capture: no video element appeared within 30 s.

Elaborate more on the issue. Logs, screenshots, etc. of what you get...

@LuqmanAlattas
Copy link
Copy Markdown

LuqmanAlattas commented May 19, 2026

nvm I used the same url with yt-dlp and it works. Don't know what the issue with ffmpeg

can you share me the steps how to download with yt-dlp

sorry for the late reply, First I used homebrew on my Mac to download yt-dlp here

then I used this command

yt-dlp "<YOUR_VIDEO_URL>" -o "C:\Your\Destination\Path\Video.mp4"

to get the video link, follow the steps from @poptropica12 above

@fernandohenriquecm-ops
Copy link
Copy Markdown

any update?

@shebenu
Copy link
Copy Markdown

shebenu commented May 21, 2026

Workaround (What is currently work for me)
Navigate to the directory of the video
Open "Developer Tools" and navigate to the "Network" tab
Use the Preview feature to preview the desired video
Filter out the entry with the keyword videomanifest like before
Copy the respective URL
Examine the URL to check whether the access_token query parameter exists
Remove the rest of the query parameters starting from altManifestMetadata
Execute the FFMPEG command

@poptropica12 Could you please explain point 3 and 4 in more detail?
I'm not sure if the preview option I'm using is the one I should be using.

When you navigate to the video directory, right-click on the particular video you desire, which should open a context menu, and on the context menu, you should see a Preview option available (It is recommended to turn on "Developer Tools" right before this step). image

that's working for me (yt-dlp + teams for web)

@brendangooden
Copy link
Copy Markdown

brendangooden commented May 21, 2026

Anyone having issues with 401 could checkout my Chrome Extension as I recently fixed this.

https://github.com/brendangooden/ms-teams-sharepoint-downloader

https://teamsvideotranscriptexporter.com/

Video / Audio download

  • In-browser download — Video+Audio (MP4), Audio Only (M4A), or Video Only. No extra tools needed.
  • Editable filename — auto-derived from the page title.
  • Floating banner widget as a fallback for when the SharePoint command bar re-renders or hides the button.

Transcript download

  • Automatic detection — the extension watches for the transcript metadata call and adds a Download Transcript button.
  • Three formats — RAW JSON, standard WebVTT, or Grouped VTT (consecutive lines from the same speaker collapsed into a block).
  • Live preview of each format in the modal.
  • Last-used format remembered across sessions.
  • Clear dialog if the meeting was never transcribed, instead of a silent failure.
{78F4CBE1-75D2-4EFB-AA87-14BCE0517283} Screenshot 2026-05-21 142245

@majid3612
Copy link
Copy Markdown

Anyone having issues with 401 could checkout my Chrome Extension as I recently fixed this.

https://github.com/brendangooden/ms-teams-sharepoint-downloader

https://teamsvideotranscriptexporter.com/

Video / Audio download

  • In-browser download — Video+Audio (MP4), Audio Only (M4A), or Video Only. No extra tools needed.
  • Editable filename — auto-derived from the page title.
  • Floating banner widget as a fallback for when the SharePoint command bar re-renders or hides the button.

Transcript download

  • Automatic detection — the extension watches for the transcript metadata call and adds a Download Transcript button.
  • Three formats — RAW JSON, standard WebVTT, or Grouped VTT (consecutive lines from the same speaker collapsed into a block).
  • Live preview of each format in the modal.
  • Last-used format remembered across sessions.
  • Clear dialog if the meeting was never transcribed, instead of a silent failure.

{78F4CBE1-75D2-4EFB-AA87-14BCE0517283} Screenshot 2026-05-21 142245

Great job!
Thanks!

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