Help me understand MacroTube for Windows Media Center

Discussion in 'Mixed Languages' started by jachin99, Oct 17, 2017.

  1. jachin99

    jachin99 MDL Junior Member

    Feb 15, 2016
    53
    3
    0
    I've been toying around with different WMC plugins and WMC itself for about six to eight months now, and I've come across quite a bit of good information and working plugins but I don't know enough about writing software to make much out of it. This weekend I installed macrotube (On WIn 7 and 10) and the software itself works fine as far as I can tell. I have been able to find two working "plugins" for it which enable a user to watch videos on TwiT TV, and somehow Revision 3.

    A little history on macrotube before I desperately ask for help... Macrotube at one point was a youtube plugin that also let users watch streams from other sites. Theses sites were updated via xml files placed in a folder called providers. I can only find two versions of the software and both are beta. Version one was 0.8.1 and version two was .0.8.2 After the second version the developer apparently abandoned it but others were able to discover how to add content to macrotube by placing properly formatted xml documents in the providers folder. One big draw of macrotube was that it read youtube data however macrotube used youtube api v2 which as far as I can tell was only around for a few months. After youtube shutoff their old api the program was never updated to youtube's new api.

    I want to show an example of what a "Providers" xml document looks like hoping that someone here will point me in the right direction in terms of figuring out how to add more providers, and continue development of the program. As far as I can tell macrotube used public rss feeds, and I haven't come across anything that incorporates tokens, cookies or authentication (I could have easily overlooked these given my skill level at this). Please point me in the right direction so that I can add some sites to good 'ol WMC. Here is a link to two working xml plugins. I hope that someone out there will look at this and give me whatever help I can get. The xml is hosted to my onedrive, and here it is https://1drv.ms/f/s!AvAoSdNdORVlgu0bPj5nYRWTU27NKg
     
  2. jachin99

    jachin99 MDL Junior Member

    Feb 15, 2016
    53
    3
    0
    #2 jachin99, Oct 17, 2017
    Last edited: Oct 17, 2017
    (OP)
    In order to make this easier on everyone, here is the example hosted in the onedrive link from above
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <VideoService
        Author="Boondoklife"
        DefaultCategoryTransform="Feed"
        DefaultCategoryUrl="http://revision3.com/{Category.ID}/feed/MP4-{SortOrder}"
        Description="Revision3 is the leading television network for the internet generation. They create and produce all-original episodic community driven programs watched by a super-committed and passionate fan base."
        Enabled="true"
        Image="http://mainwall1.us.to/macrotube/providers/Revision3.png"
        IsMultipage="False"
        Name="Revision3"
        Type="XSLT"
        UpdateUrl="http://mainwall1.us.to/macrotube/providers/Revision3.xml"
        Version="2.1"
        >
        <Categories>
            <Category
                ID="filmriot"
                Name="Film Riot"
            />
            <Category
                ID="hak5"
                Name="Hak5"
            />
            <Category
                ID="lifehacker"
                Name="Lifehacker"
            />      
            <Category
                ID="philipdefranco"
                Name="The Philip DeFranco Show"
            />
            <Category
                ID="scamschool"
                Name="Scam School"
            />
            <Category
                ID="sgnlbysony"
                Name="SGNL by Sony"
            />
            <Category
                ID="technobuffalo"
                Name="TechnoBuffalo"
            />
            <Category
                ID="variant"
                Name="Variant"
            />
        </Categories>
        <SortOrders>
            <SortOrder
                ID="hd30"
                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"
                    >
                    <msxsl:script language="C#" implements-prefix="func">
                    <![CDATA[
                    static Regex thumbnailMatch = new Regex(@"^.*revision3/web/([^-]*--[^-]*--.*--).*\..*$", RegexOptions.Compiled);
                   
                    public string deriveThumbnailUrl(string videoUrl)
                    {
                        return string.Format("http://bitcast-a.bitgravity.com/revision3/images/shows/{0}medium.thumb.jpg", thumbnailMatch.Replace(videoUrl, @"$1"));
                    }
                    ]]>
                    </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="media:content/@duration"/>
                            </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="description"/>
                            </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:deriveThumbnailUrl(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="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>