1
0

Repository rearrangement

This commit is contained in:
Michael Gordeev
2019-12-05 13:34:34 +03:00
parent 8e348ad0f3
commit 56b9999342
25 changed files with 6 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
using System.Globalization;
using YoutubeExplode.Models.ClosedCaptions;
namespace YouTube.Models
{
public class ClosedCaptionInfo
{
public CultureInfo Language { get; set; }
public string Url { get; set; }
public bool AutoGenerated { get; set; }
internal ClosedCaptionTrackInfo TrackInfo { get; set; }
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace YouTube.Models
{
public class ClosedCaptionTrack
{
public ClosedCaptionInfo Info { get; set; }
public IReadOnlyList<ClosedCaption> Captions { get; set; }
public class ClosedCaption
{
public TimeSpan Offset { get; set; }
public TimeSpan Duration { get; set; }
public string Content { get; set; }
}
}
}
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.IO;
using System.Xml;
namespace YouTube.Models
{
public class DashManifest
{
public string Label { get; }
public DateTime ValidUntil { get; }
public DashManifest(string label, XmlDocument doc)
{
Label = label;
Xml = doc;
}
public string ManifestContent => Xml.OuterXml;
public XmlDocument Xml { get; }
public Uri WriteManifest(FileStream outStream)
{
Xml.Save(outStream);
return new Uri(outStream.Name);
}
}
}
+48
View File
@@ -0,0 +1,48 @@
using System.Drawing;
namespace YouTube.Models
{
public enum VideoFormat
{
/// <summary>
/// MPEG-4 Part 2.
/// </summary>
Mp4V = 0,
H263 = 1,
/// <summary>
/// MPEG-4 Part 10, H264, Advanced Video Coding (AVC).
/// </summary>
H264 = 2,
Vp8 = 3,
Vp9 = 4,
Av1 = 5
}
public enum AudioFormat
{
/// <summary>
/// MPEG-4 Part 3, Advanced Audio Coding (AAC).
/// </summary>
Aac = 0,
Vorbis = 1,
Opus = 2
}
public enum AudioQuality { Low, Medium, High }
public class VideoPlaybackUrl
{
public string Quality { get; set; }
public VideoFormat Format { get; set; }
public string Url { get; set; }
public Size Resolution { get; set; }
public bool HasAudio { get; set; }
public int Bitrate { get; set; }
}
public class AudioPlaybackUrl
{
public AudioQuality Quality { get; set; }
public AudioFormat Format { get; set; }
public string Url { get; set; }
public int Bitrate { get; set; }
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
namespace YouTube.Models
{
public class VideoPlayback
{
public string Id { get; set; }
public PlaybackUrlsData PlaybackUrls { get; set; } = new PlaybackUrlsData();
public IReadOnlyList<ClosedCaptionInfo> ClosedCaptions { get; set; }
public class PlaybackUrlsData
{
public IReadOnlyList<VideoPlaybackUrl> Video { get; set; }
public IReadOnlyList<AudioPlaybackUrl> Audio { get; set; }
public string LiveStreamUrl { get; set; }
public DateTime ValidUntil { get; set; }
}
}
}