Once uploaded, your titles will be available for copy identification on WebScan:
# create a wk directory
$ mkdir wk
# go to the wk directory
$ cd wk
# create two more directories
$ mkdir videos
$ mkdir fingerprints
video1.mp4,Algiers,1938,0
video2.mp4,Captain Kidd,1945,0
video3.avi,First of Us,2023,1,1,1
video4.avi,First of Us,2023,1,1,2
# Download the script
$ Invoke-WebRequest -Uri "http://bit.ly/WKuploadWindows" -OutFile "upload.ps1"
# Make the script executable
$ Set-ItemProperty -Path .\upload.ps1 -Name IsReadOnly $false
# Read CSV file, specifying headers since the file does not include them
$headers = @('VideoFile', 'Title', 'Year', 'Type', 'Season', 'Episode')
$data = Import-Csv -Path $args[1] -Header $headers
foreach ($row in $data) {
Write-Host "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
Write-Host "Processing file started: $($row.VideoFile)"
Write-Host ""
Write-Host "Video file: $($row.VideoFile)"
Write-Host "Title: $($row.Title)"
Write-Host "Year: $($row.Year)"
Write-Host "Type: $($row.Type)"
if ($row.Type -eq "1") {
Write-Host "Season: $($row.Season)"
Write-Host "Episode: $($row.Episode)"
}
Write-Host ""
Write-Host "Fingerprinting started"
# Prepare the Docker command
$dockerCommand = 'docker run --rm -v "' + "$($PWD.Path)/$($args[2]):/videos:ro" + '" -v "' + "$($PWD.Path)/$($args[3]):/fingerprints" + '" registry.clients.webkontrol.com/wk-fingerprint "/videos/' + "$($row.VideoFile)" + '" "/fingerprints/' + "$($row.VideoFile).fp" + '"'
# Print the Docker command
Write-Host "Docker Command: $dockerCommand"
# Execute the Docker command
Invoke-Expression $dockerCommand
Write-Host "Fingerprinting finished"
Write-Host ""
if ($row.Type -eq "0") {
$formattedTitle = $row.Title -replace " +", "_"
$encodedId = [System.Web.HttpUtility]::UrlEncode($formattedTitle) + "_y$($row.Year)"
Write-Host "Uploading id: $encodedId"
$formattedTitle = $row.Title -replace " +", "%2520"
$encodedTitle = [System.Web.HttpUtility]::UrlEncode($formattedTitle)
$url = "https://scan.webkontrol.com/api/upload/$($encodedId)?type=0&title=$($encodedTitle)&year=$($row.Year)"
Write-Host "Uploading url: $url"
} else {
$formattedTitle = $row.Title -replace " +", "_"
$encodedId = [System.Web.HttpUtility]::UrlEncode($formattedTitle) + "_y$($row.Year)_s$($row.Season)_e$($row.Episode)"
Write-Host "Uploading id: $encodedId"
$formattedTitle = $row.Title -replace " +", "%2520"
$encodedTitle = [System.Web.HttpUtility]::UrlEncode($formattedTitle)
$url = "https://scan.webkontrol.com/api/upload/$($encodedId)?type=1&title=$($encodedTitle)&year=$($row.Year)&season=$($row.Season)&episode=$($row.Episode)"
Write-Host "Uploading url: $url"
}
Write-Host "Uploading started"
# Uploading the fingerprint
Invoke-RestMethod -Uri $url -Method Post -Headers @{ Authorization = "Token $($args[0])" } -InFile "$($args[3])/$($row.VideoFile).fp" -ContentType 'application/octet-stream'
Write-Host "Uploading finished"
Write-Host ""
Write-Host "Processing file finished: $($row.VideoFile)"
Write-Host "------------------------------------------------------------"
Write-Host ""
}
├── wk
│ ├── fingerprints
│ ├── upload.csv
│ ├── upload.sh
│ ├── videos
│ ├── video1.mp4
│ ├── video2.mp4
│ ├── video3.avi
│ ├── video4.avi
# Run the script
$ ./upload.ps1 <TOKEN> upload.csv /full/path/to/videos/directory /full/path/to/fingerprints/directory
./upload.ps1 f1e6c0c19b1b7556a49ab7aed02549486b3d89 upload.csv videos fingerprints
1. Go to https://scan.webkyte.com/ and log in to your account:
2. Click New Search
3. Select titles your want to check for copies
4. Select the platforms and click Match it! to start scanning:
5. Wait for the status to be «Completed» and explore the matching results: