Skip to content

Commit

Permalink
simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
h0lg committed Jan 8, 2023
1 parent 20e7249 commit c4b3953
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Youtube.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,10 @@ private async IAsyncEnumerable<CaptionTrack> DownloadCaptionTracksAsync(string v
cancellation.ThrowIfCancellationRequested();
var captionTrack = new CaptionTrack { LanguageName = trackInfo.Language.Name, Url = trackInfo.Url };

YoutubeExplode.Videos.ClosedCaptions.ClosedCaptionTrack track;

try
{
// Get the actual closed caption track
track = await youtube.Videos.ClosedCaptions.GetAsync(trackInfo, cancellation);
var track = await youtube.Videos.ClosedCaptions.GetAsync(trackInfo, cancellation);

captionTrack.Captions = track.Captions
.Select(c => new Caption { At = Convert.ToInt32(c.Offset.TotalSeconds), Text = c.Text })
Expand Down

0 comments on commit c4b3953

Please sign in to comment.