";
return pageSource.Contains(unavailableContainer);
}
diff --git a/YoutubeExtractor/YoutubeExtractor/FlvFile.cs b/YoutubeExtractor/YoutubeExtractor/FlvFile.cs
index 6b4692b..7b7d68c 100644
--- a/YoutubeExtractor/YoutubeExtractor/FlvFile.cs
+++ b/YoutubeExtractor/YoutubeExtractor/FlvFile.cs
@@ -62,12 +62,6 @@ public void ExtractStreams()
{
this.Seek(0);
- if (this.ReadUInt32() != 0x464C5601)
- {
- // not a FLV file
- throw new AudioExtractionException("Invalid input file. Impossible to extract audio track.");
- }
-
this.ReadUInt8();
uint dataOffset = this.ReadUInt32();
@@ -141,9 +135,6 @@ private IAudioExtractor GetAudioWriter(uint mediaInfo)
case 14:
case 2:
return new Mp3AudioExtractor(this.outputPath);
-
- case 10:
- return new AacAudioExtractor(this.outputPath);
}
string typeStr;
@@ -165,7 +156,7 @@ private IAudioExtractor GetAudioWriter(uint mediaInfo)
break;
}
- throw new AudioExtractionException("Unable to extract audio (" + typeStr + " is unsupported).");
+ throw new Exception("Unable to extract audio (" + typeStr + " is unsupported).");
}
private byte[] ReadBytes(int length)
@@ -253,4 +244,4 @@ private void Seek(long offset)
this.fileOffset = offset;
}
}
-}
\ No newline at end of file
+}
diff --git a/YoutubeExtractor/YoutubeExtractor/VideoInfo.cs b/YoutubeExtractor/YoutubeExtractor/VideoInfo.cs
index e52db40..a9fa359 100644
--- a/YoutubeExtractor/YoutubeExtractor/VideoInfo.cs
+++ b/YoutubeExtractor/YoutubeExtractor/VideoInfo.cs
@@ -195,6 +195,7 @@ public string VideoExtension
/// Gets the video type (container).
///
public VideoType VideoType { get; private set; }
+ public string ThumbnailUrl { get; internal set; }
///
/// We use this in the method to
diff --git a/YoutubeExtractor/YoutubeExtractor/YoutubeExtractor.csproj b/YoutubeExtractor/YoutubeExtractor/YoutubeExtractor.csproj
index 9cb7519..ea5f897 100644
--- a/YoutubeExtractor/YoutubeExtractor/YoutubeExtractor.csproj
+++ b/YoutubeExtractor/YoutubeExtractor/YoutubeExtractor.csproj
@@ -1,5 +1,5 @@
-
+
Debug
AnyCPU
@@ -10,8 +10,9 @@
Properties
YoutubeExtractor
YoutubeExtractor
- v3.5
+ v4.7.1
512
+
true
@@ -22,6 +23,7 @@
DEBUG;TRACE
prompt
4
+ false
pdbonly
@@ -33,20 +35,22 @@
4
bin\Release\Full\YoutubeExtractor.xml
true
+ false
-
- ..\packages\Newtonsoft.Json.5.0.8\lib\net35\Newtonsoft.Json.dll
+
+ ..\..\..\..\..\Source\Workspaces\DownloadYouTube\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll
+
+ False
+ ..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\System.Xml.Linq.dll
+
-
-
-
@@ -76,4 +80,4 @@
-->
-
\ No newline at end of file
+
diff --git a/YoutubeExtractor/YoutubeExtractor/packages.YoutubeExtractor.config b/YoutubeExtractor/YoutubeExtractor/packages.YoutubeExtractor.config
index 9520f36..71b8fed 100644
--- a/YoutubeExtractor/YoutubeExtractor/packages.YoutubeExtractor.config
+++ b/YoutubeExtractor/YoutubeExtractor/packages.YoutubeExtractor.config
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/readme.md b/readme.md
index b43bf24..c569747 100644
--- a/readme.md
+++ b/readme.md
@@ -101,10 +101,8 @@ videoDownloader.Execute();
/*
* We want the first extractable video with the highest audio quality.
*/
-VideoInfo video = videoInfos
- .Where(info => info.CanExtractAudio)
- .OrderByDescending(info => info.AudioBitrate)
- .First();
+VideoInfo video = videoInfos.Where(i => i.VideoType == VideoType.Mp4 && i.Resolution == 0)
+ .OrderByDescending(q => q.AudioBitrate).First();
/*
* If the video has a decrypted signature, decipher it
@@ -119,17 +117,17 @@ if (video.RequiresDecryption)
* The first argument is the video where the audio should be extracted from.
* The second argument is the path to save the audio file.
*/
-var audioDownloader = new AudioDownloader(video, Path.Combine("D:/Downloads", video.Title + video.AudioExtension));
+var videoDownloader = new VideoDownloader(video, Path.Combine("D:/Downloads", video.Title + ".m4a"));
// Register the progress events. We treat the download progress as 85% of the progress and the extraction progress only as 15% of the progress,
// because the download will take much longer than the audio extraction.
-audioDownloader.DownloadProgressChanged += (sender, args) => Console.WriteLine(args.ProgressPercentage * 0.85);
-audioDownloader.AudioExtractionProgressChanged += (sender, args) => Console.WriteLine(85 + args.ProgressPercentage * 0.15);
+videoDownloader.DownloadProgressChanged += (sender, args) => Console.WriteLine(args.ProgressPercentage * 0.85);
+videoDownloader.AudioExtractionProgressChanged += (sender, args) => Console.WriteLine(85 + args.ProgressPercentage * 0.15);
/*
* Execute the audio downloader.
* For GUI applications note, that this method runs synchronously.
*/
-audioDownloader.Execute();
+videoDownloader.Execute();
```