Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

Commit 23699e4

Browse files
committed
Use the more performant way of getting the video infos
1 parent 265de8f commit 23699e4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

YoutubeExtractor/ExampleApplication/Program.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ private static void DownloadAudio(IEnumerable<VideoInfo> videoInfos)
1919
.OrderByDescending(info => info.AudioBitrate)
2020
.First();
2121

22+
/*
23+
* If the video has a decrypted signature, decipher it
24+
*/
25+
if (video.RequiresDecryption)
26+
{
27+
DownloadUrlResolver.DecryptDownloadUrl(video);
28+
}
29+
2230
/*
2331
* Create the audio downloader.
2432
* The first argument is the video where the audio should be extracted from.
@@ -50,6 +58,14 @@ private static void DownloadVideo(IEnumerable<VideoInfo> videoInfos)
5058
VideoInfo video = videoInfos
5159
.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360);
5260

61+
/*
62+
* If the video has a decrypted signature, decipher it
63+
*/
64+
if (video.RequiresDecryption)
65+
{
66+
DownloadUrlResolver.DecryptDownloadUrl(video);
67+
}
68+
5369
/*
5470
* Create the video downloader.
5571
* The first argument is the video to download.
@@ -78,7 +94,7 @@ private static void Main()
7894
* Get the available video formats.
7995
* We'll work with them in the video and audio download examples.
8096
*/
81-
IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(link);
97+
IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(link, false);
8298

8399
//DownloadAudio(videoInfos);
84100
DownloadVideo(videoInfos);

0 commit comments

Comments
 (0)