{"id":14063642,"url":"https://github.com/RylandDeGregory/PSTagLib","last_synced_at":"2025-07-29T15:34:43.808Z","repository":{"id":40378352,"uuid":"230804668","full_name":"RylandDeGregory/PSTagLib","owner":"RylandDeGregory","description":"PowerShell module and collection of PowerShell utilities for managing audio file metadata tags.","archived":false,"fork":false,"pushed_at":"2023-07-22T14:33:12.000Z","size":357,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-13T07:05:23.165Z","etag":null,"topics":["id3v2","metadata-tags","mp3-files","powershell","powershell-script","taglib-sharp","taglibsharp","youtube-dl"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RylandDeGregory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-12-29T21:20:30.000Z","updated_at":"2024-04-06T09:22:43.000Z","dependencies_parsed_at":"2024-02-04T20:34:42.123Z","dependency_job_id":"5a8f07e3-efb9-46ef-8163-3e0527178913","html_url":"https://github.com/RylandDeGregory/PSTagLib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RylandDeGregory%2FPSTagLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RylandDeGregory%2FPSTagLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RylandDeGregory%2FPSTagLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RylandDeGregory%2FPSTagLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RylandDeGregory","download_url":"https://codeload.github.com/RylandDeGregory/PSTagLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228028556,"owners_count":17858349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["id3v2","metadata-tags","mp3-files","powershell","powershell-script","taglib-sharp","taglibsharp","youtube-dl"],"created_at":"2024-08-13T07:03:26.239Z","updated_at":"2024-12-04T01:31:06.842Z","avatar_url":"https://github.com/RylandDeGregory.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# PSTagLib\n\nA collection of PowerShell utilities for downloading and tagging MP3 files with [TagLibSharp](https://github.com/mono/taglib-sharp).\n\n[![Build Status](https://dev.azure.com/rylanddegregory/PSTagLib/_apis/build/status/Build%20%26%20Publish?branchName=master)](https://dev.azure.com/rylanddegregory/PSTagLib/_build/latest?definitionId=13\u0026branchName=master) [![PSTagLib package in PSTagLib feed in Azure Artifacts](https://feeds.dev.azure.com/rylanddegregory/702532c8-d17b-41e2-a97f-826f1f04b525/_apis/public/Packaging/Feeds/PSTagLib/Packages/7067aeb7-4e50-4c15-ac18-f8b2673848b6/Badge)](https://dev.azure.com/rylanddegregory/PSTagLib/_artifacts/feed/PSTagLib/NuGet/PSTagLib?preferRelease=true)\n\n\u003e PSTagLib [PowerShell module](https://dev.azure.com/rylanddegregory/PSTagLib/_artifacts/feed/PSTagLib/NuGet/PSTagLib/overview/) source is located in the `PSTagLib/` directory.\n\n* [Installation](#installation)\n* [Download MP3 files](#download-mp3-files)\n* [Set MP3 tags](#set-mp3-metadata-tags)\n* [Troubleshooting](#troubleshooting)\n* [License](#license)\n\n## Installation\n\n1. Install PowerShell\n    * If you have a Windows computer, launch it by pressing the Windows key and typing PowerShell. Click on **Windows PowerShell** (not ISE).\n    * If you have a MacOS computer, install [PowerShell](https://github.com/PowerShell/PowerShell#get-powershell). Launch PowerShell by pressing \u003ckbd\u003eCmd\u003c/kbd\u003e + \u003ckbd\u003eSpace\u003c/kbd\u003e and typing PowerShell.\n1. Download this repo to your local machine by clicking the Green **Code** button and choosing **Download ZIP**.\n1. Unzip `PSTagLib.zip` to any folder on your computer.\n\n## Download MP3 files\n\nThe script `Invoke-MP3Download.ps1` will enable you to programmatically download MP3 files from certain websites. Downloading videos or audio from videos is currently unsupported unless you already have a working installation of `ffmpeg`.\n\n### Download youtube-dl\n\n* `Invoke-MP3Download.ps1` can be utilized to programmatically download MP3 files using the [youtube-dl](https://ytdl-org.github.io/youtube-dl/index.html) command-line tool. If you do not have youtube-dl installed, follow the steps below taken from the youtube-dl [download page](https://ytdl-org.github.io/youtube-dl/download.html).\n\n#### Windows\n\nOpen PowerShell as **Administrator** and copy the following code into the window. Press \u003ckbd\u003eEnter\u003c/kbd\u003e.\n\n```PowerShell\nInvoke-RestMethod 'https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe' -OutFile \"$env:USERPROFILE\\Desktop\\vcredist_x86.exe\"\nStart-Process \"$env:USERPROFILE\\Desktop\\vcredist_x86.exe\" -ArgumentList '/Q' -Wait\nRemove-Item \"$env:USERPROFILE\\Desktop\\vcredist_x86.exe\" -Force -ErrorAction SilentlyContinue\nInvoke-WebRequest 'https://yt-dl.org/downloads/latest/youtube-dl.exe' -OutFile \"$env:USERPROFILE\\AppData\\Local\\Microsoft\\WindowsApps\\youtube-dl.exe\"\n$env:Path = [System.Environment]::GetEnvironmentVariable('PATH')\n```\n\n#### MacOS and Linux\n\nOpen PowerShell and copy the following code into the window. Press \u003ckbd\u003eEnter\u003c/kbd\u003e.\n\u003e You will be prompted for your password. Type it in and press Enter. Don't worry if there aren't dots indicating that you are typing, your input is still being received.\n\n```PowerShell\nInvoke-RestMethod -Method Get -Uri 'https://yt-dl.org/downloads/latest/youtube-dl' -OutFile '/usr/local/bin/youtube-dl'\nsudo chmod a+rx '/usr/local/bin/youtube-dl'\n$env:Path = [System.Environment]::GetEnvironmentVariable('PATH')\n```\n\n### Download MP3 files using PowerShell and youtube-dl\n\n1. Determine the files you want to download by collecting their URLs from the website(s) you want to download them from.\n1. If you have multiple URLs, paste the URLs into a `.txt` or `.csv` file **one per line**, and save the file into the `PSTagLib` directory.\n1. Open PowerShell. See the [Installation](#installation) section for details.\n\n#### Interactive download\n\n1. Drag and drop `Invoke-MP3Download.ps1` into the PowerShell window. Press Enter.\n1. At the first question, select the mode you want the script to run in by typing `1` or `2`. Press Enter, then do the following based on your choice:\n    * `1`: Paste the link into the PowerShell window. Press Enter.\n    * `2`: Drag and drop the `.txt` or `.csv` file you created above into the PowerShell window. Press Enter.\n1. The MP3 files corresponding to the link(s) provided will be downloaded to the Desktop, and a log of operations (including any errors, see [Troubleshooting](#troubleshooting)) will be written to the PowerShell window.\n\n\u003e If you are satisfied with the results of your MP3 file download(s), proceed to the [Set MP3 tags](#set-mp3-metadata-tags) section to set the metadata tags for the newly-downloaded MP3 files.\n\n#### Programmatic download\n\nPowerShell [Comment-based Help](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comment_based_help?view=powershell-7.1) is provided for `Invoke-MP3Download.ps1`. To view, type the following into a PowerShell window and press Enter (*your path to the script may be different*):\n\n```PowerShell\nGet-Help -Full ./Invoke-MP3Download.ps1\n```\n\n* **Example 1:** Download a list of links from a `.txt` file on the Desktop and save to them to the current directory.\n\n```powershell\n./Invoke-MP3Download.ps1 -InputFile 'C:\\Users\\user1\\Desktop\\tracks.txt'\n```\n\n* **Example 2:** Download a list of links from a `.csv` file and save them to the *Music* folder.\n\n```powershell\n./Invoke-MP3Download.ps1 -InputFile '/Users/user1/Desktop/tracks.csv' -OutputPath '/Users/user1/Music/'\n```\n\n* **Example 3:** Download a single link and save it to the Desktop.\n\n```powershell\n./Invoke-MP3Download.ps1 -InputURL 'https://soundcloud.com/ryland-degregory/sample1' -OutputPath 'C:\\Users\\user1\\Desktop\\'\n```\n\n* **Example 4:** Download multiple links and save them to the current directory.\n\n```powershell\n./Invoke-MP3Download.ps1 -InputURL 'https://soundcloud.com/ryland-degregory/sample1', 'https://soundcloud.com/ryland-degregory/sample2'\n```\n\nThe MP3 files corresponding to the link(s) provided will be downloaded, and a log of operations (including any errors, see [Troubleshooting](#troubleshooting)) will be written to the PowerShell window.\n\n\u003e If you are satisfied with the results of your MP3 file download(s), proceed to the [Set MP3 tags](#set-mp3-metadata-tags) section to set the metadata tags for the newly-downloaded MP3 files.\n\n## Set MP3 Metadata tags\n\nEnsure that both `Set-MP3Tags.ps1` and `taglib-sharp.dll` are in the same folder.\n\n* `Set-MP3Tags.ps1` can be utilized either interactively or programmatically.\n* It expects files to adhere to the following naming convention:\n\n```text\n\u003cArtist\u003e - \u003cTitle\u003e (\u003cmix\u003e)\n\nExample: Above \u0026 Beyond, OceanLab - Satellite (Trance Wax Extended Mix)\n```\n\n* The delimiter between artist and title is ' - ' (space, hyphen, space).\n* Any files that fail to adhere to the naming convention will not be processed.\n\n```text\nC:\\Users\\Ryland\\Music\\Trance\\Factor B feat. Cat Martin Crashing Over (Extended Mix).mp3\n***Filename improperly formatted. This file will be skipped.***\n```\n\n### Interactively\n\n#### Example 1\n\n1. Open PowerShell. See the [Installation](#installation) section for details.\n1. Drag and drop `Set-MP3Tags.ps1` into the PowerShell window. Press Enter.\n1. Follow prompt to select the folder it will process.\n\n```text\nWhat is the path to the folder you want to process?: C:\\Users\\Ryland\\Music\\Trance\n```\n\n1. Select if you want the Genre set or not during processing.\n    * The Genre will be the name of the leaf folder. In this example, it would be `Trance`.\n\n```text\nWould you like to set the genre based on folder name? Enter 'Y' or 'N': Y\n```\n\n#### Output 1\n\n```text\n----------\nC:\\Users\\RylandMusic\\Trance\\Above \u0026 Beyond, OceanLab - Satellite (Trance Wax Extended Mix).mp3\nArtist: Above \u0026 Beyond, OceanLab\nTitle: Satellite (Trance Wax Extended Mix)\nGenre: Trance\n----------\nCompleted.\n```\n\n### Programmatically\n\n#### Example 2\n\n1. Execute the script from a PowerShell session, specifying the directory as a parameter.\n\n```powershell\n./Set-MP3Tags.ps1 -Directory \"C:\\Users\\Ryland\\Music\\Trance\"\n```\n\n1. Execute the script from PowerShell, specifying a directory and for Genre to be processed.\n    * The Genre will be the name of the leaf folder. In this example, it would be `Trance`.\n\n```powershell\n./Set-MP3Tags.ps1 -Directory \"C:\\Users\\Ryland\\Music\\Trance\" -Genre\n```\n\n#### Output 2\n\n```text\nPS C:\\Users\\Ryland\\Documents\\Code\\PSTagLib\u003e .\\Set-MP3Tags.ps1 -Directory C:\\Users\\Ryland\\Music\\Trance -Genre\n----------\nC:\\Users\\Ryland\\Music\\Trance\\Above \u0026 Beyond, OceanLab - Satellite (Trance Wax Extended Mix).mp3\nArtist: Above \u0026 Beyond, OceanLab\nTitle: Satellite (Trance Wax Extended Mix)\nGenre: Trance\n----------\nC:\\Users\\Ryland\\Music\\Trance\\Factor B feat. Cat Martin - Crashing Over (Extended Mix).mp3\nArtist: Factor B feat. Cat Martin\nTitle: Crashing Over (Extended Mix)\nGenre: Trance\n----------\nCompleted.\nPress Enter to exit:\n```\n\n## Troubleshooting\n\n### Script won't execute\n\n![WindowsTerminal_EVBHp0icto](https://user-images.githubusercontent.com/18073815/167960282-830a55cb-9d11-4b1a-99a3-f055050febc0.png)\n\n* Ensure that you can execute scripts on your machine. Enter an **Administrator** PowerShell session and paste the following command:\n\n```powershell\nSet-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process\n```\n\n* If you change this setting, you **MUST** change it back when you are done using this tool.\n\n```powershell\nSet-ExecutionPolicy -ExecutionPolicy Default\n```\n\n### Invalid folder path\n\n![WindowsTerminal_soOeUqTpkg](https://user-images.githubusercontent.com/18073815/167960528-e0e0051b-5c47-43c8-91d3-4fde66d6663a.png)\n\n* If your folder path has a space, you may have to wrap the path in quotes (\"\").\n    * `\"C:\\Users\\Ryland\\New Music\\Trance\"`\n\n### Filename improperly formatted\n\n* If you receive the following error message on any of your files, review the naming convention (default `Artist - Title`).\n    * If you desire, you may modify the delimiter by which the script processes files. In `Set-MP3Tags.ps1`, modify the value of `$delimiter` at the top of the script.\n\n```text\n----------\nC:\\Users\\Ryland\\Desktop\\Music\\Trance\\Factor B feat. Cat Martin Crashing Over (Extended Mix).mp3\n***Filename improperly formatted. This file will be skipped.***\n----------\n```\n\n* Once you have updated the incorrect filenames, you can safely run the script again with no impact to the already-correct files.\n\n## License\n\nThis code is distributed under the [MIT License](http://opensource.org/licenses/mit-license.php).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRylandDeGregory%2FPSTagLib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRylandDeGregory%2FPSTagLib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRylandDeGregory%2FPSTagLib/lists"}