Fix doodstream e opzioni di KoD (kodi 20)

This commit is contained in:
marco
2023-01-23 20:45:23 +01:00
parent 3c337f1da2
commit 1ce00b452f
4 changed files with 20 additions and 12 deletions

View File

@@ -1,13 +1,19 @@
# functions that on kodi 19 moved to xbmcvfs
import xbmc
try:
import xbmcvfs
xbmc.translatePath = xbmcvfs.translatePath
xbmc.validatePath = xbmcvfs.validatePath
xbmc.makeLegalFilename = xbmcvfs.makeLegalFilename
except:
pass
from platformcode import config, logger
import xbmc, sys, xbmcgui, os
import sys, xbmc, xbmcgui, os
librerias = xbmc.translatePath(os.path.join(config.get_runtime_path(), 'lib'))
sys.path.insert(0, librerias)
from core import jsontools, support
from core.item import Item
from core import jsontools
addon_id = config.get_addon_core().getAddonInfo('id')
LOCAL_FILE = os.path.join(config.get_runtime_path(), "platformcode/contextmenu/contextmenu.json")

View File

@@ -7,7 +7,7 @@ sys.path.insert(0, librerias)
from core.item import Item
from lib.sambatools import libsmb as samba
from core import scrapertools, support
from core import scrapertools
path = ''
mediatype = ''
@@ -70,10 +70,10 @@ def execute_sql(sql):
# alternative method to locate the database
if not file_db or not os.path.exists(file_db):
file_db = ""
for f in os.path.listdir(xbmc.translatePath("special://userdata/Database")):
for f in os.listdir(xbmc.translatePath("special://userdata/Database")):
path_f = os.path.join(xbmc.translatePath("special://userdata/Database"), f)
if os.path.pathoos.pathols.isfile(path_f) and f.lower().startswith('myvideos') and f.lower().endswith('.db'):
if os.path.isfile(path_f) and f.lower().startswith('myvideos') and f.lower().endswith('.db'):
file_db = path_f
break

View File

@@ -5,7 +5,7 @@
"patterns": [
{
"pattern": "dood(?:stream)?.[^/]+/+(?:e|d)/([a-z0-9]+)",
"url": "https://dood.to/e/\\1"
"url": "https://dood.yt/e/\\1"
}
]
},

View File

@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
import time, string, random
from core import httptools, support
from core import httptools, support, servertools
from platformcode import logger, config
def test_video_exists(page_url):
global data
logger.debug('page url=', page_url)
response = httptools.downloadpage(page_url)
support.dbg()
if response.code == 404 or 'dsplayer' not in response.data:
return False, config.get_localized_string(70449) % 'DooD Stream'
else:
@@ -22,8 +22,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
logger.debug("URL", page_url)
video_urls = []
host = 'https://dood.to'
host = 'https://' + servertools.get_server_host('doodstream')[0]
headers = {'User-Agent': httptools.get_user_agent(), 'Referer': page_url}
support.dbg()
match = support.match(data, patron=r'''dsplayer\.hotkeys[^']+'([^']+).+?function\s*makePlay.+?return[^?]+([^"]+)''').match
if match:
@@ -34,6 +35,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
return video_urls
def randomize(data):
t = string.ascii_letters + string.digits
return data + ''.join([random.choice(t) for _ in range(10)])