# vgmdb-compareurl

> **Status:** Active
> **Category:** URL Management
> **Language:** PowerShell
> **Script files:** `url maker full.ps1`, `http to https.ps1`, `stage2only.ps1`

## Purpose

Extracts VGMdb `.url` shortcut files from multiple drives and pre-configured folder paths, exporting a master CSV list for auditing and comparison. Also includes a utility for upgrading `http://` URLs to `https://` across all scanned `.url` files.

## Requirements

### Dependencies

PowerShell 5.1 or later (Windows built-in). No additional modules required.

## Input

| Item | Description | Example |
|------|-------------|---------|
| `.url` files | Windows internet shortcut files | `Album info.url` |
| Folder list | Hardcoded list of drive/folder paths inside each script | `C:\[Final QC]`, `X:\[VGMPP]\Albums` |

## Output

| Item | Description |
|------|-------------|
| `outputfullboy.csv` | Master CSV of all URLs found across all configured drives (`url maker full.ps1`) |
| `stage2updatesforgooglesheet.csv` | CSV scoped to Stage 2 folder only (`stage2only.ps1`) |
| `ChangedURL_Log_<timestamp>.txt` | Log of files whose URL was changed from http to https (`http to https.ps1`) |

## Scripts

### `url maker full.ps1` — Multi-drive URL extractor

Scans a large set of hardcoded folder paths across multiple drives and exports a master CSV. Output CSV contains three columns:

| Column | Contents |
|--------|----------|
| `FileName` | `.url` filename |
| `Directory` | Parent folder path |
| `URL` | Extracted URL |

**Hardcoded source folders:**

```
C:\[Final QC]          C:\[QC SPECIAL]         C:\[Stage2]
P:\[VGMPP MATT QC]    P:\OLDSYNCSTUFF          P:\VGMPP2025
S:\[FINAL QUALITY CONTROL]  S:\[READY to SEND]  S:\[STAGE2]
V:\[stage2next]
X:\[VGMPP]\Albums      X:\[VGMPP-2.0]\Albums
```

**Hardcoded output:** `C:\VGMPP\temp\outputfullboy.csv`

---

### `http to https.ps1` — HTTP-to-HTTPS upgrader

Scans the same multi-drive folder list and rewrites every `.url` file to:

1. Strip any extra metadata lines (leaving only `[InternetShortcut]` and `URL=...`)
2. Upgrade `http://` URLs to `https://`

Produces a timestamped log file of every changed file.

**Console output colours:**

| Colour | Meaning |
|--------|---------|
| Green | File was cleaned and/or URL was updated |
| Yellow | URL updated only (file was already clean) |
| Gray | No changes needed |
| Red | No `URL=` line found — file was skipped |

---

### `stage2only.ps1` — Stage 2 subset extractor

Identical structure to `url maker full.ps1` but scans only `V:\[STAGE2]`.

**Hardcoded output:** `C:\VGMPP\04 - VGMDBVGMPP COMPARE URL\stage2updatesforgooglesheet.csv`

## Usage

```powershell
# Extract full multi-drive URL list
& ".\url maker full.ps1"

# Upgrade all http:// URLs to https:// and strip extra metadata
& ".\http to https.ps1"

# Extract Stage 2 folder only
& ".\stage2only.ps1"
```

## Examples

```powershell
# Run the full extractor (takes ~12 minutes per the folder description)
& ".\url maker full.ps1"
# Exported to C:\VGMPP\temp\outputfullboy.csv

# After running http to https.ps1, check which files were changed
Get-Content ".\ChangedURL_Log_20250727_220043.txt"
```

Example `outputfullboy.csv` row:

```
FileName,Directory,URL
"Album info.url","X:\[VGMPP]\Albums\Artist - Album","https://vgmdb.net/album/12345"
```

## Notes

- **All folder paths and output paths are hardcoded** inside each script. Edit the `$folderPaths` / `$folders` arrays and `$outputCsv` variables before running in a different environment.
- The runtime for the full multi-drive scan is approximately 12 minutes (noted in the folder's description file).
- `http to https.ps1` is destructive — it rewrites `.url` files in place. There is no backup mechanism. Run `vgmdb-urlcleaner` or `url-cleaner-v4` first if you want a safer, more feature-complete cleaning pass.
- Folders that do not exist are silently skipped (`-ErrorAction SilentlyContinue`).
- The log file from `http to https.ps1` is written to the **current working directory** at runtime, named `ChangedURL_Log_<yyyyMMdd_HHmmss>.txt`.

## Related Scripts

- [vgmdb-url2list](vgmdb-url2list.md) — Simpler single-directory URL extractor
- [vgmdb-urlcleaner](vgmdb-urlcleaner.md) — PowerShell URL file cleaner (full-featured, with stage 2 variant)
- [url-cleaner-v4](url-cleaner-v4.md) — Python URL cleaner with live statistics dashboard
