@@ -22,6 +22,9 @@ internal class MainViewModel : BindableBase
22
22
23
23
private readonly Cli FfmpegCli = new Cli ( "ffmpeg.exe" ) ;
24
24
25
+ private static readonly string TempDirectoryPath = Path . Combine ( Directory . GetCurrentDirectory ( ) , "Temp" ) ;
26
+ private static readonly string OutputDirectoryPath = Path . Combine ( Directory . GetCurrentDirectory ( ) , "Output" ) ;
27
+
25
28
#region Fields
26
29
private string myTitle ;
27
30
private string status ;
@@ -31,8 +34,6 @@ internal class MainViewModel : BindableBase
31
34
private Playlist _playlist ;
32
35
private Video _video ;
33
36
private Channel _channel ;
34
- //private MediaStreamInfoSet _mediaStreamInfos;
35
- //private IReadOnlyList<ClosedCaptionTrackInfo> _closedCaptionTrackInfos;
36
37
private double _progress ;
37
38
private bool _isProgressIndeterminate ;
38
39
#endregion
@@ -115,13 +116,11 @@ public bool IsProgressIndeterminate
115
116
}
116
117
#endregion
117
118
118
- // Commands
119
+ #region Commands
119
120
public DelegateCommand GetDataCommand { get ; }
120
121
public DelegateCommand < string > DownloadSongCommand { get ; }
121
122
public DelegateCommand < string > DownloadVideoCommand { get ; }
122
-
123
- private static readonly string TempDirectoryPath = Path . Combine ( Directory . GetCurrentDirectory ( ) , "Temp" ) ;
124
- private static readonly string OutputDirectoryPath = Path . Combine ( Directory . GetCurrentDirectory ( ) , "Output" ) ;
123
+ #endregion
125
124
#endregion
126
125
127
126
public MainViewModel ( )
@@ -178,7 +177,7 @@ private async void GetData()
178
177
IsProgressIndeterminate = false ;
179
178
}
180
179
181
- #region YouTube Dling
180
+ #region YouTube Song DL
182
181
private async Task DownloadSongPlaylistAsync ( string id )
183
182
{
184
183
// Get playlist info
@@ -245,6 +244,17 @@ private async Task DownloadSongAsync(Video video)
245
244
Status = $ "Downloaded and converted video [{ video . Id } ] to [{ outputFilePath } ]";
246
245
}
247
246
247
+ private static MediaStreamInfo GetBestAudioStreamInfo ( MediaStreamInfoSet set )
248
+ {
249
+ if ( set . Audio . Any ( ) )
250
+ return set . Audio . WithHighestBitrate ( ) ;
251
+ if ( set . Muxed . Any ( ) )
252
+ return set . Muxed . WithHighestVideoQuality ( ) ;
253
+ throw new Exception ( "No applicable media streams found for this video" ) ;
254
+ }
255
+ #endregion
256
+
257
+ #region YouTube Video DL
248
258
private async Task DownloadVideoAsync ( string id )
249
259
{
250
260
Status = $ "Working on video [{ id } ]...";
@@ -288,15 +298,6 @@ private async Task DownloadVideoAsync(Video video)
288
298
289
299
Status = $ "Downloaded video [{ video . Id } ] to [{ outputFilePath } ]";
290
300
}
291
-
292
- private static MediaStreamInfo GetBestAudioStreamInfo ( MediaStreamInfoSet set )
293
- {
294
- if ( set . Audio . Any ( ) )
295
- return set . Audio . WithHighestBitrate ( ) ;
296
- if ( set . Muxed . Any ( ) )
297
- return set . Muxed . WithHighestVideoQuality ( ) ;
298
- throw new Exception ( "No applicable media streams found for this video" ) ;
299
- }
300
301
#endregion
301
302
302
303
#region Commands
0 commit comments