This guide is about downloading videos hosted by Vidyard.

Preparation

  1. Download ffmpeg. Make sure it’s available from command line: ffmpeg -version.
  2. Store the following to a file with a .ps1 extension, for example, run.ps1.
    $videoId = "p7wUpKvOKku1XCEsntsLQQ"
    $refererId = "Mw2MQEkGAGn1j1NW6XcjUa"
    
    if (test-path input.txt) {
      Remove-Item input.txt
    }
    
    $session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
    $session.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36"
    
    $i = 1
    for (; ; $i++) {
      $num = "$i"
      while ($num.Length -lt 3) {
        $num = "0" + $num
      }
    
      try {
        Invoke-WebRequest -UseBasicParsing -Uri "<https://cdn.vidyard.com/media/hls/>$videoId/,full_hd,hd,480p,sd,.mp4.urlset/seg-$num-f2-v1-a1.ts" `
          -WebSession $session `
          -OutFile f_$num.ts `
          -Headers @{
          "authority"       = "cdn.vidyard.com"
          "method"          = "GET"
          "path"            = "/media/hls/$videoId/,full_hd,hd,480p,sd,.mp4.urlset/seg-$num-f2-v1-a1.ts"
          "scheme"          = "https"
          "accept"          = "*/*"
          "accept-encoding" = "gzip, deflate, br"
          "accept-language" = "en-US,en;q=0.9,pl;q=0.8,ru;q=0.7"
          "origin"          = "https://play.vidyard.com"
          "referer"         = "https://play.vidyard.com/$refererId.html?autoplay=0&custom_id=&embed_button=0&referrer=https%3A%2F%2Fwww.patreon.com%2F&viral_sharing=0"
          "sec-fetch-dest"  = "empty"
          "sec-fetch-mode"  = "cors"
          "sec-fetch-site"  = "same-site"
          "sec-gpc"         = "1"
        }
      }
      catch {
        break
      }
    
      Add-Content -Path input.txt  -Value "file f_$num.ts"
    }
    
    ffmpeg -f concat -i input.txt output.mp4
    
    # Use the following for lossless conversion. Has hiccups in VLC on Android.
    # ffmpeg -f concat -i input.txt output.mp4 -c copy
    
    # Remove intermediate files
    rm *.ts

Execution

  1. Open the webpage with the video. Start playback. Choose video quality.
  2. Open developer tools by pressing F12. Go to Network tab.
  3. Note the video segments downloading one by one. Right-click on any of them and copy as fetch.
  4. You’ll have something like the following.
    fetch("https://cdn.vidyard.com/media/hls/p7wUpKvOKku1XCEsntsLQQ/,full_hd,hd,480p,sd,.mp4.urlset/seg-8-f2-v1-a1.ts", {
      "headers": {
        "accept": "*/*",
        "accept-language": "en-US,en;q=0.9,pl;q=0.8,ru;q=0.7",
        "if-none-match": "\"-1-9bc78\"",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-site",
        "sec-gpc": "1"
      },
      "referrer": "https://play.vidyard.com/Hd4tPpuMrAMMpSTeB8rzFX.html?autoplay=0&custom_id=&embed_button=0&referrer=https%3A%2F%2Fwww.patreon.com%2F&viral_sharing=0",
      "referrerPolicy": "no-referrer-when-downgrade",
      "body": null,
      "method": "GET",
      "mode": "cors",
      "credentials": "omit"
    });
    
  5. Copy two values from here - the id from the top line (here — p7wUpKvOKku1XCEsntsLQQ) and the referrer id from the second url (here — Hd4tPpuMrAMMpSTeB8rzFX). Paste these two values into appropriate values in the top lines of our run.ps1:
    $videoId = "p7wUpKvOKku1XCEsntsLQQ"
    $refererId = "Mw2MQEkGAGn1j1NW6XcjUa"
    
    ...
  6. Open a Powershell command prompt in the folder with run.ps1.
  7. Execute the file: ./run.ps1.
  8. Wait for process to finish. If there are any red lines in the output, re-run the file.

Notes

As stated in the Powershell file template, it’s possible to add an option -c copy to the ffmpeg call in order to make it concat the files in a lossless manner. However, that proved to cause hick-ups in VLC on Android, so be aware of that.