예제 #1
0
def stft(text, info={}):
    try:
        import krasfs
        tft = krasfs.Tracker()
    except:
        pass

    RL = tft.Search(text, 4)
    if len(RL) > 0:
        Title = "[COLOR F050F050]" + "[------- «KrasFS.ru»  " + text + " ---------]" + "[/COLOR]"
        row_url = Title
        listitem = xbmcgui.ListItem(Title)
        listitem.setInfo(type="Video", infoLabels={"Title": Title})
        purl = sys.argv[0] + '?mode=Search'\
         + '&url=' + urllib.quote_plus(row_url)\
         + '&title=' + urllib.quote_plus(Title)\
         + '&text=' + urllib.quote_plus('0')
        xbmcplugin.addDirectoryItem(handle, purl, listitem, True)

    for itm in RL:
        Title = "|" + itm[0] + "|" + itm[1] + "|  " + itm[2]
        row_url = itm[3]
        cover = ""
        dict = {}
        listitem = xbmcgui.ListItem(Title,
                                    thumbnailImage=cover,
                                    iconImage=cover)
        try:
            listitem.setInfo(type="Video", infoLabels=dict)
        except:
            pass
        listitem.setProperty('fanart_image', cover)
        purl = sys.argv[0] + '?mode=OpenTorrent'\
         + '&url=' + urllib.quote_plus(row_url)\
         + '&title=' + urllib.quote_plus(Title)\
         + '&info=' + urllib.quote_plus(repr(info))
        xbmcplugin.addDirectoryItem(handle, purl, listitem, True, len(RL))
    return len(RL)
예제 #2
0
import httplib
import urllib
import urllib2
import re
import sys
import os
import Cookie

import string, xbmc, xbmcgui, xbmcplugin, os, urllib, cookielib, xbmcaddon, time, codecs

from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
import socket
socket.setdefaulttimeout(50)
try:
    import krasfs
    tft = krasfs.Tracker()
except:
    pass


def stft(text):
    RL = tft.Search(text, 4)
    if len(RL) > 0:
        Title = "[COLOR F050F050]" + "[-------  Мультимедийный портал «KrasFS.ru»  ---------]" + "[/COLOR]"
        row_url = Title
        listitem = xbmcgui.ListItem(Title)
        listitem.setInfo(type="Video", infoLabels={"Title": Title})
        purl = sys.argv[0] + '?mode=Search'\
         + '&url=' + urllib.quote_plus(row_url)\
         + '&title=' + urllib.quote_plus(Title)\
         + '&text=' + urllib.quote_plus('0')