# -*- coding: UTF-8 -*- import sys,re, ast import six from six.moves import urllib_parse import requests from requests.compat import urlparse import xbmcgui import xbmcplugin import xbmcaddon import xbmc, xbmcvfs if six.PY3: basestring = str unicode = str xrange = range from resources.lib.cmf3 import parseDOM else: from resources.lib.cmf2 import parseDOM import resolveurl base_url = sys.argv[0] addon_handle = int(sys.argv[1]) params = dict(urllib_parse.parse_qsl(sys.argv[2][1:])) addon = xbmcaddon.Addon(id='plugin.video.uiiumovies') PATH = addon.getAddonInfo('path') if six.PY2: DATAPATH = xbmc.translatePath(addon.getAddonInfo('profile')).decode('utf-8') else: DATAPATH = xbmcvfs.translatePath(addon.getAddonInfo('profile')) RESOURCES = PATH+'/resources/' FANART=RESOURCES+'../fanart.jpg' ikona =RESOURCES+'../icon.png' prawo =RESOURCES+'right.png' exlink = params.get('url', None) nazwa= params.get('title', None) rys = params.get('image', None) try: inflabel = ast.literal_eval(params.get('ilabel', None)) except: inflabel = params.get('ilabel', None) page = params.get('page',[1])[0] MAIN_URL ='https://uiiumovies.net/' UA= 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0' TIMEOUT=15 headers = {'User-Agent': UA,} sess = requests.Session() fsortv = addon.getSetting('fsortV') fsortn = addon.getSetting('fsortN') if fsortv else 'default' findexv = addon.getSetting('findexV') findexn = addon.getSetting('findexN') if findexv else 'default' fkatv = addon.getSetting('fkatV') fkatn = addon.getSetting('fkatN') if fkatv else 'all' frokv = addon.getSetting('frokV') frokn = addon.getSetting('frokN') if frokv else 'all' fkrajv = addon.getSetting('fkrajV') fkrajn = addon.getSetting('fkrajN') if fkrajv else 'all' fqualv = addon.getSetting('fqualV') fqualn = addon.getSetting('fqualN') if fqualv else 'all' fdata = addon.getSetting('fdata') def build_url(query): return base_url + '?' + urllib_parse.urlencode(query) def add_item(url, name, image, mode, itemcount=1, page=1,fanart=FANART, infoLabels=False,contextmenu=None,IsPlayable=False, folder=False): if six.PY3: list_item = xbmcgui.ListItem(name) else: list_item = xbmcgui.ListItem(name, iconImage=image, thumbnailImage=image) if IsPlayable: list_item.setProperty("IsPlayable", 'True') if not infoLabels: infoLabels={'title': name} list_item.setInfo(type="video", infoLabels=infoLabels) list_item.setArt({'thumb': image,'icon': image, 'poster': image, 'banner': image, 'fanart': fanart}) if contextmenu: out=contextmenu list_item.addContextMenuItems(out, replaceItems=True) else: out = [] out.append(('Informacja', 'Action(Info)'),) list_item.addContextMenuItems(out, replaceItems=False) xbmcplugin.addDirectoryItem( handle=addon_handle, url = build_url({'mode': mode, 'url' : url, 'page' : page, 'title':name,'image':image, 'ilabel':infoLabels}), listitem=list_item, isFolder=folder) xbmcplugin.addSortMethod(addon_handle, sortMethod=xbmcplugin.SORT_METHOD_NONE, label2Mask = "%R, %Y, %P") def home(): Pin() def Pin(cv=False): passw = addon.getSetting("password") if passw: if cv: result = xbmcgui.Dialog().input('Parental control, enter password:', str(passw), type=xbmcgui.INPUT_PASSWORD, option=xbmcgui.PASSWORD_VERIFY); if result == passw: add_item('', '[COLOR pink][B]Enter[/B][/COLOR]', ikona, "enter", folder=True) else: xbmcgui.Dialog().notification('[COLOR red][B]Error[/B][/COLOR]', 'Incorrect password', xbmcgui.NOTIFICATION_INFO, 5000) add_item('', '[COLOR pink][B]Enter password[/B][/COLOR]', ikona, "pin", folder=True) else: add_item('', '[COLOR pink][B]Enter password[/B][/COLOR]', ikona, "pin", folder=True) else: add_item('', '[COLOR pink][B]Setup Parental password[/B][/COLOR]', ikona, "setpin", folder=False) if cv: xbmcplugin.endOfDirectory(addon_handle) def SetPin(): query = xbmcgui.Dialog().input('Password', type=xbmcgui.INPUT_PASSWORD) if query: addon.setSetting("password",str(query)) else: xbmcgui.Dialog().notification('[COLOR red][B]Error[/B][/COLOR]', 'No password entered', xbmcgui.NOTIFICATION_INFO, 5000) xbmc.executebuiltin('Container.Refresh') def Enter(): add_item('f', '[B]uiiumovies[/B]', ikona, "listsubmenu",fanart=FANART, folder=True) add_item('f', '[B]xxxmoviestream[/B]', ikona, "listmenuxxxmoviestream",fanart=FANART, folder=True) xbmcplugin.endOfDirectory(addon_handle) def ListMenu2(): add_item('https://xxxmoviestream.xyz/genres/porn-movies/page/1/', '[B]Movies[/B]', ikona, "listmovies",fanart=FANART, folder=True) add_item('https://xxxmoviestream.xyz/trending/page/1/', '[B]Trending movies[/B]', ikona, "listmovies",fanart=FANART, folder=True) add_item('genres', '[B]Genres[/B]', ikona, "listcategoryxxx",fanart=FANART, folder=True) add_item('studios', '[B]Studios[/B]', ikona, "listcategoryxxx",fanart=FANART, folder=True) add_item('f', '[B][COLOR lightgreen]Search[/COLOR][/B]', ikona, "search2",fanart=FANART, folder=True) xbmcplugin.endOfDirectory(addon_handle) def ListMovies(url,pg): urlk = url if 'query:' in url: query = url.split(':')[-1] urlk = 'https://xxxmoviestream.xyz/search/'+query+'/page/1/' #url.replace('/?s=&','/?s=%s&'%(str(query))) urlk = re.sub('\/page\/\d+\/','/page/%s/'%int(pg), urlk) html=getUrlReqOk(urlk) if '"fas fa-chevron-right' in html: npage = True if 'query:' in url: links = parseDOM(html,'div', attrs={'class': "result\-item"}) for link in links: href = parseDOM(link,'a', ret="href")[0] h3 = parseDOM(link,'div', attrs={'class': "title"})[0] #