Пример #1
0
def ExternalPath(itemName):
    if len(Plugin.Prefixes()) == 0: return None
    global __publicResources
    global __mimeTypes
    if itemName is None: return
    ext = itemName[itemName.rfind("."):]
    if __mimeTypes.has_key(ext):
        __exposeResource(itemName, __mimeTypes[ext])
    else:
        __exposeResource(itemName, "application/octet-stream")
    if __publicResources.has_key(itemName):
        return "%s/:/resources/%s" % (Plugin.Prefixes()[0], itemName)
    else:
        return None
Пример #2
0
 def __init__(self,
              url,
              title=None,
              subtitle=None,
              summary=None,
              duration=None,
              thumb=None,
              art=None,
              **kwargs):
     if Plugin.LastPrefix: prefix = Plugin.LastPrefix
     else: prefix = Plugin.Prefixes()[0]
     if isinstance(url, basestring):
         key = "plex://127.0.0.1/video/:/webkit?url=%s&prefix=%s" % (
             String.Quote(url, usePlus=True), prefix)
     else:
         key = url
     XMLObject.__init__(self,
                        key=key,
                        title=title,
                        subtitle=subtitle,
                        summary=summary,
                        duration=duration,
                        thumb=thumb,
                        art=art,
                        **kwargs)
     self.tagName = "Video"
Пример #3
0
 def __init__(self,
              title=None,
              subtitle=None,
              summary=None,
              thumb=None,
              **kwargs):
     DirectoryItem.__init__(self,
                            "%s/:/prefs" % Plugin.Prefixes()[0],
                            title=title,
                            subtitle=subtitle,
                            summary=summary,
                            thumb=thumb,
                            settings=True,
                            **kwargs)
Пример #4
0
  def __init__(self, url, title, summary, duration, thumb):
    """
      Creates a new WebVideoItem with the given URL, title, summary, duration and thumbnail path.
      
      @param url: The URL of the web page containing the video
      @type url: string
      @param title: The title of the video
      @type title: string
      @param summary: A short description of the video
      @type summary: string
      @param duration: The duration of the video (in milliseconds)
      @type duration: string
      @param thumb: The thumbnail path for the video
      @type thumb: string
      @return: DirectoryItem
    """
    prefix = Plugin.Prefixes()[0]
    key = "plex://localhost/video/:/webkit?url=%s&prefix=%s" % (urllib.quote_plus(url), prefix)
    VideoItem.__init__(self, key, title, summary, duration, thumb)

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