public TwitchChatReplayJob(string id, StatusUpdate.IStatusUpdate statusUpdater = null) { JobStatus = VideoJobStatus.NotStarted; StatusUpdater = statusUpdater == null ? new StatusUpdate.NullStatusUpdate() : statusUpdater; VideoInfo = new GenericVideoInfo() { Service = StreamService.TwitchChatReplay, VideoId = id }; }
public HitboxVideoJob(string id, StatusUpdate.IStatusUpdate statusUpdater = null) { JobStatus = VideoJobStatus.NotStarted; StatusUpdater = statusUpdater == null ? new StatusUpdate.NullStatusUpdate() : statusUpdater; VideoInfo = new GenericVideoInfo() { Service = StreamService.Hitbox, VideoId = id }; Status = "..."; }
public FFMpegReencodeJob(string path, StatusUpdate.IStatusUpdate statusUpdater = null) { JobStatus = VideoJobStatus.NotStarted; StatusUpdater = statusUpdater == null ? new StatusUpdate.NullStatusUpdate() : statusUpdater; VideoInfo = new GenericVideoInfo() { Service = StreamService.FFMpegJob, VideoId = path }; Status = "..."; }
public GenericFileJob(string url, StatusUpdate.IStatusUpdate statusUpdater = null) { JobStatus = VideoJobStatus.NotStarted; StatusUpdater = statusUpdater == null ? new StatusUpdate.NullStatusUpdate() : statusUpdater; VideoInfo = new GenericVideoInfo() { Service = StreamService.RawUrl, VideoId = url }; Status = "..."; }
public FFMpegSplitJob(string path, string splitTimes, StatusUpdate.IStatusUpdate statusUpdater = null) { JobStatus = VideoJobStatus.NotStarted; StatusUpdater = statusUpdater == null ? new StatusUpdate.NullStatusUpdate() : statusUpdater; VideoInfo = new GenericVideoInfo() { Service = StreamService.FFMpegJob, VideoId = path, Username = "******", VideoTitle = splitTimes }; Status = "..."; SplitTimes = splitTimes; }
public static (bool success, GenericVideoInfo info) ParseFromJsonFlat(JToken json, string usernameIfNotInJson) { GenericVideoInfo y = new GenericVideoInfo(); y.Service = StreamService.Youtube; y.VideoId = json["id"].Value <string>(); y.VideoTitle = json["title"].Value <string>(); y.Username = usernameIfNotInJson; y.VideoTimestamp = DateTime.UtcNow; return(true, y); }
public static async Task <List <IVideoInfo> > GetFilesFromUrl(string identifier) { string url = $"https://archive.org/download/{identifier}/{identifier}_files.xml"; XmlReaderSettings settings = new XmlReaderSettings(); settings.Async = true; var vi = new List <IVideoInfo>(); XmlDocument doc = new XmlDocument(); using (XmlReader reader = XmlReader.Create(url, settings)) { XPathDocument xml = new XPathDocument(reader); var nav = xml.CreateNavigator(); var files = nav.SelectSingleNode("files"); if (files.MoveToFirstChild()) { do { if (files.Name == "file" && files.HasAttributes) { string filename = files.GetAttribute("name", ""); string source = files.GetAttribute("source", ""); DateTime datetime = Util.DateTimeFromUnixTime(0); try { long timestamp = files.SelectSingleNode("mtime").ValueAsLong; datetime = Util.DateTimeFromUnixTime(timestamp >= 0 ? (ulong)timestamp : 0); } catch (Exception) { } var v = new GenericVideoInfo(); v.Service = StreamService.RawUrl; v.Username = identifier; v.VideoId = $"https://archive.org/download/{identifier}/{filename}"; v.VideoTitle = filename; v.VideoGame = source; v.VideoTimestamp = datetime; v.VideoLength = TimeSpan.Zero; v.VideoRecordingState = RecordingState.Unknown; v.VideoType = VideoFileType.Unknown; vi.Add(v); } } while (files.MoveToNext()); } } return(vi); }
public static List <IVideoInfo> GetMediaFromFeed(string url) { RssFeed feed = new RssFeed(); using (XmlReader reader = XmlReader.Create(url)) { feed.Load(reader); } List <IVideoInfo> media = new List <IVideoInfo>(); foreach (RssItem item in feed.Channel.Items) { RssEnclosure enclosure = item.Enclosures.Where(x => x.ContentType != null).FirstOrDefault(); if (enclosure == null) { continue; } var durationElement = item.FindExtension(x => x is Argotic.Extensions.Core.ITunesSyndicationExtension && ((Argotic.Extensions.Core.ITunesSyndicationExtension)x).Context.Duration != null); TimeSpan duration = durationElement != null ? ((Argotic.Extensions.Core.ITunesSyndicationExtension)durationElement).Context.Duration : TimeSpan.Zero; GenericVideoInfo info = new GenericVideoInfo { Service = StreamService.RawUrl, VideoTitle = item.Title, VideoGame = item.Description, VideoTimestamp = item.PublicationDate, VideoType = VideoFileType.Unknown, VideoRecordingState = RecordingState.Recorded, Username = feed.Channel.Title, VideoId = enclosure.Url.AbsoluteUri, VideoLength = duration }; media.Add(info); } return(media); }
public HitboxVideoJob( string id, StatusUpdate.IStatusUpdate statusUpdater = null ) { JobStatus = VideoJobStatus.NotStarted; StatusUpdater = statusUpdater == null ? new StatusUpdate.NullStatusUpdate() : statusUpdater; VideoInfo = new GenericVideoInfo() { Service = StreamService.Hitbox, VideoId = id }; Status = "..."; }
public TwitchVideoJob( Twixel api, string id, StatusUpdate.IStatusUpdate statusUpdater = null ) { JobStatus = VideoJobStatus.NotStarted; StatusUpdater = statusUpdater == null ? new StatusUpdate.NullStatusUpdate() : statusUpdater; VideoInfo = new GenericVideoInfo() { Service = StreamService.Twitch, VideoId = id }; TwitchAPI = api; }