fix per warning translatePath kodi 19, altri piccoli ritocchi
This commit is contained in:
@@ -11,13 +11,15 @@ try:
|
||||
except ImportError:
|
||||
import urllib, urlparse, cookielib
|
||||
|
||||
|
||||
import os, time, json
|
||||
from threading import Lock
|
||||
from core.jsontools import to_utf8
|
||||
from platformcode import config, logger
|
||||
from core import scrapertools
|
||||
|
||||
# to surpress InsecureRequestWarning
|
||||
import urllib3
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
# Get the addon version
|
||||
__version = config.get_addon_version()
|
||||
|
||||
|
||||
@@ -7,6 +7,13 @@ import os
|
||||
import sys
|
||||
|
||||
import xbmc
|
||||
|
||||
# on kodi 18 its xbmc.translatePath, on 19 xbmcvfs.translatePath
|
||||
try:
|
||||
import xbmcvfs
|
||||
xbmc.translatePath = xbmcvfs.translatePath
|
||||
except:
|
||||
pass
|
||||
from platformcode import config, logger
|
||||
|
||||
logger.info("init...")
|
||||
|
||||
@@ -24,7 +24,7 @@ else:
|
||||
_urlopen = urllib2.urlopen
|
||||
_Request = urllib2.Request
|
||||
|
||||
def query(name, type='A', server=DOH_SERVER, path="/dns-query", fallback=True,):
|
||||
def query(name, type='A', server=DOH_SERVER, path="/dns-query", fallback=True):
|
||||
"""
|
||||
Returns domain name query results retrieved by using DNS over HTTPS protocol
|
||||
# Reference: https://developers.cloudflare.com/1.1.1.1/dns-over-https/json-format/
|
||||
|
||||
@@ -8,7 +8,8 @@ from platformcode import config, logger
|
||||
def test_video_exists(page_url):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
|
||||
data = httptools.downloadpage(page_url, cookies=False).data
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if 'File you are looking for is not found.' in data:
|
||||
return False, config.get_localized_string(70449) % "Onlystream"
|
||||
|
||||
@@ -17,7 +18,7 @@ def test_video_exists(page_url):
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info("url=" + page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
global data
|
||||
# logger.info(data)
|
||||
video_urls = support.get_jwplayer_mediaurl(data, 'Onlystream')
|
||||
return video_urls
|
||||
|
||||
@@ -8,6 +8,12 @@ import traceback
|
||||
import xbmc
|
||||
import xbmcgui
|
||||
from platformcode import config
|
||||
# on kodi 18 its xbmc.translatePath, on 19 xbmcvfs.translatePath
|
||||
try:
|
||||
import xbmcvfs
|
||||
xbmc.translatePath = xbmcvfs.translatePath
|
||||
except:
|
||||
pass
|
||||
librerias = xbmc.translatePath(os.path.join(config.get_runtime_path(), 'lib'))
|
||||
sys.path.insert(0, librerias)
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
rm tests/home/userdata/addon_data/plugin.video.kod/settings_channels/*.json
|
||||
rm tests/home/userdata/addon_data/plugin.video.kod/settings_servers/*.json
|
||||
rm tests/home/userdata/addon_data/plugin.video.kod/cookies.dat
|
||||
rm tests/home/userdata/addon_data/plugin.video.kod/kod_db.sqlite
|
||||
python -m pip install --upgrade pip
|
||||
pip install sakee
|
||||
pip install html-testRunner
|
||||
|
||||
@@ -242,7 +242,7 @@ class GenericChannelMenuItemTest(unittest.TestCase):
|
||||
if self.ch in chNumRis: # i know how much results should be
|
||||
for content in chNumRis[self.ch]:
|
||||
if content in self.title:
|
||||
risNum = len([i for i in self.itemlist if not i.nextPage]) # not count nextpage
|
||||
risNum = len([i for i in self.itemlist if i.title != typo(config.get_localized_string(30992), 'color kod bold')]) # not count nextpage
|
||||
self.assertEqual(chNumRis[self.ch][content], risNum,
|
||||
'channel ' + self.ch + ' -> ' + self.title + ' returned wrong number of results<br>'
|
||||
+ str(risNum) + ' but should be ' + str(chNumRis[self.ch][content]) + '<br>' +
|
||||
|
||||
Reference in New Issue
Block a user