Reputation: 2646
I am working on a project that will need to ability to download youtube videos. I found this project on github:
https://github.com/flagbug/YoutubeExtractor
My project already has a namespace. How would I import the YoutubeExtractor into my project? Do I need to change the namespace for it before (or after) importing it? Or is it up to me, in which case, what are the advantages and disadvantages to changing the namespace vs. not changing it? I am using VS Express 2012, if that matters.
Upvotes: 0
Views: 210
Reputation: 67898
YouTubeExtractor
and build it.using {namespace}
to the files you want to use the extractor in.Where {namespace}
is the namespace it uses.
Further, it appears that there is a nuget
package for it (you see that YoutubeExtractor.nuspec
file in root). I would recommend installing nuget
into Visual Studio and then searching nuget
for the YouTubeExtractor
. It's a lot easier, and you get updates with it easier as well.
Upvotes: 2
Reputation: 1038710
My project already has a namespace. How would I import the YoutubeExtractor into my project?
You add reference to the external assembly (in this particular case you install the NuGet) and then add using
statement with the correct namespace (YoutubeExtractor
) in which the classes are defined.
So just follow the steps described on the home page:
Install-Package YoutubeExtractor
and then:
using YoutubeExtractor;
and finally:
// Our test youtube link
string link = "insert youtube link";
/*
* Get the available video formats.
* We'll work with them in the video and audio download examples.
*/
IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(link);
Upvotes: 5