<commit_before>﻿import-module au
import-module "../../extensions/extensions.psm1"

$releases = 'https://support.apple.com/kb/DL837?locale=en_US'

function global:au_SearchReplace {
  @{
    ".\tools\chocolateyInstall.ps1" = @{
      "(?i)(^\s*-Url\s+)('.*')"            = "`$1'$($Latest.URL32)'"
      "(?i)(^\s*-Checksum\s+)('.*')"       = "`$1'$($Latest.Checksum32)'"
      "(?i)(^\s*-ChecksumType\s+)('.*')"   = "`$1'$($Latest.ChecksumType32)'"
    }
  }
}

function global:au_GetLatest {
  $download_page = Invoke-WebRequest -UseBasicParsing -Uri $releases

  $re    = 'https:\/\/secure-appldnld\.apple\.com\/QuickTime\/[a-zA-Z\d\-\.]+\/QuickTimeInstaller\.exe'
  $download_page.content -match $re | Out-Null
  $url = $Matches[0]

  $re    = 'strTitle"\s*:\s*"[^\d\.]+([\d\.]+)[^"]+'
  $download_page.content -match $re | Out-Null
  $version  = $Matches[1]

  @{
    URL32 = $url
    Version = $version
  }
}

update -ChecksumFor 32<commit_msg>(quicktime) 'access denied' ignored<commit_after>﻿import-module au
import-module "../../extensions/extensions.psm1"

$releases = 'https://support.apple.com/kb/DL837?locale=en_US'

function global:au_SearchReplace {
    @{
        ".\tools\chocolateyInstall.ps1" = @{
        "(?i)(^\s*-Url\s+)('.*')"            = "`$1'$($Latest.URL32)'"
        "(?i)(^\s*-Checksum\s+)('.*')"       = "`$1'$($Latest.Checksum32)'"
        "(?i)(^\s*-ChecksumType\s+)('.*')"   = "`$1'$($Latest.ChecksumType32)'"
        }
    }
}

function global:au_GetLatest {
    $download_page = Invoke-WebRequest -UseBasicParsing -Uri $releases

    $re = 'https:\/\/secure-appldnld\.apple\.com\/QuickTime\/[a-zA-Z\d\-\.]+\/QuickTimeInstaller\.exe'
    $download_page.content -match $re | Out-Null
    $url = $Matches[0]

    $re = 'strTitle"\s*:\s*"[^\d\.]+([\d\.]+)[^"]+'
    $download_page.content -match $re | Out-Null
    $version = $Matches[1]
    @{
        URL32   = $url
        Version = $version
    }
}

try {
    update -ChecksumFor 32
} catch {
    if ($_ -match 'Access Denied') { Write-Host 'Access Denied error'; 'ignored' }  else { throw $_ }
}
{'fraction_non_alphanumeric': 0.24278846153846154, 'fraction_numerical': 0.019230769230769232, 'mean_word_length': 2.8253676470588234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5976759', 'n_tokens_mistral': 864, 'n_tokens_neox': 820, 'n_words': 105}