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

@howardataBIM
Copy link
Copy Markdown

Seems like teams added some authorization check. Has anyone had the following problem?: I'm trying to download read-only recording, followed all the recommendations, but i get the following error: Error opening input: Server returned 401 Unauthorized (authorization failed) image

You selected a wrong url usually 3 links appears , selected one of the others

image

I use 4 of videomanifest but i still cant download any video and this message shows to me "Error opening input files: Server returned 401 Unauthorized (authorization failed)"

@poptropica12
Copy link
Copy Markdown

poptropica12 commented Apr 16, 2026

Seems like teams added some authorization check. Has anyone had the following problem?: I'm trying to download read-only recording, followed all the recommendations, but i get the following error: Error opening input: Server returned 401 Unauthorized (authorization failed) image

You selected a wrong url usually 3 links appears , selected one of the others

image

I use 4 of videomanifest but i still cant download any video and this message shows to me "Error opening input files: Server returned 401 Unauthorized (authorization failed)"

Same here. Everything worked fine last month, but I keep getting Error opening input files: Server returned 401 Unauthorized (authorization failed) today no matter which videomanifest link I chose. Some additional authentications are likely being implemented on the server side. Hopefully someone could find a new way to get ourselves in.

Update

After some digging, the error message seems to be due to a missing access token in the URL, the query parameter access_token has to be present in the URL, which is usually missing now when we use the traditional way to retrieve, resulting in Error opening input files: Server returned 401 Unauthorized (authorization failed).

Workaround (What is currently work for me)

  1. Navigate to the directory of the video
  2. Open "Developer Tools" and navigate to the "Network" tab
  3. Use the Preview feature to preview the desired video
  4. Filter out the entry with the keyword videomanifest like before
  5. Copy the respective URL
  6. Examine the URL to check whether the access_token query parameter exists
  7. Remove the rest of the query parameters starting from altManifestMetadata
  8. Execute the FFMPEG command
ffmpeg -i "<YOUR_RESPECTIVE_URL>" -codec copy "C:\Your\Destination\Path\Video.mp4"

@BorjaMeloRamos
Copy link
Copy Markdown

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.

@poptropica12
Copy link
Copy Markdown

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

@BorjaMeloRamos
Copy link
Copy Markdown

@poptropica12 Thank you very much for the help. It really worked for me.
I download the videos from Teams and I just need to watch the video preview, and then it works as usual.
I was looking for the preview option in the ‘Developer Tools’ menu.

@LuqmanAlattas
Copy link
Copy Markdown

Seems like teams added some authorization check. Has anyone had the following problem?: I'm trying to download read-only recording, followed all the recommendations, but i get the following error: Error opening input: Server returned 401 Unauthorized (authorization failed) image

You selected a wrong url usually 3 links appears , selected one of the others

image I use 4 of videomanifest but i still cant download any video and this message shows to me "Error opening input files: Server returned 401 Unauthorized (authorization failed)"

Same here. Everything worked fine last month, but I keep getting Error opening input files: Server returned 401 Unauthorized (authorization failed) today no matter which videomanifest link I chose. Some additional authentications are likely being implemented on the server side. Hopefully someone could find a new way to get ourselves in.

Update

After some digging, the error message seems to be due to a missing access token in the URL, the query parameter access_token has to be present in the URL, which is usually missing now when we use the traditional way to retrieve, resulting in Error opening input files: Server returned 401 Unauthorized (authorization failed).

Workaround (What is currently work for me)

  1. Navigate to the directory of the video
  2. Open "Developer Tools" and navigate to the "Network" tab
  3. Use the Preview feature to preview the desired video
  4. Filter out the entry with the keyword videomanifest like before
  5. Copy the respective URL
  6. Examine the URL to check whether the access_token query parameter exists
  7. Remove the rest of the query parameters starting from altManifestMetadata
  8. Execute the FFMPEG command
ffmpeg -i "<YOUR_RESPECTIVE_URL>" -codec copy "C:\Your\Destination\Path\Video.mp4"

I followed the steps and got this error

Error opening input: Invalid data found when processing input
Error opening input file https://northeurope1-mediap.svc.ms/transform/videomanifest?provider=spo&farmid=.....
Error opening input files: Invalid data found when processing input

@LuqmanAlattas
Copy link
Copy Markdown

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

@yadav-Krishna7117
Copy link
Copy Markdown

yadav-Krishna7117 commented Apr 24, 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

@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