def DL(url): html = u'' getWeb = WebUtils.CachedWebRequest(path.join(__datadir__, 'cookies.lwp'), __temp__) html = getWeb.getSource(url, form_data=None, referer=__BASEURL__, xml=False, mobile=False).encode('latin', errors='ignore') return html
import requests from unidecode import unidecode import webutil as WebUtils from xbmcswift2 import Plugin, xbmc, ListItem, download_page, clean_dict, SortMethod plugin = Plugin() ssl._create_default_https_context = ssl._create_unverified_context __BASEURL__ = u'https://watchseries-online.pl' __addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path')) __datadir__ = xbmc.translatePath('special://profile/addon_data/{0}/'.format(plugin.id)) __cookie__ = path.join(__datadir__, 'cookies.lwp') __temp__ = path.join(__datadir__, 'temp/') __resdir__ = path.join(__addondir__, 'resources') __imgsearch__ = path.join(__resdir__, 'search.png') __savedjson__ = path.join(xbmc.translatePath(plugin.addon.getAddonInfo('profile')), 'savedshows.json') getWeb = WebUtils.CachedWebRequest(path.join(__datadir__, 'cookies.lwp'), __temp__) #getWeb = WebUtils.BaseRequest(path.join(__datadir__, 'cookies.lwp')) def loadsaved(): sitems = [] litems = [] items = [] savedpath = '' try: savedpath = path.join(__datadir__, "saved.json") if path.exists(savedpath): fpin = file(savedpath) rawjson = fpin.read() sitems = json.loads(rawjson) fpin.close()