def update_last(): print "----- update start -----" L=get_list() i=L[-1] #for i in L: if True: name = i[0].decode('utf-8') url = i[1] if len(i)>2: f = i[2] else: f=[] new_ep_lst = tthp.list(url) try:old_ep_lst = file_list(name) except:old_ep_lst = [] for j in new_ep_lst: epd = j.name epd = epd.replace('\\'," ")+".strm" epd_f="" for k in f: opid=k[0] if opid=="t":epd_f+=k[1] else:epd_f+=epd[k[0]:k[1]+1] epd_f+=".strm" if f==[]:epd_f=epd ind = j.index if epd not in old_ep_lst: save_strm(name, epd_f, url, ind) #print old_ep_lst print "----- update end -----"
def update(): print "----- Torrent Checker update start -----" L=get_list() for i in L: name = i[0].decode('utf-8') url = i[1] url2 = urllib.unquote_plus(i[1]) if url2[:4]=='plug': xbmc.executebuiltin('RunPlugin("'+url2+'")') time.sleep(10) else: if len(i)>2: f = i[2] else: f=[] try:new_ep_lst = tthp.list(url) except:new_ep_lst =[] try:old_ep_lst = file_list(name) except:old_ep_lst = [] for j in new_ep_lst: epd = j.name epd = epd.replace('\\'," ")+".strm" epd_f="" for k in f: opid=k[0] if opid=="t":epd_f+=k[1] else:epd_f+=epd[k[0]:k[1]+1] epd_f+=".strm" if f==[]:epd_f=epd ind = j.index if epd not in old_ep_lst: save_strm(name, epd_f, url, ind) #print old_ep_lst at=time.strftime('Обновлено: %d.%m.%Y - %H:%M') __settings__.setSetting("AT", at) xbmc.executebuiltin('UpdateLibrary("video", "", "false")') print "----- Torrent Checker update end -----"
def save_episodes_r(name, url, ind): try:updatetc.rem(name) except: pass print "-=-=-=-= save_episodes =-=-=-=-=-" #print url f=updatetc.get_filtr(int(ind)) L=tthp.list(url)#updatetc.file_list(name) add_item ('[B][ - ] Удалить правила переименования[/B] ', 'rem_filtr', url, str(ind)) add_item ('[B][+] Добавить правило переименования: '+str(len(f))+'[/B]: ', 'add_filtr', L[0].name.replace('\\'," "), str(ind)) add_item ('[B][ СОХРАНИТЬ ][/B]', 'save_episodes2', L[0].name.replace('\\'," ").replace('/'," "), str(ind)) for i in L: epd_name=i.name#.replace('\\'," ").replace('/'," ") for b in ['\\','/','*',':','|','"','>','<','?']: epd_name=epd_name.replace(b,".") epd_name_f="" for j in f: opid=j[0] if opid=="t":epd_name_f+=j[1] else:epd_name_f+=epd_name[j[0]:j[1]+1] epd_name_f+=".strm" if f==[]:epd_name_f=epd_name+".strm" add_item (epd_name+chr(10)+epd_name_f, 'none', url, str(ind)) xbmcplugin.endOfDirectory(handle)
def update_last(): print "----- update start -----" L = get_list() i = L[-1] #for i in L: if True: name = i[0].decode('utf-8') url = i[1] if len(i) > 2: f = i[2] else: f = [] new_ep_lst = tthp.list(url) try: old_ep_lst = file_list(name) except: old_ep_lst = [] for j in new_ep_lst: epd = j.name epd = epd.replace('\\', " ") + ".strm" epd_f = "" for k in f: opid = k[0] if opid == "t": epd_f += k[1] else: epd_f += epd[k[0]:k[1] + 1] epd_f += ".strm" if f == []: epd_f = epd ind = j.index if epd not in old_ep_lst: save_strm(name, epd_f, url, ind) #print old_ep_lst print "----- update end -----"
def t2http_list(url): L=tthp.list(url) if len (L)<2: tthp.play(url, handle, 0, __settings__.getSetting("DownloadDirectory")) else: for i in L: #print i listitem = xbmcgui.ListItem(i.name) purl = sys.argv[0] + '?mode=t2http_play'\ + '&url=' + urllib.quote_plus(url)\ + '&num=' + urllib.quote_plus(str(i.index)) xbmcplugin.addDirectoryItem(handle, purl, listitem, False) xbmcplugin.setPluginCategory(handle, PLUGIN_NAME) xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_LABEL) xbmcplugin.endOfDirectory(handle)
def save_episodes_ext(name, url, L2, s, e, nf, info={}): #name=name.decode('utf-8') L=tthp.list(url) n=0 if len (L)>0 and nf==1: if info=={}: updatetc.save_tvshow_nfo(name, info={'title':name}) else: updatetc.save_tvshow_nfo(name, info) for i in L: ind = i.index epd=L2[n] updatetc.save_strm(name, epd, url, ind) if nf==1: #if info=={}: info={'title':epd} if isinstance(epd, unicode): epd=epd.encode('utf-8') updatetc.save_nfo(name, epd.replace(".strm","") ,s[n] , e[n], info) n+=1 showMessage("Сохранено:", str(len(L))+' файлов', 2000) xbmc.executebuiltin('UpdateLibrary("video", "", "false")')
def update(): print "----- Torrent Checker update start -----" L = get_list() for i in L: name = i[0].decode('utf-8') url = i[1] url2 = urllib.unquote_plus(i[1]) if url2[:4] == 'plug': xbmc.executebuiltin('RunPlugin("' + url2 + '")') time.sleep(10) else: if len(i) > 2: f = i[2] else: f = [] try: new_ep_lst = tthp.list(url) except: new_ep_lst = [] try: old_ep_lst = file_list(name) except: old_ep_lst = [] for j in new_ep_lst: epd = j.name epd = epd.replace('\\', " ") + ".strm" epd_f = "" for k in f: opid = k[0] if opid == "t": epd_f += k[1] else: epd_f += epd[k[0]:k[1] + 1] epd_f += ".strm" if f == []: epd_f = epd ind = j.index if epd not in old_ep_lst: save_strm(name, epd_f, url, ind) #print old_ep_lst at = time.strftime('Обновлено: %d.%m.%Y - %H:%M') __settings__.setSetting("AT", at) xbmc.executebuiltin('UpdateLibrary("video", "", "false")') print "----- Torrent Checker update end -----"
def t2h_list(url): L=tthp.list(url) return L
xbmc.executebuiltin("Container.Refresh") if mode=="add_comment": updatetc.add_comment(int(ind)) if mode=="save_episodes": save_episodes(name, url) if mode=="save_episodes2": save_episodes2(name, int(ind)) if mode=="save_episodes_r": save_episodes_r(name, url, int(ind)) if mode=="save_episodes_ext": info=eval(__settings__.getSetting("info")) save_episodes_ext(name, url, L, ss, ee, nf, info) if mode=="save_episodes_api": import RenameBox L=tthp.list(url) L1=[] L2=[] for i in L: nm=i.name for b in ['\\','/','*',':','|','"','>','<','?']: nm=nm.replace(b,".") L1.append(nm) L2.append(nm+".strm") L3=[['t',name],[0,0],[0,0],L1,L2,0,url] __settings__.setSetting(id="RenameBox", value=repr(L3)) __settings__.setSetting(id="info", value=repr(info)) RenameBox.run("RenameBox")
def t2h_list(url): L = tthp.list(url) return L