示例#1
0
import xbmcgui
import xbmcaddon
import xbmcvfs
import cloudflare
from jsunpack import unpack
import resolveurl
import xbmcvfs
from functools import wraps

xxx_plugins_path = 'special://home/addons/script.module.resolveurl.xxx/resources/plugins/'
if xbmcvfs.exists(xxx_plugins_path):
    resolveurl.add_plugin_dirs(xbmc.translatePath(xxx_plugins_path))

from url_dispatcher import URL_Dispatcher

url_dispatcher = URL_Dispatcher()

USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0'  #resolveurl.lib.net.get_ua()

headers = {
    'User-Agent': USER_AGENT,
    'Accept':
    'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
    'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
    'Accept-Encoding': 'gzip',
    'Accept-Language': 'en-US,en;q=0.8',
    'Connection': 'keep-alive'
}
openloadhdr = headers

addon_handle = int(sys.argv[1])
示例#2
0
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

import kodi
from url_dispatcher import URL_Dispatcher


def __enum(**enums):
    return type('Enum', (), enums)


DISPATCHER = URL_Dispatcher()

MODES = __enum(MAIN='main', PLAY='play', OPEN='open')

DIRECTORIES = __enum(
    DATA=kodi.translate_path('special://profile/addon_data/%s/' %
                             kodi.get_id()))

ICONS = __enum(ADDON=kodi.translate_path(
    'special://home/addons/{0!s}/icon.png'.format(kodi.get_id())))