All about Macrotube

Post Reply
jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

All about Macrotube

#1

Post by jachin99 » Tue Jul 10, 2018 2:20 am

I'm starting a thread about Macrotube because I was able to dig up a large collection of providers from the web archive. Macrotube can get a little complicated because different sites may require various codecs or bits of software in order to play videos correctly. QuickTime, and Adobe shockwave are a few examples of these complications. In spite of this, I will be posting the xml files to various providers as I get time to do so. If someone needs help adding these providers then please speak up, and I will offer whatever help I can. Until then, there is link to the old TGB forums about microtube: https://web.archive.org/web/20100501074 ... geIndex=12
Here is my first provider.xm file. I haven't been able to give these a proper test yet so please be aware of that.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<VideoService
	DefaultCategoryTransform="Feed"
	DefaultCategoryUrl="http://www.escapistmagazine.com/rss/videos/list/1.xml"
    Description="Zero Punctuation is The Escapist's groundbreaking video review series starring Ben 'Yahtzee' Croshaw. Every Wednesday Zero Punctuation picks apart the games so you don't have to."
	Enabled="false"
    Image="http://services.jasmio.com/macrotube/providers/ZeroPunctuation.png"
	Name="Zero Punctuation"
	IsMultipage="False"
	Type="XSLT"
	UpdateUrl="http://services.jasmio.com/macrotube/providers/ZeroPunctuation.xml"
	Version="1.0"
	>
	<Categories>
		<Category ID="all" Name="All" />
	</Categories>
	<SortOrders>
		<SortOrder ID="date" Name="date" />
	</SortOrders>
	<Transforms>
		<Transform Name="Feed">
			<xsl:stylesheet
				version="1.0"
				xmlns:dc="http://purl.org/dc/elements/1.1/"
				xmlns:content="http://purl.org/rss/1.0/modules/content/"
				
				xmlns:atom="http://www.w3.org/2005/Atom"
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"
				xmlns:gml="http://www.opengis.net/gml"
				xmlns:georss="http://www.georss.org/georss"
				xmlns:media="http://search.yahoo.com/mrss/"
				xmlns:yt="http://gdata.youtube.com/schemas/2007"
				xmlns:gd="http://schemas.google.com/g/2005"
				xmlns:msxsl="urn:schemas-microsoft-com:xslt"
				xmlns:func="urn:local-functions"
				>
				<msxsl:script language="C#" implements-prefix="func">
				<![CDATA[
				
				static Regex descMatch = new Regex(@"^.*<p>(.+?)</p>.*", RegexOptions.Compiled);
				
				public string escapeuridata(string unescaped)
				{
					return Uri.EscapeDataString(unescaped);
				}
				public string fixdesc(string source)
				{
				  return string.Format("{0}", descMatch.Replace(source, @"$1"));
				}
				public string fixdate(string source)
				{
				  return Regex.Replace(source, ".{3}$", "+0000");
				}
				]]>
				</msxsl:script>

				<xsl:output indent="yes" method="xml" />
			   <xsl:template match="item">
				<xsl:element name="item">
				  <xsl:attribute name="date">
				    <xsl:value-of select="func:fixdate(pubDate)" />
				  </xsl:attribute>
				  <xsl:attribute name="duration">
				    500
				  </xsl:attribute>
				  <xsl:attribute name="title">
				    <xsl:value-of select="title" />
				  </xsl:attribute>
				  <xsl:attribute name="rating">
				    0
				  </xsl:attribute>
				  <xsl:element name="description">
				    <xsl:value-of select="func:fixdesc(description)" />
				  </xsl:element>
				  <xsl:element name="thumbnails">
				    <xsl:element name="thumbnail">
					 <xsl:attribute name="width">150</xsl:attribute>
					 <xsl:attribute name="height">128</xsl:attribute>
					 <xsl:attribute name="url">http://img1.imageshack.us/thumbnail.png</xsl:attribute>
					</xsl:element>
				  </xsl:element>
				  <xsl:element name="videos">
				    <xsl:element name="video">
					 <xsl:attribute name="type">video/mpeg</xsl:attribute>
					 <xsl:attribute name="url">
					   <xsl:value-of select="link" />
					 </xsl:attribute>
				    </xsl:element>
				  </xsl:element>
				</xsl:element>
			   </xsl:template>
			   <xsl:template match="/">
				<xsl:element name="items">
				  <xsl:apply-templates select="//item" />
				</xsl:element>
			   </xsl:template>
			</xsl:stylesheet>
		</Transform>
	</Transforms>
	<VideoProviders>
		<VideoProvider class="MacroTube.Model.ZeroPunctuationProvider">
					<![CDATA[

using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;

namespace MacroTube.Model
{
	public class ZeroPunctuationProvider : VideoProvider
	{
		private static readonly Regex _watchMatch = new Regex(@"^http://www.escapistmagazine.com/.*", RegexOptions.Compiled);
		
		private static readonly Regex _jsMatch = new Regex(@"^.*flashvars=""config=(.+?)"".*", RegexOptions.Compiled | RegexOptions.Singleline);
		
		private static readonly Regex _urlMatch = new Regex(@"^.*url':'(http://video2.+?)'.*", RegexOptions.Compiled | RegexOptions.Singleline);

		public YouTubeVideoProvider()
			: base()
		{
		}

		public override string GetDownloadUrl(string sourceURL)
		{
			if (!IsProvider(sourceURL)) return null;

			string newsourceURL = null;
			string resolvedURL = null;

			Debug.WriteLine(string.Format("Source URL: {0}", sourceURL));

			try
			{
				WebClient client = new WebClient();

				string html = client.DownloadString(sourceURL);

				newsourceURL = string.Format("{0}", _jsMatch.Replace(html, "$1"));

				Debug.WriteLine(string.Format("New Source URL: {0}", newsourceURL));
				
				client.Headers.Clear();
				client.Headers.Add("Referer", sourceURL);
				
				string newhtml = client.DownloadString(newsourceURL);
				
				Debug.WriteLine("NEW HTML: " + newhtml);

				resolvedURL = string.Format("{0}", _urlMatch.Replace(newhtml, "$1"));

				Debug.WriteLine(string.Format("Resolved URL: {0}", resolvedURL));
			}
			catch (Exception ex)
			{
                Debug.WriteLine(string.Format("Error getting download URL: {0}\r\n{1}\r\n{2}", sourceURL, ex));
			}

			return Uri.IsWellFormedUriString(resolvedURL, UriKind.Absolute) ? resolvedURL : null;
		}

		public override bool IsProvider(string url)
		{
			return _watchMatch.IsMatch(url);
		}
	}
}

		]]></VideoProvider>
	</VideoProviders>
</VideoService>

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#2

Post by jachin99 » Sat Jul 14, 2018 7:07 pm

This adds MSDN Channel 9, and still works however most of the content is old. I peeked at the MSDN page, and there are 119 pages of various shows. The All sort will show current content but for anything specific, you will have to add the name of the show.

Code: Select all

<VideoService
	Name="MSDN Channel 9"
	Description="Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with."
	Image="file://c:\programdata\jasmio\macrotube\providers\channel9.png"
	DefaultCategoryUrl="http://channel9.msdn.com/shows/{Category.ID}/RSS/"
	DefaultCategoryTransform="Feed"
	SearchUrl="http://channel9.msdn.com/tags/{SearchTerm}/RSS/"
	SearchTransform="Feed"
	IsMultipage="False"
	Type="XSLT"
	>
	<Categories>
		<Category ID="Featured" Name="Featured" Url="http://channel9.msdn.com/Feeds/RSS/" />
		<Category ID="Videos" Name="Videos" Url="http://channel9.msdn.com/Media/Videos/RSS/" />
		<Category ID="Screencasts" Name="Screencasts" Url="http://channel9.msdn.com/Media/Screencasts/RSS/" />
		<Category ID="Podcasts" Name="Podcasts" Url="http://channel9.msdn.com/Media/Podcasts/RSS/" />
		<Category ID="10-4" Name="10-4" />
		<Category ID="Access" Name="Access Show" />
		<Category ID="ARCast.tv" Name="ARCast.tv" />
		<Category ID="Behind+The+Code" Name="Behind The Code" />
		<Category ID="ButWhy" Name="But Why" />
		<Category ID="Cloud+Cover" Name="Cloud Cover" />
		<Category ID="Communicating" Name="Communicating" />
		<Category ID="Endpoint" Name="endpoint.tv" />
		<Category ID="geekSpeak" Name="geekSpeak" />
		<Category ID="Going+Deep" Name="Going Deep" />
		<Category ID="History" Name="History of MS" />
		<Category ID="The+HPC+Show" Name="HPC Show" />
		<Category ID="Identity" Name="Id Element" />
		<Category ID="InsideXbox" Name="Inside Xbox" />
		<Category ID="The+Knowledge+Chamber" Name="Knowledge Chamber" />
		<Category ID="TheOfficeBlog" Name="Office Blog" />
		<Category ID="PingShow" Name="Ping!" />
		<Category ID="SilverlightTV" Name="Silverlight TV" />
		<Category ID="VisualStudioDocumentary" Name="VS Documentary" />
		<Category ID="This+Week+On+Channel+9" Name="This Week" />
		<Category ID="WM_IN" Name="WM_IN" />
	</Categories>
	<SortOrders>
		<SortOrder ID="date" Name="Date" />
	</SortOrders>
	<Transforms>
		<Transform Name="Feed">
			<xsl:stylesheet version="1.0"
				xmlns:media="http://search.yahoo.com/mrss/"
				xmlns:evnet="http://www.mscommunities.com/rssmodule/"
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:msxsl="urn:schemas-microsoft-com:xslt"
				xmlns:func="urn:local-functions">
				<msxsl:script language="C#" implements-prefix="func">
					<![CDATA[
    
					public bool HasVideo(string Enclosure)
					{
					  return Enclosure.Length != 0;
					}
		            
					public string ResolveDescription(string Description)
					{
					   return Description.Replace("<br />","").Replace("<p>","").Replace("</p>","").Trim();
					}
		    
					]]>
				</msxsl:script>
				<xsl:output indent="yes" method="xml" />
				<xsl:template match="item">
					<xsl:if test="func:HasVideo(enclosure/@url)">
						<xsl:element name="item">
							<xsl:attribute name="date">
								<xsl:value-of select="pubDate" />
							</xsl:attribute>
							<xsl:attribute name="duration">
								<xsl:value-of select="media:group/media:content/@duration" />
							</xsl:attribute>
							<xsl:attribute name="rating">100</xsl:attribute>
							<xsl:attribute name="title">
								<xsl:value-of select="title" />
							</xsl:attribute>
							<xsl:element name="description">
								<xsl:value-of select="func:ResolveDescription(evnet:previewtext)" />
							</xsl:element>
							<xsl:element name="thumbnails">
								<xsl:element name="thumbnail">
									<xsl:attribute name="height">240</xsl:attribute>
									<xsl:attribute name="url">
										<xsl:value-of select="media:thumbnail/@url" />
									</xsl:attribute>
									<xsl:attribute name="width">320</xsl:attribute>
								</xsl:element>
							</xsl:element>
							<xsl:element name="videos">
								<xsl:element name="video">
									<xsl:attribute name="type">video/x-ms-wmv</xsl:attribute>
									<xsl:attribute name="url">
										<xsl:value-of select="enclosure/@url" />
									</xsl:attribute>
								</xsl:element>
							</xsl:element>
						</xsl:element>
					</xsl:if>
				</xsl:template>
				<xsl:template match="rss/channel">
					<xsl:element name="items">
						<xsl:apply-templates select="item" />
					</xsl:element>
				</xsl:template>
			</xsl:stylesheet>
		</Transform>
	</Transforms>
</VideoService>

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#3

Post by jachin99 » Sat Jul 14, 2018 7:08 pm

This adds MSDN Channel 9, and still works however most of the content is old. I peeked at the MSDN page, and there are 119 pages of various shows. The featured, videos, podcasts, and screencasts sorts will show current content but for anything specific, you will have to add the name of the show.

Code: Select all

<VideoService
	Name="MSDN Channel 9"
	Description="Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with."
	Image="file://c:\programdata\jasmio\macrotube\providers\channel9.png"
	DefaultCategoryUrl="http://channel9.msdn.com/shows/{Category.ID}/RSS/"
	DefaultCategoryTransform="Feed"
	SearchUrl="http://channel9.msdn.com/tags/{SearchTerm}/RSS/"
	SearchTransform="Feed"
	IsMultipage="False"
	Type="XSLT"
	>
	<Categories>
		<Category ID="Featured" Name="Featured" Url="http://channel9.msdn.com/Feeds/RSS/" />
		<Category ID="Videos" Name="Videos" Url="http://channel9.msdn.com/Media/Videos/RSS/" />
		<Category ID="Screencasts" Name="Screencasts" Url="http://channel9.msdn.com/Media/Screencasts/RSS/" />
		<Category ID="Podcasts" Name="Podcasts" Url="http://channel9.msdn.com/Media/Podcasts/RSS/" />
		<Category ID="10-4" Name="10-4" />
		<Category ID="Access" Name="Access Show" />
		<Category ID="ARCast.tv" Name="ARCast.tv" />
		<Category ID="Behind+The+Code" Name="Behind The Code" />
		<Category ID="ButWhy" Name="But Why" />
		<Category ID="Cloud+Cover" Name="Cloud Cover" />
		<Category ID="Communicating" Name="Communicating" />
		<Category ID="Endpoint" Name="endpoint.tv" />
		<Category ID="geekSpeak" Name="geekSpeak" />
		<Category ID="Going+Deep" Name="Going Deep" />
		<Category ID="History" Name="History of MS" />
		<Category ID="The+HPC+Show" Name="HPC Show" />
		<Category ID="Identity" Name="Id Element" />
		<Category ID="InsideXbox" Name="Inside Xbox" />
		<Category ID="The+Knowledge+Chamber" Name="Knowledge Chamber" />
		<Category ID="TheOfficeBlog" Name="Office Blog" />
		<Category ID="PingShow" Name="Ping!" />
		<Category ID="SilverlightTV" Name="Silverlight TV" />
		<Category ID="VisualStudioDocumentary" Name="VS Documentary" />
		<Category ID="This+Week+On+Channel+9" Name="This Week" />
		<Category ID="WM_IN" Name="WM_IN" />
	</Categories>
	<SortOrders>
		<SortOrder ID="date" Name="Date" />
	</SortOrders>
	<Transforms>
		<Transform Name="Feed">
			<xsl:stylesheet version="1.0"
				xmlns:media="http://search.yahoo.com/mrss/"
				xmlns:evnet="http://www.mscommunities.com/rssmodule/"
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:msxsl="urn:schemas-microsoft-com:xslt"
				xmlns:func="urn:local-functions">
				<msxsl:script language="C#" implements-prefix="func">
					<![CDATA[
    
					public bool HasVideo(string Enclosure)
					{
					  return Enclosure.Length != 0;
					}
		            
					public string ResolveDescription(string Description)
					{
					   return Description.Replace("<br />","").Replace("<p>","").Replace("</p>","").Trim();
					}
		    
					]]>
				</msxsl:script>
				<xsl:output indent="yes" method="xml" />
				<xsl:template match="item">
					<xsl:if test="func:HasVideo(enclosure/@url)">
						<xsl:element name="item">
							<xsl:attribute name="date">
								<xsl:value-of select="pubDate" />
							</xsl:attribute>
							<xsl:attribute name="duration">
								<xsl:value-of select="media:group/media:content/@duration" />
							</xsl:attribute>
							<xsl:attribute name="rating">100</xsl:attribute>
							<xsl:attribute name="title">
								<xsl:value-of select="title" />
							</xsl:attribute>
							<xsl:element name="description">
								<xsl:value-of select="func:ResolveDescription(evnet:previewtext)" />
							</xsl:element>
							<xsl:element name="thumbnails">
								<xsl:element name="thumbnail">
									<xsl:attribute name="height">240</xsl:attribute>
									<xsl:attribute name="url">
										<xsl:value-of select="media:thumbnail/@url" />
									</xsl:attribute>
									<xsl:attribute name="width">320</xsl:attribute>
								</xsl:element>
							</xsl:element>
							<xsl:element name="videos">
								<xsl:element name="video">
									<xsl:attribute name="type">video/x-ms-wmv</xsl:attribute>
									<xsl:attribute name="url">
										<xsl:value-of select="enclosure/@url" />
									</xsl:attribute>
								</xsl:element>
							</xsl:element>
						</xsl:element>
					</xsl:if>
				</xsl:template>
				<xsl:template match="rss/channel">
					<xsl:element name="items">
						<xsl:apply-templates select="item" />
					</xsl:element>
				</xsl:template>
			</xsl:stylesheet>
		</Transform>
	</Transforms>
</VideoService>

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#4

Post by jachin99 » Mon Jul 23, 2018 3:10 pm

This adds Twit TV, which also still works but doesn't have some newer content

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<VideoService
	Author="Boondoklife"
	DefaultCategoryTransform="Feed"
	DefaultCategoryUrl="http://feeds.twit.tv/{Category.ID}_video_{SortOrder}"
	Description="Leo Laporte and friends present the TWiT network. Netcasts you love, from people you trust."
	Image="http://mainwall1.us.to/macrotube/providers/Twit.png"
	IsMultipage="False"
	Name="TWIT.tv"
	Type="XSLT"
	UpdateUrl="http://mainwall1.us.to/macrotube/providers/Twit.xml"
	Version="2.1"
	>
	<Categories>
		<Category
			ID="aaa"
			Name="All About Android"
		/>
		<Category
			ID="byb"
			Name="Before You Buy"
		/>
		<Category
			ID="floss"
			Name="floss Weekly"
		/>
		<Category
			ID="fr"
			Name="Frame Rate"
		/>
		<Category
			ID="hn"
			Name="Ham Nation"
		/>
		<Category
			ID="htg"
			Name="Home Theater Geek"
		/>
		<Category
			ID="ifive"
			Name="iFive for the iPhone"
		/>
		<Category
			ID="ipad"
			Name="iPad Today"
		/>
		<Category
			ID="kh"
			Name="Know How..."
		/>
		<Category
			ID="mbw"
			Name="MacBreak Weekly"
		/>
		<Category
			ID="nsfw"
			Name="NSFW"
		/>
		<Category
			ID="sn"
			Name="Security Now"
		/>
		<Category
			ID="tnt"
			Name="Tech News Today"
		/>
		<Category
			ID="dgw"
			Name="The Giz Wiz"
		/>
		<Category
			ID="natn"
			Name="The Social Hour"
		/>
		<Category
			ID="ttg"
			Name="The Tech Guy"
		/>
		<Category
			ID="twich"
			Name="This Week in Computer Hardware"
		/>
		<Category
			ID="twiet"
			Name="This Week in Enterprise Tech"
		/>
		<Category
			ID="twig"
			Name="This Week in Google"
		/>
		<Category
			ID="twil"
			Name="This Week in Law"
		/>
		<Category
			ID="twit"
			Name="This Week in Tech"
		/>
		<Category
			ID="tri"
			Name="Triangulation"
		/>
		<Category
			ID="specials"
			Name="TwiT Live Specials"
		/>
		<Category
			ID="ww"
			Name="Windows Weekly"
		/>
	</Categories>
	<SortOrders>
		<SortOrder
			ID="hd"
			Name="HD"
		/>
		<SortOrder
			ID="large"
			Name="Large"
		/>
		<SortOrder
			ID="small"
			Name="small"
		/>
	</SortOrders>
	<Transforms>
		<Transform Name="Feed">
			<xsl:stylesheet
			 version="1.0"
			 xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
			 xmlns:media="http://search.yahoo.com/mrss"
			 xmlns:dm="http://www.dailymotion.com/dmrss"
			 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
			 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
			 xmlns:func="urn:local-functions"
			 xmlns:mediafly="http://mediafly.com/xsd/RSS/1.0"
			 xmlns:atom="http://www.w3.org/2005/Atom">
				<msxsl:script language="C#" implements-prefix="func">
				<![CDATA[
					public string ReplaceVideoUrl(string VideoUrl)
					{
						return VideoUrl.Replace("h264b_640x368_500", "h264b_864x480_2000") ;
					}

					public string TruncateSummary(string summary)
					{
						return summary.Substring(0, 80)+"...";
					}

					public string CleanTitle(string title)
					{
						return System.Text.RegularExpressions.Regex.Replace(title, @"^[^:]+:\s+(.*)$", "$1");
					}

					public string GetThumbnail(string thumb)
					{
						string thumbPrefix = "http://feeds.twit.tv/podcasts/coverart/";
						string thumbSuffix = "600video.jpg";
						string thumbDefault = "http://www.cmikeb.com/wp-content/uploads/2010/10/twit-logo-150x150.jpg";

						if (thumb.Contains ("aaa") == true)
						{
							return thumbPrefix+"aaa"+thumbSuffix;
						}
						else if (thumb.Contains ("byb") == true)
						{
							return thumbPrefix+"byb"+thumbSuffix;
						}
						else if (thumb.Contains ("dgw") == true)
						{
							return thumbPrefix+"dgw"+thumbSuffix;
						}
						else if (thumb.Contains ("floss") == true)
						{
							return thumbPrefix+"floss"+thumbSuffix;
						}
						else if (thumb.Contains ("fr") == true)
						{
							return thumbPrefix+"fr"+thumbSuffix;
						}
						else if (thumb.Contains ("hn") == true)
						{
							return thumbPrefix+"hn"+thumbSuffix;
						}
						else if (thumb.Contains ("htg") == true)
						{
							return thumbPrefix+"htg"+thumbSuffix;
						}
						else if (thumb.Contains ("ifive") == true)
						{
							return thumbPrefix+"ifive"+thumbSuffix;
						}
						else if (thumb.Contains ("ipad") == true)
						{
							return thumbPrefix+"ipad"+thumbSuffix;
						}
						else if (thumb.Contains ("kh") == true)
						{
							return thumbPrefix+"kh"+thumbSuffix;
						}
						else if (thumb.Contains ("mbw") == true)
						{
							return thumbPrefix+"mbw"+thumbSuffix;
						}
						else if (thumb.Contains ("nsfw") == true)
						{
							return thumbPrefix+"nsfw"+thumbSuffix;
						}
						else if (thumb.Contains ("specials") == true)
						{
							return thumbPrefix+"specials"+thumbSuffix;
						}
						else if (thumb.Contains ("sn") == true)
						{
							return thumbPrefix+"sn"+thumbSuffix;
						}
						else if (thumb.Contains ("tnt") == true)
						{
							return thumbPrefix+"tnt"+thumbSuffix;
						}
						else if (thumb.Contains ("tsh") == true)
						{
							return thumbPrefix+"tsh"+thumbSuffix;
						}
						else if (thumb.Contains ("ttg") == true)
						{
							return thumbPrefix+"ttg"+thumbSuffix;
						}
						else if (thumb.Contains ("twich") == true)
						{
							return thumbPrefix+"twich"+thumbSuffix;
						}
						else if (thumb.Contains ("twiet") == true)
						{
							return thumbPrefix+"twiet"+thumbSuffix;
						}
						else if (thumb.Contains ("twig") == true)
						{
							return thumbPrefix+"twig"+thumbSuffix;
						}
						else if (thumb.Contains ("twil") == true)
						{
							return thumbPrefix+"twil"+thumbSuffix;
						}
						else if (thumb.Contains ("twit/") == true)
						{
							return thumbPrefix+"twit"+thumbSuffix;
						}
						else if (thumb.Contains ("tri") == true)
						{
							return thumbPrefix+"tri"+thumbSuffix;
						}
						else if (thumb.Contains ("ww") == true)
						{
							return thumbPrefix+"ww"+thumbSuffix;
						}
						else 
						{
							return thumbDefault;
						}
					}
			    ]]>
				</msxsl:script>
				<xsl:output indent="yes" method="xml" />
				<xsl:template match="item">
					<xsl:element name="item">
						<xsl:attribute name="date">
							<xsl:value-of select="pubDate"/>
						</xsl:attribute>
						<xsl:attribute name="duration">
							<xsl:value-of select="itunes:duration"/>
						</xsl:attribute>
						<xsl:attribute name="title">
							<xsl:value-of select="func:CleanTitle(title)"/>
						</xsl:attribute>
						<xsl:attribute name="rating">
							<xsl:value-of select="100"/>
						</xsl:attribute>
						<xsl:element name="description">
							<xsl:value-of select="func:TruncateSummary(itunes:summary)"/>
						</xsl:element>
						<xsl:element name="thumbnails">
							<xsl:element name="thumbnail">
								<xsl:attribute name="height">95</xsl:attribute>
								<xsl:attribute name="url">
									<xsl:value-of select="func:GetThumbnail(enclosure/@url)"/>
								</xsl:attribute>
								<xsl:attribute name="width">169</xsl:attribute>
							</xsl:element>
						</xsl:element>
						<xsl:element name="videos">
							<xsl:element name="video">
								<xsl:attribute name="type">
									<xsl:value-of select="enclosure/@type"/>
								</xsl:attribute>
								<xsl:attribute name="url">
									<xsl:value-of select="func:ReplaceVideoUrl(enclosure/@url)"/>
								</xsl:attribute>
							</xsl:element>
						</xsl:element>
					</xsl:element>
				</xsl:template>
				<xsl:template match="/">
					<xsl:element name="items">
						<xsl:apply-templates select="//item"/>
					</xsl:element>
				</xsl:template>
			</xsl:stylesheet>
		</Transform>
	</Transforms>
</VideoService>

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#5

Post by jachin99 » Mon Jul 23, 2018 3:11 pm

This adds esa. The URLs are still good but the content is old

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<VideoService Name="Science@ESA vodcasts"
              Description="The Science@ESA vodcasts explore the extraordinary Universe in which we live as it is seen through the eyes of ESA's fleet of science spacecraft. Visit http://astronomy2009.esa.int"
              Image="{ServicesPath}\ESA Science.png"
              DefaultCategoryUrl="http://sci.esa.int/vodcasts/scienceatesa/rss.xml"
              DefaultCategoryTransform="Feed"
              IsMultipage="False"
              Type="XSLT" 
              Version="0.2">
  
  <Categories>
    <Category ID="Science" Name="SD"  Url="http://sci.esa.int/vodcasts/scienceatesa/rss.xml" /> 
  <Category ID="ScienceHD" Name="HD" Url="http://sci.esa.int/vodcasts/hd/scienceatesa/rss.xml" /> 
  </Categories>
  
  <SortOrders>
    <SortOrder ID="date" Name="Date" />
  </SortOrders>
  
  <Transforms>
    <Transform Name="Feed">
      <xsl:stylesheet version="1.0"
                xmlns:content="http://purl.org/rss/1.0/modules/content/"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:func="urn:local-functions"
                xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
                xmlns:media="http://search.yahoo.com/mrss/">

        <msxsl:script language="C#" implements-prefix="func">
          <![CDATA[
    
    
    ]]>
        </msxsl:script>
        <xsl:output indent="yes" method="xml" />

        <xsl:template match="item">
            <xsl:element name="item">
		<xsl:attribute name="date">
                	<xsl:value-of select="pubDate" />
		</xsl:attribute>
      		<xsl:attribute name="duration">
			<xsl:value-of select="300" />
		</xsl:attribute>
		<xsl:attribute name="rating">
			<xsl:value-of select="100" />
		</xsl:attribute>
		<xsl:attribute name="title">
			<xsl:value-of select="title" />
		</xsl:attribute>
		<xsl:element name="description">
	                <xsl:value-of select="itunes:summary" />
		</xsl:element>
              <xsl:element name="thumbnails">
                <xsl:element name="thumbnail">
                  <xsl:attribute name="height">120</xsl:attribute>
                  <xsl:attribute name="url">http://sci.esa.int/science-e-media/img/8e/IntroEpisode600.jpg</xsl:attribute>
                  <xsl:attribute name="width">192</xsl:attribute>
                </xsl:element>
              </xsl:element>
		<xsl:element name="videos">
                <xsl:element name="video">
			<xsl:attribute name="type"><xsl:value-of select="enclosure/@type"/></xsl:attribute>
			<xsl:attribute name="url"><xsl:value-of select="enclosure/@url"/></xsl:attribute>
		</xsl:element>
		</xsl:element>
            </xsl:element>
        </xsl:template>

        <xsl:template match="rss/channel">
          <xsl:element name="items">
            <xsl:apply-templates select="item" />
          </xsl:element>
        </xsl:template>


      </xsl:stylesheet>
    </Transform>
  
  </Transforms>
  
</VideoService>

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#6

Post by jachin99 » Mon Jul 23, 2018 3:18 pm

This adds the TV Archive, and still works

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<VideoService Name="Archive Classic TV"
              Description="Focus is on content made more than 30 years ago, and more specifically on movies and TV from the 1930s, 40s, 50s and 60s, when they really knew how to make 'em!, but any classics from 1930`s to 1980`s is welcome."
              Image="{ServicesPath}\Archive Classic TV.png"
              DefaultCategoryUrl="http://feeds2.feedburner.com/ArchiveClassicTv"
              DefaultCategoryTransform="Feed"
              IsMultipage="False"
              Type="XSLT" 
              Version="0.2">
    <Categories>
    <Category ID="Stories" Name="Soapbox" />
  </Categories>
  
  <SortOrders>
    <SortOrder ID="date" Name="Date" />
  </SortOrders>
  
  <Transforms>
    <Transform Name="Feed">
      <xsl:stylesheet version="1.0"
                xmlns:content="http://purl.org/rss/1.0/modules/content/"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                xmlns:func="urn:local-functions"
                xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
                xmlns:media="http://search.yahoo.com/mrss/">

        <msxsl:script language="C#" implements-prefix="func">
          <![CDATA[
    
    
    ]]>
        </msxsl:script>
        <xsl:output indent="yes" method="xml" />

        <xsl:template match="item">
            <xsl:element name="item">
		<xsl:attribute name="date">
                	<xsl:value-of select="pubDate" />
		</xsl:attribute>
      		<xsl:attribute name="duration">
			<xsl:value-of select="300" />
		</xsl:attribute>
		<xsl:attribute name="rating">
			<xsl:value-of select="100" />
		</xsl:attribute>
		<xsl:attribute name="title">
			<xsl:value-of select="title" />
		</xsl:attribute>
		<xsl:element name="description">
	                <xsl:value-of select="itunes:summary" />
		</xsl:element>
              <xsl:element name="thumbnails">
                <xsl:element name="thumbnail">
                  <xsl:attribute name="height">120</xsl:attribute>
                  <xsl:attribute name="url">http://api.ning.com/files/NxOVmXDgY4PJyxGQXG1GBuIisk0Vh8Q9lUoaWoOuVq6BP3foGCM9L7zEIBBuOII2VhcGFIGiaO3hQGZfnMtqah0J0C1cXRlE/classicshows320x200.jpg?crop=1%3A1&width=171
 </xsl:attribute>
                  <xsl:attribute name="width">192</xsl:attribute>
                </xsl:element>
              </xsl:element>
		<xsl:element name="videos">
                <xsl:element name="video">
			<xsl:attribute name="type"><xsl:value-of select="enclosure/@type"/></xsl:attribute>
			<xsl:attribute name="url"><xsl:value-of select="enclosure/@url"/></xsl:attribute>
		</xsl:element>
		</xsl:element>
            </xsl:element>
        </xsl:template>

        <xsl:template match="rss/channel">
          <xsl:element name="items">
            <xsl:apply-templates select="item" />
          </xsl:element>
        </xsl:template>


      </xsl:stylesheet>
    </Transform>
  
  </Transforms>
  
</VideoService>

User avatar
DavidinCT

Posts: 1556
Joined: Mon Feb 13, 2012 3:45 pm
Location:

HTPC Specs: Show details

#7

Post by DavidinCT » Sun Jul 29, 2018 5:10 pm

Nice to have a list of things for this but, 95% of the stuff you have listed has old content, Used to use this app a lot when it was a active app... Anything more modern ?
-Dave
Twitter @TheCoolDave

Windows Media Center certified and WMC MVP 2010 - 2012

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#8

Post by jachin99 » Thu Aug 02, 2018 2:13 am

DavidinCT wrote:Nice to have a list of things for this but, 95% of the stuff you have listed has old content, Used to use this app a lot when it was a active app... Anything more modern ?
Twit TV, and Channel 9 still have current, regularly updated content but the TV Archive feed hasn't been updated in four years I believe. Here is one for Zero Puncutation, which has a current feeds.

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<VideoService
	DefaultCategoryTransform="Feed"
	DefaultCategoryUrl="http://www.escapistmagazine.com/rss/videos/list/1.xml"
    Description="Zero Punctuation is The Escapist's groundbreaking video review series starring Ben 'Yahtzee' Croshaw. Every Wednesday Zero Punctuation picks apart the games so you don't have to."
	Enabled="true"
    Image="http://services.jasmio.com/macrotube/providers/ZeroPunctuation.png"
	Name="Zero Punctuation"
	IsMultipage="False"
	Type="XSLT"
	UpdateUrl="http://services.jasmio.com/macrotube/providers/ZeroPunctuation.xml"
	Version="1.0"
	>
	<Categories>
		<Category ID="all" Name="All" />
	</Categories>
	<SortOrders>
		<SortOrder ID="date" Name="date" />
	</SortOrders>
	<Transforms>
		<Transform Name="Feed">
			<xsl:stylesheet
				version="1.0"
				xmlns:dc="http://purl.org/dc/elements/1.1/"
				xmlns:content="http://purl.org/rss/1.0/modules/content/"
				
				xmlns:atom="http://www.w3.org/2005/Atom"
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"
				xmlns:gml="http://www.opengis.net/gml"
				xmlns:georss="http://www.georss.org/georss"
				xmlns:media="http://search.yahoo.com/mrss/"
				xmlns:yt="http://gdata.youtube.com/schemas/2007"
				xmlns:gd="http://schemas.google.com/g/2005"
				xmlns:msxsl="urn:schemas-microsoft-com:xslt"
				xmlns:func="urn:local-functions"
				>
				<msxsl:script language="C#" implements-prefix="func">
				<![CDATA[
				
				static Regex descMatch = new Regex(@"^.*<p>(.+?)</p>.*", RegexOptions.Compiled);
				
				public string escapeuridata(string unescaped)
				{
					return Uri.EscapeDataString(unescaped);
				}
				public string fixdesc(string source)
				{
				  return string.Format("{0}", descMatch.Replace(source, @"$1"));
				}
				public string fixdate(string source)
				{
				  return Regex.Replace(source, ".{3}$", "+0000");
				}
				]]>
				</msxsl:script>

				<xsl:output indent="yes" method="xml" />
			   <xsl:template match="item">
				<xsl:element name="item">
				  <xsl:attribute name="date">
				    <xsl:value-of select="func:fixdate(pubDate)" />
				  </xsl:attribute>
				  <xsl:attribute name="duration">
				    500
				  </xsl:attribute>
				  <xsl:attribute name="title">
				    <xsl:value-of select="title" />
				  </xsl:attribute>
				  <xsl:attribute name="rating">
				    0
				  </xsl:attribute>
				  <xsl:element name="description">
				    <xsl:value-of select="func:fixdesc(description)" />
				  </xsl:element>
				  <xsl:element name="thumbnails">
				    <xsl:element name="thumbnail">
					 <xsl:attribute name="width">150</xsl:attribute>
					 <xsl:attribute name="height">128</xsl:attribute>
					 <xsl:attribute name="url">http://img1.imageshack.us/thumbnail.png</xsl:attribute>
					</xsl:element>
				  </xsl:element>
				  <xsl:element name="videos">
				    <xsl:element name="video">
					 <xsl:attribute name="type">video/mpeg</xsl:attribute>
					 <xsl:attribute name="url">
					   <xsl:value-of select="link" />
					 </xsl:attribute>
				    </xsl:element>
				  </xsl:element>
				</xsl:element>
			   </xsl:template>
			   <xsl:template match="/">
				<xsl:element name="items">
				  <xsl:apply-templates select="//item" />
				</xsl:element>
			   </xsl:template>
			</xsl:stylesheet>
		</Transform>
	</Transforms>
	<VideoProviders>
		<VideoProvider class="MacroTube.Model.ZeroPunctuationProvider">
					<![CDATA[

using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text.RegularExpressions;

namespace MacroTube.Model
{
	public class ZeroPunctuationProvider : VideoProvider
	{
		private static readonly Regex _watchMatch = new Regex(@"^http://www.escapistmagazine.com/.*", RegexOptions.Compiled);
		
		private static readonly Regex _jsMatch = new Regex(@"^.*flashvars=""config=(.+?)"".*", RegexOptions.Compiled | RegexOptions.Singleline);
		
		private static readonly Regex _urlMatch = new Regex(@"^.*url':'(http://video2.+?)'.*", RegexOptions.Compiled | RegexOptions.Singleline);

		public YouTubeVideoProvider()
			: base()
		{
		}

		public override string GetDownloadUrl(string sourceURL)
		{
			if (!IsProvider(sourceURL)) return null;

			string newsourceURL = null;
			string resolvedURL = null;

			Debug.WriteLine(string.Format("Source URL: {0}", sourceURL));

			try
			{
				WebClient client = new WebClient();

				string html = client.DownloadString(sourceURL);

				newsourceURL = string.Format("{0}", _jsMatch.Replace(html, "$1"));

				Debug.WriteLine(string.Format("New Source URL: {0}", newsourceURL));
				
				client.Headers.Clear();
				client.Headers.Add("Referer", sourceURL);
				
				string newhtml = client.DownloadString(newsourceURL);
				
				Debug.WriteLine("NEW HTML: " + newhtml);

				resolvedURL = string.Format("{0}", _urlMatch.Replace(newhtml, "$1"));

				Debug.WriteLine(string.Format("Resolved URL: {0}", resolvedURL));
			}
			catch (Exception ex)
			{
                Debug.WriteLine(string.Format("Error getting download URL: {0}\r\n{1}\r\n{2}", sourceURL, ex));
			}

			return Uri.IsWellFormedUriString(resolvedURL, UriKind.Absolute) ? resolvedURL : null;
		}

		public override bool IsProvider(string url)
		{
			return _watchMatch.IsMatch(url);
		}
	}
}
		]]></VideoProvider>
	</VideoProviders>
</VideoService>
Video links show up in macrotube but for whatever reason I can't get the videos to play. I see an LAV splitter Icon show up in the system tray for a second but then get no video, and the LAV splitter icon goes away. I have shark's advanced codecs installed. I labeled the thread "All about Macrotube" becasue there might be a codec component in terms of restoring everything. The daily motion also has a current feed but won't play videos. In the old TGB forums I saw where a member had trouble with youtube, the daily motion, and others but they resolved it by installing core avc codecs, which were a paid product but have dissapeared. I believe Core AVC was just a H264 codec. I'm still sorting through these but I doubt I will be successful, and I'll likely need help from at least someone who understands XLST. The two I was able to fix are Channel 9, and TV Archive.

User avatar
DavidinCT

Posts: 1556
Joined: Mon Feb 13, 2012 3:45 pm
Location:

HTPC Specs: Show details

#9

Post by DavidinCT » Sat Aug 11, 2018 9:49 pm

If am correct... Macrotube can be setup for any video site that has a RSS feed, you just need to edit the XML file for the site.... To make it a worthy app, it's gota have a ton of current updated options.

jachin99 wrote: Video links show up in macrotube but for whatever reason I can't get the videos to play. I see an LAV splitter Icon show up in the system tray for a second but then get no video, and the LAV splitter icon goes away. I have shark's advanced codecs installed. I labeled the thread "All about Macrotube" becasue there might be a codec component in terms of restoring everything. The daily motion also has a current feed but won't play videos. In the old TGB forums I saw where a member had trouble with youtube, the daily motion, and others but they resolved it by installing core avc codecs, which were a paid product but have dissapeared. I believe Core AVC was just a H264 codec. I'm still sorting through these but I doubt I will be successful, and I'll likely need help from at least someone who understands XLST. The two I was able to fix are Channel 9, and TV Archive.
Open IE, go to the main site with that has the videos in question. Try to play them in IE and see what your results are. This should help you troubleshoot this. On a general note with WMC, if IE and Media player (for other content) can play it, it will work in WMC.

This has always been the case, as it depends on components from both to play.
-Dave
Twitter @TheCoolDave

Windows Media Center certified and WMC MVP 2010 - 2012

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#10

Post by jachin99 » Sat Dec 01, 2018 5:56 am

Perfect candidate for macrotube: https://www.npr.org/rss/podcast.php?id=510292

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#11

Post by jachin99 » Thu May 30, 2019 5:40 pm

A lot of the providers in macrotube came from google's feedburner before it was shut down. I haven't been able to find anything similar but this might be what I have been looking for: https://podsync.net/ It looks to do the same thing as feedburner for youtube and vimeo at least, and it claims to turn individual youtube channels into podcast feeds. With enough work I might be able to create a provider for macrotube that parses podsync xml feeds.

shawty

Posts: 2
Joined: Sun Aug 18, 2019 11:28 am
Location:

HTPC Specs: Show details

#12

Post by shawty » Sun Aug 18, 2019 11:41 am

I registered basically to add this comment to this thread :-)

I was browsing around looking for some info on MCE, when I noticed a lot of mention on "MSDN Channel 9" in this thread.

If you want a good source of the current videos available on modern day channel 9, you might be interested in this little tool I worote last month, so I could grab them to play in Kodi

https://github.com/shawty/MsdnChannel9VideoLister

What it basically does is mine the MSDN C9 site and build two JSON lists, one with all the shows in it can find, and one with the videos available for each show.

It's not a tool that you run every time you want to browse C9 though, as it can take an hour or more to build the lists, I have mine running on an AT job, and it runs it once every 3 days at about 3am, and it saves the JSON files in a shared folder where my Kodi plug in can fetch them using a local web server.

Essentially, someone could probably easily turn the JSON files into RSS style XML files that Macro Tube could then easily use, as everything you need from show name, to author, and video file URL are there.

You could probably write a converter, that runs just after my tool creates the JSON, and then as I have done, place those files on a local web server inside your network, and have macrotube use those.

As part of the same project, I'm currently writing a HbbTV compliant HTML5 app to run directly in the TV browser, that will use the JSON files in the same way as the kodi plug in does, but I've not made much traction on it yet.

It would in theory, also be possible to do a similar thing using the YouTube API (Same way the Kodi plugin works) and then use "youtube-dl" in the background, to stream the YT vids on demand.

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#13

Post by jachin99 » Sun Aug 18, 2019 7:54 pm

https://www.freeformatter.com/json-to-x ... erter.html. Would something like that do the trick? I may look into this a little more but I would like to be universal to any program that can read rss data.

shawty

Posts: 2
Joined: Sun Aug 18, 2019 11:28 am
Location:

HTPC Specs: Show details

#14

Post by shawty » Sun Aug 18, 2019 10:49 pm

jachin99 wrote: Sun Aug 18, 2019 7:54 pm https://www.freeformatter.com/json-to-x ... erter.html. Would something like that do the trick? I may look into this a little more but I would like to be universal to any program that can read rss data.
It probably would yes :-)

I'm just putting my tool out here, for folks to use if they want. If you look in the repo I've provided the sources, and my licence is basically "do what ever the **** you want with the code, without any kind of warranty or support" :-)

The code shows you exactly what you need to read, and where from on the current msdn site, my guess would be that using what I've done as a template, it wouldn't be that difficult to build similar tools for other online sites (I built a few to do the same for a few adult sites that my friend wanted).

What I actually wanted to do eventually, was instead of the lists being scraped into JSON files, I wanted to push them straight into a database, then I was simply just going to build an HTML frontend and Kodi channel, to read the database, display a channel list, and then shows/vids within that channel, I've been looking at the wmc sdk and to be honest, it doesn't look like it would be much of a challenge to also do a wmc port of my kodi plugin, that would directly read the json, my issue is one of time, and well.... lack of it with everything else I have on the go at the moment :-)

jachin99

Posts: 1293
Joined: Wed Feb 24, 2016 3:36 pm
Location:

HTPC Specs: Show details

#15

Post by jachin99 » Fri Sep 27, 2019 2:12 pm


bobfall

Posts: 1
Joined: Mon Nov 18, 2019 1:28 pm
Location:

HTPC Specs: Show details

#16

Post by bobfall » Mon Nov 18, 2019 8:33 pm

Hi all.
Some TV channels now stream their live programmes via YouTube and I wish to play those streams within WMC. The idea is basically to end up with a static thumbnail/icon in Macrotube section, and when I press that, it plays that YouTube live video stream within WMC. There are five or six channels right now I'd wish to have available in this way in WMC. Could anyone please help with a .xml file configuration? OR is there another WMC Addin which may be able to acomplish this? The web=radio equivalent of this would be the SimpleRadio Addin where the XML file contains url or local link for the thumbnail image file, and a link to the live radio station stream for each channel.
Many thanks

Post Reply