# URL: https://blog.travisflix.com/download-sam-harris-making-sense-full-subscriber-podcast-episodes-for-free/ # Tested with PowerShell 5.1 on Windows and PowerShell 7.5.4 on Linux # Fetch RSS feed and extract MP3 URLs and output to file (Invoke-WebRequest -Uri 'https://rss.samharris.org/feed/5b624f14-e923-4a75-aeb9-77d11773fb91').Content -split "`n" | Where-Object { $_ -like '*mp3*' } | ForEach-Object { $_ -replace ' ' } | Out-File -FilePath '.\feed5b624f14.txt' -Encoding utf8 # Download files (skip if already exist) $urls = Get-Content -Path '.\feed5b624f14.txt' foreach ($url in $urls) { $filename = [System.IO.Path]::GetFileName($url.Split('?')[0]) $destinationPath = Join-Path -Path $pwd.Path -ChildPath $fileName if (-not (Test-Path $destinationPath)) { Invoke-WebRequest -Uri $url -OutFile $filename } }