Quantcast
Channel: Plex Channel Plugins — Plex Forums
Viewing all articles
Browse latest Browse all 5522

HGTV Full Episode Fix

$
0
0

It looks like HGTV changed there site structure (a lot!). Wife wants it, I need to fix it :) I'm not the author of the plugin, but here's the fix for the full episodes. Just replace the FullEpMenu function (fixed one shown below) in the init.py file for the plugin (which is in Plex Media Server/Plug-ins/HGTV.bundle/Contents/Code - I'll try and figure out who made it and/or release this to github when I have a sec....

####################################################################################################
# This function produces a list of shows from the HGTV full episodes page
@route(PREFIX + '/fullepmenu')
def FullEpMenu(title):

    oc = ObjectContainer(title2=title)

    for item in HTML.ElementFromURL(FULLEP_URL).xpath('//div[contains(@class, "m-MediaBlock o-Capsule__m-MediaBlock")]'):
        Log("test")
        title = item.xpath('.//div[contains(@class, "m-MediaBlock__m-TextWrap")]//h4/a/span/text()')[0].strip()
        Log("title" + title)

        try: summary = title
        except: summary = None
        thumb = item.xpath('.//div[contains(@class, "m-MediaBlock__m-MediaWrap")]/a/img/@data-src')[0]
        url = item.xpath('.//div[contains(@class, "m-MediaBlock__m-MediaWrap")]/a/@href')[0]

        oc.add(DirectoryObject(
            key = Callback(VideoBrowse, url=url, title=title),
            title = title,
            summary = summary,
            thumb = Resource.ContentsOfURLWithFallback(url=thumb)
        ))

    # sort shows in alphabetical order here
    oc.objects.sort(key=lambda obj: obj.title)

    if len(oc) < 1:
        return ObjectContainer(header='Empty', message='There are no full episode shows to list')
    else:
        return oc

####################################################################################################

Viewing all articles
Browse latest Browse all 5522

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>