{"id":13445659,"url":"https://gitlab.com/BrianAllred/NYoutubeDL","last_synced_at":"2025-03-20T21:31:01.697Z","repository":{"id":63919582,"uuid":"6591819","full_name":"BrianAllred/NYoutubeDL","owner":"BrianAllred","description":"A simple youtube-dl library for C#.","archived":false,"fork":false,"pushed_at":null,"size":null,"stargazers_count":17,"open_issues_count":4,"forks_count":13,"subscribers_count":null,"default_branch":"master","last_synced_at":"2024-10-11T20:36:59.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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":null,"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}},"created_at":"2018-06-03T23:14:32.211Z","updated_at":"2022-04-15T17:42:38.007Z","dependencies_parsed_at":"2023-06-09T09:15:30.181Z","dependency_job_id":null,"html_url":"https://gitlab.com/BrianAllred/NYoutubeDL","commit_stats":null,"previous_names":[],"tags_count":17,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/BrianAllred%2FNYoutubeDL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/BrianAllred%2FNYoutubeDL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/BrianAllred%2FNYoutubeDL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories/BrianAllred%2FNYoutubeDL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners/BrianAllred","download_url":"https://gitlab.com/BrianAllred/NYoutubeDL/-/archive/master/NYoutubeDL-master.zip","host":{"name":"gitlab.com","url":"https://gitlab.com","kind":"gitlab","repositories_count":4515578,"owners_count":6498,"icon_url":"https://github.com/gitlab.png","version":null,"created_at":"2022-05-30T11:31:42.605Z","updated_at":"2024-07-18T11:24:13.055Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/gitlab.com/owners"}},"keywords":[],"created_at":"2024-07-31T05:00:37.501Z","updated_at":"2025-03-20T21:31:01.692Z","avatar_url":null,"language":null,"funding_links":[],"categories":["Frameworks, Libraries and Tools","框架, 库和工具"],"sub_categories":["Misc","大杂烩"],"readme":"# NYoutubeDL\n\n[![pipeline status](https://gitlab.com/BrianAllred/NYoutubeDL/badges/master/pipeline.svg)](https://gitlab.com/BrianAllred/NYoutubeDL/commits/master)\n\nA simple youtube-dl library for C#.\n\nSee the [main page](https://rg3.github.io/youtube-dl/) for youtube-dl for more information.\n\n## Usage\n\n### Getting the package\n\n#### Visual Studio\n\n* Search for `NYoutubeDL` in your project's NuGet Manager and click install.\n  \nOr\n\n* In the NuGet package manager console, run\n\n        PM\u003e Install-Package NYoutubeDL\n\n#### DotNet Core\n\n* In a terminal in your project's folder, run\n\n        dotnet add package NYoutubeDL\n\n#### Alternatively\n\n* Manually [download](https://www.nuget.org/packages/NYoutubeDL/) nupkg from NuGet Gallery.\n\n### Using the code\n\nSee the [documentation](https://github.com/rg3/youtube-dl/blob/master/README.md#readme) for youtube-dl first to understand what it does and how it does it.\n\n1. Create a new YoutubeDL client:\n\n        var youtubeDl = new YoutubeDL();\n\n2. Options are grouped according to the youtube-dl documentation:\n\n        youtubeDl.Options.FilesystemOptions.Output = \"/path/to/downloads/video.mp4\";\n        youtubeDl.Options.PostProcessingOptions.ExtractAudio = true;\n        youtubeDl.VideoUrl = \"http://www.somevideosite.com/videoUrl\";\n\n        // Or update the binary\n        youtubeDl.Options.GeneralOptions.Update = true;\n\n        // Optional, required if binary is not in $PATH\n        youtubeDl.YoutubeDlPath = \"/path/to/youtube-dl\";\n\n3. Options can also be saved and loaded. Only changed options will be saved.\n\n        File.WriteAllText(\"options.config\", youtubeDl.Options.Serialize());\n        youtubeDl.Options = Options.Deserialize(File.ReadAllText(\"options.config\"));\n\n4. Subscribe to the console output (optional, but recommended):\n\n        youtubeDl.StandardOutputEvent += (sender, output) =\u003e Console.WriteLine(output);\n        youtubeDl.StandardErrorEvent += (sender, errorOutput) =\u003e Console.WriteLine(errorOutput);\n\n5. Subscribe to download information updates. Hard subscription is optional, the DownloadInfo class implements INotifyPropertyChanged.\n\n        youtubeDl.Info.PropertyChanged += delegate { \u003cyour code here\u003e };\n\n6. Start the download:\n\n        // Prepare the download (in case you need to validate the command before starting the download)\n        string commandToRun = await youtubeDl.PrepareDownloadAsync();\n        // Alternatively\n        string commandToRun = youtubeDl.PrepareDownload();\n\n         // Just let it run\n        youtubeDl.DownloadAsync();\n\n        // Wait for it\n        youtubeDl.Download();\n\n        // Or provide video url\n        youtubeDl.Download(\"http://videosite.com/videoUrl\");\n\n### Workaround for IIS\n\nThere is a weird permissions issue that ocurrs when invoking youtube-dl from an ASP.NET/IIS process. In this case, perform the following steps\n\n1. Install Python on the server.\n\n2. Download and place the Python version of youtube-dl (not the executable binary) somewhere on the server. This can be found [here](https://yt-dl.org/downloads/latest/youtube-dl).\n\n3. When creating the YoutubeDL client object, set the `PythonPath` property to the path of the Python executable binary and the `YoutubeDlPath` to the path of the python version of youtube-dl.\n\n## Reporting issues\n\nWhile both youtube-dl itself and this library support many different services, my personal use centers around Youtube. If you find any bugs using this library with other services, feel free to raise an issue. **Please provide a specific link/URL, if possible.**\n\n## Contributing\n\nPull requests for bug fixes are more than welcome! If you find and fix an issue, make a pull request with the bug and fix clearly described.\n\nPull requests for features will be considered, although I'm not sure what else this library needs to do. If you have an idea for a new feature, **please raise an issue first** in order to start a discussion. This saves both you and me time. I don't want anyone to code an elaborate feature and write up an immaculate pull request if it doesn't belong in this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2FBrianAllred%2FNYoutubeDL","html_url":"https://awesome.ecosyste.ms/projects/gitlab.com%2FBrianAllred%2FNYoutubeDL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/gitlab.com%2FBrianAllred%2FNYoutubeDL/lists"}