mirror of
https://codeberg.org/ashley/poke.git
synced 2025-06-12 23:33:01 -04:00
owo
This commit is contained in:
parent
f431111611
commit
72143fede3
100 changed files with 12438 additions and 0 deletions
45
core/InnerTube/Models/YoutubeVideo.cs
Normal file
45
core/InnerTube/Models/YoutubeVideo.cs
Normal file
|
@ -0,0 +1,45 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
|
||||
namespace InnerTube.Models
|
||||
{
|
||||
public class YoutubeVideo
|
||||
{
|
||||
public string Id;
|
||||
public string Title;
|
||||
public string Description;
|
||||
public Channel Channel;
|
||||
public string UploadDate;
|
||||
public DynamicItem[] Recommended;
|
||||
public string Views;
|
||||
|
||||
public string GetHtmlDescription() => InnerTube.Utils.GetHtmlDescription(Description);
|
||||
|
||||
public XmlDocument GetXmlDocument()
|
||||
{
|
||||
XmlDocument doc = new();
|
||||
XmlElement item = doc.CreateElement("Video");
|
||||
|
||||
item.SetAttribute("id", Id);
|
||||
item.SetAttribute("views", Views);
|
||||
item.SetAttribute("uploadDate", UploadDate);
|
||||
|
||||
XmlElement title = doc.CreateElement("Title");
|
||||
title.InnerText = Title;
|
||||
item.AppendChild(title);
|
||||
|
||||
XmlElement description = doc.CreateElement("Description");
|
||||
description.InnerText = Description;
|
||||
item.AppendChild(description);
|
||||
|
||||
item.AppendChild(Channel.GetXmlElement(doc));
|
||||
|
||||
XmlElement recommendations = doc.CreateElement("Recommendations");
|
||||
foreach (DynamicItem f in Recommended ?? Array.Empty<DynamicItem>()) recommendations.AppendChild(f.GetXmlElement(doc));
|
||||
item.AppendChild(recommendations);
|
||||
|
||||
doc.AppendChild(item);
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue