Пример #1
0
    def GetThumb(self, thumb=None, h=None, w=None, o=100):
        """ Parse thumb to get the url and send to htpc.proxy.get_image """
        url = self.url('/images/DefaultVideo.png')
        if thumb:
            url = self.url('/image/' + quote(thumb))

        self.logger.debug("Trying to fetch image via " + url)
        return get_image(url, h, w, o, self.auth())
Пример #2
0
    def GetThumb(self, thumb=None, h=None, w=None, o=100):
        """ Parse thumb to get the url and send to htpc.proxy.get_image """
        url = self.url('/images/DefaultVideo.png')
        if thumb:
            url = self.url('/image/' + quote(thumb))

        self.logger.debug("Trying to fetch image via %s", url)
        return get_image(url, h, w, o, self.auth())
Пример #3
0
    def thumb(self, url, h=None, w=None, o=100):
        if url.startswith('rageid'):
            settings = htpc.settings.Settings()
            host = settings.get('newznab_host', '').replace('http://', '').replace('https://', '')
            ssl = 's' if settings.get('newznab_ssl', 0) else ''

            url = 'http' + ssl + '://' + host + '/covers/tv/' + url[6:] + '.jpg'

        return get_image(url, h, w, o)
Пример #4
0
    def thumb(self, url, h=None, w=None, o=100):
        if url.startswith("rageid"):
            settings = htpc.settings
            host = settings.get("newznab_host", "").replace("http://", "").replace("https://", "")
            ssl = "s" if settings.get("newznab_ssl", 0) else ""

            url = "http" + ssl + "://" + host + "/covers/tv/" + url[6:] + ".jpg"

        return get_image(url, h, w, o)
Пример #5
0
    def thumb(self, url, h=None, w=None, o=100):
        if url.startswith('rageid'):
            settings = htpc.settings
            host = settings.get('newznab_host', '').replace('http://', '').replace('https://', '')
            ssl = 's' if settings.get('newznab_ssl', 0) else ''

            url = 'http' + ssl + '://' + host + '/covers/tv/' + url[6:] + '.jpg'

        return get_image(url, h, w, o)
Пример #6
0
 def GetThumb(self, thumb=None, h=None, w=None, o=100):
     """ Parse thumb to get the url and send to htpc.proxy.get_image """
     url = unquote(thumb)
     if not url:
         url = self.url('/images/DefaultVideo.png')
     if url.startswith('special://'):  # Eden
         url = self.url('/vfs/' + quote(url))
     elif url.startswith('image://'):  # Frodo
         url = self.url('/image/' + quote(thumb))
     return get_image(url, h, w, o, self.auth())
Пример #7
0
    def thumb(self, url, h=None, w=None, o=100):
        if url.startswith('rageid'):
            settings = htpc.settings.Settings()
            host = settings.get('newznab_host', '')

            if 'http://' in host:
                url = host + '/covers/tv/' + url[6:] + '.jpg'
            else:
                url = 'http://' + host + '/covers/tv/' + url[6:] + '.jpg'

        return get_image(url, h, w, o)
Пример #8
0
    def GetThumb(self, thumb=None, h=None, w=None, o=100):
        """ Parse thumb to get the url and send to htpc.proxy.get_image """
        #url = self.url('/images/DefaultVideo.png')
        if thumb:
            if o > 100:
                url = "http://%s:%s%s" % (htpc.settings.get('plex_host', 'localhost'), htpc.settings.get('plex_port', '32400'), thumb)
            else:
                # If o < 100 transcode on Plex server to widen format support
                url = "http://%s:%s/photo/:/transcode?height=%s&width=%s&url=%s" % (htpc.settings.get('plex_host', 'localhost'), htpc.settings.get('plex_port', '32400'), h, w, urllib.quote_plus("http://%s:%s%s" % (htpc.settings.get('plex_host', 'localhost'), htpc.settings.get('plex_port', '32400'), thumb)))
                h=None
                w=None
        else:
            url = "/images/DefaultVideo.png"

        self.logger.debug("Trying to fetch image via " + url)
        return get_image(url, h, w, o, headers=self.getHeaders())
Пример #9
0
    def GetThumb(self, thumb=None, h=None, w=None, o=100):
        """ Parse thumb to get the url and send to htpc.proxy.get_image """
        #url = self.url('/images/DefaultVideo.png')
        if thumb:
            if o > 100:
                url = "http://%s:%s%s" % (
                    htpc.settings.get('plex_host', 'localhost'),
                    htpc.settings.get('plex_port', '32400'), thumb)
            else:
                # If o < 100 transcode on Plex server to widen format support
                url = "http://%s:%s/photo/:/transcode?height=%s&width=%s&url=%s" % (
                    htpc.settings.get('plex_host', 'localhost'),
                    htpc.settings.get('plex_port', '32400'), h, w,
                    urllib.quote_plus(
                        "http://%s:%s%s" %
                        (htpc.settings.get('plex_host', 'localhost'),
                         htpc.settings.get('plex_port', '32400'), thumb)))
                h = None
                w = None
        else:
            url = "/images/DefaultVideo.png"

        self.logger.debug("Trying to fetch image via " + url)
        return get_image(url, h, w, o, headers=self.getHeaders())
Пример #10
0
 def GetImage(self, url, h=None, w=None, o=100):
     return get_image(url, h, w, o)
Пример #11
0
 def GetImage(self, url, h=None, w=None, o=None):
     return get_image(url, h, w, o)