예제 #1
0
def Search(item):
    pn_server = PNServer()
    pn_server.Create()
    if item['temp'] :
        item['OShash'] = "000000000000"
        item['SLhash'] = "000000000000"
    else:
        item['OShash'] = OpensubtitlesHash(item)
        item['SLhash'] = calculateSublightHash(item['file_original_path'])
        log(__scriptid__ , "xbmc module OShash: %s, SLhash:%s"%(item['OShash'], item['SLhash']))

    log(__scriptid__ , "Search for [%s] by name" % (os.path.basename(item['file_original_path']),))
    subtitles_list = pn_server.SearchSubtitlesWeb(item)
    return subtitles_list
예제 #2
0
def Search(item):
    pn_server = PNServer()
    pn_server.Create()
    if item['temp']:
        item['OShash'] = "000000000000"
        item['SLhash'] = "000000000000"
    else:
        item['OShash'] = OpensubtitlesHash(item)
        item['SLhash'] = calculateSublightHash(item['file_original_path'])
        log(
            __scriptid__, "xbmc module OShash: %s, SLhash:%s" %
            (item['OShash'], item['SLhash']))

    log(
        __scriptid__, "Search for [%s] by name" %
        (os.path.basename(item['file_original_path']), ))
    subtitles_list = pn_server.SearchSubtitlesWeb(item)
    return subtitles_list
예제 #3
0
def Search( item ):

  pn_server = PNServer()
  pn_server.Create()  
  subtitles_list = []
  if item['temp'] : 
    item['OShash'] = "000000000000"
    item['SLhash'] = "000000000000"
  else:
    item['OShash'] = OpensubtitlesHash(item)
    item['SLhash'] = calculateSublightHash(item['file_original_path'])
    log( __scriptid__ ,"xbmc module OShash")

  log( __scriptid__ ,"Search for [%s] by name" % (os.path.basename( item['file_original_path'] ),))
  subtitles_list = pn_server.SearchSubtitlesWeb(item)
  if subtitles_list:
    for it in subtitles_list:
      listitem = xbmcgui.ListItem(label=it["language_name"],
                                  label2=it["filename"],
                                  iconImage=it["rating"],
                                  thumbnailImage=it["language_flag"]
                                  )

      listitem.setProperty( "sync", ("false", "true")[it["sync"]] )
      listitem.setProperty( "hearing_imp", ("false", "true")[it["hearing_imp"]] )
      
      url = "plugin://%s/?action=download&link=%s&filename=%s&movie_id=%s&season=%s&episode=%s&hash=%s&match=%s" %(__scriptid__,
                                                                                                                  it["link"],
                                                                                                                  it["filename"],
                                                                                                                  it["movie_id"],
                                                                                                                  it["season"],
                                                                                                                  it["episode"],
                                                                                                                  item['OShash'],
                                                                                                                  it["sync"]
                                                                                                                  )
      
      xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False)
예제 #4
0
def Search(item):

    pn_server = PNServer()
    pn_server.Create()
    subtitles_list = []
    if item['temp']:
        item['OShash'] = "000000000000"
        item['SLhash'] = "000000000000"
    else:
        item['OShash'] = OpensubtitlesHash(item)
        item['SLhash'] = calculateSublightHash(item['file_original_path'])
        log(__scriptid__, "xbmc module OShash")

    log(
        __scriptid__, "Search for [%s] by name" %
        (os.path.basename(item['file_original_path']), ))
    subtitles_list = pn_server.SearchSubtitlesWeb(item)
    if subtitles_list:
        for it in subtitles_list:
            listitem = xbmcgui.ListItem(label=it["language_name"],
                                        label2=it["filename"])
            listitem.setArt({
                "icon": it["rating"],
                "thumb": it["language_flag"]
            })
            listitem.setProperty("sync", ("false", "true")[it["sync"]])
            listitem.setProperty("hearing_imp",
                                 ("false", "true")[it["hearing_imp"]])

            url = "plugin://%s/?action=download&link=%s&filename=%s&movie_id=%s&season=%s&episode=%s&hash=%s&match=%s" % (
                __scriptid__, it["link"], it["filename"], it["movie_id"],
                it["season"], it["episode"], item['OShash'], it["sync"])

            xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                        url=url,
                                        listitem=listitem,
                                        isFolder=False)