示例#1
0
 def setUp(self):
     name = 'Hello Kodi'
     plugin_id = 'plugin.video.hellokodi'
     path = os.path.join(os.path.dirname(__file__), 'data', 'plugin',
                         'plugin.py')
     with preserve_cwd(os.path.dirname(path)):
         self.plugin = Plugin(name, plugin_id, path)
示例#2
0
def new_plugin():
    name = 'Hello Kodi'
    plugin_id = 'plugin.video.hellokodi'
    path = os.path.join(os.path.dirname(__file__), 'data', 'plugin',
                        'plugin.py')
    with preserve_cwd(os.path.dirname(path)):
        return Plugin(name, plugin_id, path)
示例#3
0
 def setUp(self):
     name = 'Hello Kodi'
     plugin_id = 'plugin.video.hellokodi'
     path = os.path.join(
         os.path.dirname(__file__), 'data', 'plugin', 'plugin.py')
     with preserve_cwd(os.path.dirname(path)):
         self.plugin = Plugin(name, plugin_id, path)
示例#4
0
def create_plugin_module():
    module = Module('namespace')
    sys.argv = ['./plugin.py']
    path = os.path.join(os.path.dirname(__file__), 'data', 'plugin',
                        'plugin.py')
    with preserve_cwd(os.path.dirname(path)):
        plugin = Plugin('Hello Kodi', 'plugin.video.helloxbmc', path)
    return plugin, module
示例#5
0
 def test_init_cli_mode_no_strings_po(self):
     name = 'Hello Kodi'
     plugin_id = 'plugin.video.hellokodi'
     path = os.path.join(os.path.dirname(__file__), 'data',
                         'plugin_no_strings_po', 'plugin.py')
     with preserve_cwd(os.path.dirname(path)):
         plugin = Plugin(name, plugin_id, path)
     # Test loading from strings.xml
     self.assertEqual(plugin.addon.getLocalizedString(30100),
                      'View all results')
示例#6
0
    def test_init_cli_mode_default_args(self):
        with preserve_cwd(
                os.path.join(os.path.dirname(__file__), 'data', 'plugin')):
            plugin = Plugin()

        self.assertEqual('plugin.video.academicearth', plugin.id)
        self.assertEqual(plugin.name, 'Academic Earth')
        self.assertTrue(os.path.isdir(plugin.storage_path))
        self.assertEqual(plugin.added_items, [])
        self.assertRaises(Exception, getattr, plugin, 'handle')
        self.assertRaises(Exception, getattr, plugin, 'request')
示例#7
0
    def test_info_types(self):
        name = 'Hello Kodi'
        path = __file__

        # can't parse from id, default to video
        with preserve_cli_mode(cli_mode=False):
            with preserve_cwd(
                    os.path.join(os.path.dirname(path), 'data', 'plugin')):
                plugin = Plugin(name, 'script.module.test', path)
                self.assertEqual(plugin.info_type, 'video')

                # parse from ID
                plugin = Plugin(name, 'plugin.audio.test')
                self.assertEqual(plugin.info_type, 'music')

                plugin = Plugin(name, 'plugin.video.test')
                self.assertEqual(plugin.info_type, 'video')

                plugin = Plugin(name, 'plugin.image.test')
                self.assertEqual(plugin.info_type, 'pictures')

                # info_type param should override value parsed from id
                plugin = Plugin(name, 'plugin.video.test', info_type='music')
                self.assertEqual(plugin.info_type, 'music')
示例#8
0
    def test_init_not_cli_mode(self):
        name = 'Hello Kodi'
        plugin_id = 'plugin.video.hellokodi'
        path = os.path.join(os.path.dirname(__file__), 'data', 'plugin',
                            'plugin.py')
        with preserve_cwd(os.path.dirname(path)):
            with preserve_cli_mode(cli_mode=False):
                plugin = Plugin(name, plugin_id, path)

        self.assertEqual(plugin_id, plugin.id)
        self.assertEqual(plugin.name, name)
        self.assertTrue(os.path.isdir(plugin.storage_path))
        self.assertEqual(plugin.added_items, [])
        self.assertRaises(Exception, getattr, plugin, 'handle')
        self.assertRaises(Exception, getattr, plugin, 'request')
示例#9
0
class TestParseRequest(TestCase):
    def setUp(self):
        name = 'Hello Kodi'
        plugin_id = 'plugin.video.hellokodi'
        path = os.path.join(os.path.dirname(__file__), 'data', 'plugin',
                            'plugin.py')
        with preserve_cwd(os.path.dirname(path)):
            self.plugin = Plugin(name, plugin_id, path)

    def test_parse_request(self):
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = ['plugin://plugin.video.hellokodi', '0', '?']
            self.plugin._parse_request()
            MockRequest.assert_called_with('plugin://plugin.video.hellokodi?',
                                           '0')

    def test_parse_request_no_qs(self):
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = ['plugin://plugin.video.hellokodi', '0']
            self.plugin._parse_request()
            MockRequest.assert_called_with('plugin://plugin.video.hellokodi',
                                           '0')

    def test_parse_request_path_in_arg0(self):
        # Older versions of xbmc sometimes pass path in arg0
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = [
                'plugin://plugin.video.hellokodi/videos/', '0', '?foo=bar'
            ]
            self.plugin._parse_request()
            MockRequest.assert_called_with(
                'plugin://plugin.video.hellokodi/videos/?foo=bar', '0')

    def test_parse_request_path_in_arg2(self):
        # Older versions of xbmc sometimes pass path in arg2
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = [
                'plugin://plugin.video.hellokodi', '0', '/videos/?foo=bar'
            ]
            self.plugin._parse_request()
            MockRequest.assert_called_with(
                'plugin://plugin.video.hellokodi/videos/?foo=bar', '0')
示例#10
0
class TestParseRequest(TestCase):
    def setUp(self):
        name = 'Hello Kodi'
        plugin_id = 'plugin.video.hellokodi'
        path = os.path.join(
            os.path.dirname(__file__), 'data', 'plugin', 'plugin.py')
        with preserve_cwd(os.path.dirname(path)):
            self.plugin = Plugin(name, plugin_id, path)

    def test_parse_request(self):
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = ['plugin://plugin.video.hellokodi', '0', '?']
            self.plugin._parse_request()
            MockRequest.assert_called_with(
                'plugin://plugin.video.hellokodi?', '0')

    def test_parse_request_no_qs(self):
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = ['plugin://plugin.video.hellokodi', '0']
            self.plugin._parse_request()
            MockRequest.assert_called_with(
                'plugin://plugin.video.hellokodi', '0')

    def test_parse_request_path_in_arg0(self):
        # Older versions of xbmc sometimes pass path in arg0
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = [
                'plugin://plugin.video.hellokodi/videos/', '0', '?foo=bar']
            self.plugin._parse_request()
            MockRequest.assert_called_with(
                'plugin://plugin.video.hellokodi/videos/?foo=bar', '0')

    def test_parse_request_path_in_arg2(self):
        # Older versions of xbmc sometimes pass path in arg2
        with patch('kodiswift.plugin.Request') as MockRequest:
            sys.argv = [
                'plugin://plugin.video.hellokodi', '0', '/videos/?foo=bar']
            self.plugin._parse_request()
            MockRequest.assert_called_with(
                'plugin://plugin.video.hellokodi/videos/?foo=bar', '0')
示例#11
0
def index():
    try:
        youtube_icon = Plugin(
            addon_id="plugin.video.youtube").addon.getAddonInfo('icon')
    except:
        youtube_icon = None

    items = [{
        'label': plugin.get_string(30003),
        'thumbnail': PODCAST_THUMB,
        'path': plugin.url_for('podcasts')
    }, {
        'label': plugin.get_string(30004),
        'thumbnail': "http://ichef.bbci.co.uk/images/ic/512x288/p01lysw6.jpg",
        'path': plugin.url_for('clips', page='1')
    }, {
        'label': plugin.get_string(30005),
        'thumbnail': youtube_icon,
        'path': plugin.url_for('show_youtube_list', playlist='latest')
    }, {
        'label': plugin.get_string(30006),
        'thumbnail': youtube_icon,
        'path': plugin.url_for('show_youtube_list', playlist='popular')
    }, {
        'label': plugin.get_string(30007),
        'thumbnail': youtube_icon,
        'path': plugin.url_for('youtube_playlists')
    }, {
        'label': plugin.get_string(30008),
        'thumbnail': youtube_icon,
        'path': plugin.url_for('youtube_search')
    }]

    if has_movie_library():
        items.append({
            'label': plugin.get_string(30009),
            'thumbnail': youtube_icon,
            'path': plugin.url_for('youtube_search_library')
        })

    return items
示例#12
0
    def test_init_cli_mode(self):
        name = 'Hello Kodi'
        plugin_id = 'plugin.video.hellokodi'
        path = os.path.join(os.path.dirname(__file__), 'data', 'plugin',
                            'plugin.py')
        with preserve_cwd(os.path.dirname(path)):
            plugin = Plugin(name, plugin_id, path)

        self.assertEqual(plugin_id, plugin.id)
        self.assertEqual(plugin.name, name)
        self.assertEqual(plugin.info_type, 'video')
        self.assertTrue(os.path.isdir(plugin.storage_path))
        self.assertEqual(plugin.added_items, [])
        self.assertRaises(Exception, getattr, plugin, 'handle')
        self.assertRaises(Exception, getattr, plugin, 'request')
        # Test loading from strings.po
        self.assertEqual(plugin.addon.getLocalizedString(30100),
                         'View all results')

        addon_path = kodiswift.xbmc.translatePath(
            plugin.addon.getAddonInfo('path'))
        if not os.path.exists(addon_path):
            os.makedirs(addon_path)
示例#13
0
from urllib import quote_plus
import ssl
import requests
import webutil as WebUtils
from kodiswift import Plugin, xbmc, ListItem

urlresolver = None
try:
    import resolveurl as urlresolver
except:
    try:
        import urlresolver as urlresolver
    except:
        urlresolver = None

plugin = Plugin()
ssl._create_default_https_context = ssl._create_unverified_context
__BASEURL__ = 'https://watchseries-online.be'
__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__)
示例#14
0
# -*- coding: utf-8 -*-
# https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-web-api-v7-reference
from kodiswift import Plugin, xbmc
from urllib import quote_plus as Quote, unquote_plus as Unquote
import webutil
import sys, os, os.path as path
import json
plugin = Plugin()
APIKEY = plugin.get_setting('apikey')
tplWho = '( jovenes OR chavalo OR chavo OR amigo OR hombre OR hermano OR novinho OR chico OR chavalito )'
tplWhat = '( mecos OR masturbo OR masturbandose OR batendo OR paja OR follando OR cogiendo OR cojiendo OR sobarse OR punheta OR verga OR lefa )'
tplWhere = '( flagra OR flagrou OR trabajo OR publico OR biblioteca OR aula OR "en clase" OR escuela OR omnibus OR autobus OR viajandor )'
tplWank = '( wank OR wanking OR wanked OR stroke OR stroking OR jerk OR jack OR m********e OR masturbating OR cumming OR cum OR jackoff OR jerkoff OR handjob )'
searchq = tplWhere + ' AND ' + tplWhat + ' ' + tplWho
cpath = path.join(xbmc.translatePath('special://userdata'), 'cookies.lwp')
dl = webutil.DemystifiedWebRequest(cookiePath=cpath)
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = os.path.join(__addondir__, 'resources')
__imgdir__ = os.path.join(__resdir__, 'images')
__imgsearch__ = os.path.join(__imgdir__, 'search.png')
__imgnext__ = os.path.join(__imgdir__, 'next.png')
__imgback__ = os.path.join(__imgdir__, 'back.png')
__imgtumblr__ = os.path.join(__imgdir__, 'tumblr.png')


@plugin.route('/')
def index():
    itemnew = {
        'label': 'New Bing Video Search!',
        'icon': __imgsearch__,
        'thumbnail': __imgsearch__,
示例#15
0
import os
import struct
import irc.bot
import irc.strings
# from irc.client import ip_numstr_to_quad, ip_quad_to_numstr
from config import *
import re
import random
from io import open
import shlex
# from xbmcswift2 import Plugin
from kodiswift import Plugin
import timeit
import hurry.filesize as hf

plugin = Plugin()
log = plugin.log.info


def download(connection, nomRobot, numPaquet):
    log(u"Command XDCC SEND #" + unicode(numPaquet))
    connection.notice(nomRobot, u"xdcc send #" + unicode(numPaquet))


def checkTerminated(bot, DL):
    if DL.terminated == True:
        bot.die()


################################################################################
# CLASS Grabator
示例#16
0
from kodiswift import Plugin, xbmc, ListItem, download_page, clean_dict, SortMethod
from resources.lib.addontools import WsolUtils, utils as WebUtils
import ssl, os.path as path, json, re
import webutil as WebUtils
import web_pdb

ssl._create_default_https_context = ssl._create_unverified_context
plugin = Plugin()
ws = WsolUtils(kodiplugin=plugin)
DL = ws.DL
__imgsearch__ = ws.imgsearch  # 'https://watchseries-online.pl'


@plugin.route('/')
def index():
    litems = []
    plugin.set_content('episodes')
    itemlatest = {
        'label':
        'Latest Episodes',
        'icon':
        'DefaultFolder.png',
        'thumbnail':
        'DefaultFolder.png',
        'path':
        plugin.url_for(category,
                       name='last-350-episodes',
                       url='last-350-episodes')
    }
    itemlatest2 = {
        'label': 'Other Shows',
示例#17
0
#!/usr/bin/python
#
# CONFIG FILE
#
#Modules necessaires : IrcLib / BeautifulSoup / Python2.X
#
# all options and parameters for your implementation of
# this project are here
#

# IRC bot
# from xbmcswift2 import Plugin
from kodiswift import Plugin

plugin = Plugin()
ircDefaultChannel = "#test"
ircDefaultNickname = "Gunther"
ircDefaultServer = "irc.freenode.net"
ircDefaultNumPaquet = 1
ircDefaultNomRobot = "Grabator"
ircDefaultSecondChannel = ""
ircDefaultPort = 6667
ircDefaultVersion = "HexChat 2.9.5"
ircTempoAvantDL = 5.2

# Search parameters
defaultUrl = "http://ixirc.com/?q="

# Downloads
downloadPath = plugin.get_setting('xg_dl_path')
示例#18
0
# -*- coding: utf-8 -*-
import os, sys, ssl, time, datetime, json
from kodiswift import Plugin, ListItem, xbmc, xbmcgui, xbmcvfs, xbmcaddon, xbmcplugin, xbmcmixin
from resources.lib import getoauth, TUMBLRAUTH, TumblrRestClient, tumblrsearch
from collections import namedtuple

try:
    from xbmcutil import viewModes
except:
    pass
tclient = TumblrRestClient
viewmode = 20
APIOK = False
plugin = Plugin(name="TumblrV", addon_id="plugin.video.tumblrv", plugin_file="addon.py", info_type="video")
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = os.path.join(__addondir__, 'resources')
__imgdir__ = os.path.join(__resdir__, 'images')
__imgsearch__ = os.path.join(__imgdir__, 'search.png')
__imgnext__ = os.path.join(__imgdir__, 'next.png')
__imgtumblr__ = os.path.join(__imgdir__, 'tumblr.png')
tagpath = os.path.join(xbmc.translatePath('special://profile/addon_data/'), 'plugin.video.tumblrv', 'tagslist.json')
weekdelta = datetime.timedelta(days=7)
updatedelta = datetime.timedelta(minutes=10)
import web_pdb


def doDebug():
    return bool(plugin.get_setting(key='debugon', converter=bool))


def _json_object_hook(d):
示例#19
0
# -*- coding: utf-8 -*-
import os
import time
from resources.lib.utils import *
from kodiswift import Plugin, xbmcgui, xbmc

plugin = Plugin()
last_category = None

_lang = plugin.get_string

os_name = get_os_name()
os_is_android = None

NATIVE_PATH = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
DEFAULT_API_URL = plugin.get_setting('api_url', str)

# try:
#     import hashlib
#     CACHE_ID_SUFFIX = '-' + hashlib.md5(CUSTOM_API_URL.encode('utf-8')).hexdigest()
# except Exception as ex:
#     log("SiTo.tv hashlib error: %s" % ex, level=xbmc.LOGERROR)
#     CACHE_ID_SUFFIX = '-' + CUSTOM_API_URL.replace(':', '_').replace('/', '-').replace('\\', '-')

# sito.log = log
# sito.notice = notice
# sito.image_resource_url = image_resource_url
# sito.url_for = plugin.url_for
# sito.store = plugin.get_storage('basic_cache' + CACHE_ID_SUFFIX)
# sito.requests_cache = plugin.get_storage('requests_cache', ttl=60*4)
#
示例#20
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from collections import defaultdict
import urllib, requests, re, os, json, uuid, base64, cfscrape, kodi4vn, io
import concurrent.futures
from kodiswift import Plugin
from kodi_six import xbmc
from operator import itemgetter
from cookielib import LWPCookieJar
requests.packages.urllib3.disable_warnings()
if 64 - 64: i11iIiiIii
OO0o = Plugin()
Oo0Ooo = cfscrape.create_scraper()
Oo0Ooo.cookies = LWPCookieJar()
if 85 - 85: OOO0O0O0ooooo % IIii1I.II1 - O00ooooo00
I1IiiI = 30
IIi1IiiiI1Ii = "plugin://plugin.video.hpo1988.fcine"
I11i11Ii = IIi1IiiiI1Ii.split("/")[-1]
oO00oOo = "https://docs.google.com/drawings/d/12OjbFr3Z5TCi1WREwTWECxNNwx0Kx-FTrCLOigrpqG4/pub?w=256&h=256"
OOOo0 = "https://docs.google.com/drawings/d/1rniOY_omlvmXtpuHFoMuCS3upWOu04DD0KWRyLV4szs/pub?w=1920&h=1080"
Oooo000o = '<div class="esnList_item">.+?<a href="(.+?)"[^>]*><img[^>]*src="(.+?)"></a>.+?<a[^>]*title="(.+?)">'
IiIi11iIIi1Ii = '<div class="esnList_item">.+?<a href="(.+?)"[^>]*><img[^>]*src="(.+?)"></a>.+?<a[^>]*title="(.+?)">'
if 54 - 54: IIIiiIIii / o0oo0oo0OO00.iI111iI / oOOo + I1Ii111
if 93 - 93: iiI1i1.II1ii1II1iII1 + oO0o.oOOOO0o0o.o0oO0 + oo00
o00 = {'Cookie': ''}
if 62 - 62: II1ii - o0oOoO00o.iIi1IIii11I + oo0 * o0oOoO00o % o0oOoO00o
if 22 - 22: oo00.o0oOoO00o


@OO0o.route('/')
示例#21
0
from kodiswift import Plugin, xbmc, ListItem, download_page, clean_dict, SortMethod
from resources.lib.addontools import WsolUtils, utils as WebUtils
import ssl, os.path as path, json, re
import webutil as WebUtilsLib
import web_pdb

ssl._create_default_https_context = ssl._create_unverified_context
plugin = Plugin()
ws = WsolUtils(kodiplugin=plugin)
DL = ws.DL
__imgsearch__ = ws.imgsearch  # 'https://watchseries-online.pl'


@plugin.route('/')
def index():
    litems = []
    plugin.set_content('episodes')
    itemlatest = {'label': 'Latest Episodes', 'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png',
                  'path': plugin.url_for(category, name='last-350-episodes', url='last-350-episodes')}
    itemlatest2 = {'label': 'Other Shows', 'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png',
                   'path': plugin.url_for(category, name="category/", url="not-in-homepage")}
    itemsaved = {'label': 'Saved Shows', 'path': plugin.url_for(saved), 'icon': 'DefaultFolder.png',
                 'thumbnail': 'DefaultFolder.png'}
    itemplay = {'label': 'Resolve URL and Play (URLresolver required)',
                'path': plugin.url_for(endpoint=resolveurl),
                'icon': 'DefaultFolder.png', 'thumbnail': 'DefaultFolder.png'}
    itemsearch = {'label': 'Search', 'icon': __imgsearch__, 'thumbnail': __imgsearch__,
                  'path': plugin.url_for(search)}
    litems.append(itemlatest)
    litems.append(itemlatest2)
    litems.append(itemsaved)
示例#22
0
# -*- coding: utf-8 -*-
from kodiswift import Plugin, xbmc, xbmcgui, xbmcaddon, xbmcplugin, xbmcvfs, xbmcmixin, ListItem
import json, sys, os, os.path as path, urllib, urllib2, re
from operator import itemgetter
plugin = Plugin()
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
if __addondir__.startswith('/var'): __addondir__ = '/Users/jezza/PycharmProjects/repo-gaymods/plugin.video.hubgay/'
__resdir__ = path.join(__addondir__, 'resources')
__imgsearch__ = path.join(__resdir__, 'search.png')
urlbase = "http://www.spankwire.com/api/HubTrafficApiCall?"
caturl = urlbase + "data=getCategoriesList&output=json&segment=gay"
catvidsurl = urlbase + "data=searchVideos&output=json&thumbsize=small&count=100&segment=gay&search=&tags=&category={0}"
searchurl = urlbase + "data=searchVideos&output=json&thumbsize=small&count=100&segment=gay&search={0}&tags=&category="
thumbcaturl = "http://cdn2.static.spankwire.com/images/category/Gay/{0}.jpg"
APIURLS = {"gaytube": "http://www.gaytube.com/api/webmasters/search/?ordering=newest&period=alltime&thumbsize=all&count=100&page=1&tags[]=&search=", "pornhub": "http://www.pornhub.com/webmasters/search?id=44bc40f3bc04f65b7a35&search=&tags[]=gay&page=1&thumbsize=medium", "redtube": "http://api.redtube.com/?data=redtube.Videos.searchVideos&output=json&search=&tags[]=gay&page=1&thumbsize=medium", "spankwire": "http://www.spankwire.com/api/HubTrafficApiCall?data=searchVideos&output=json&search=&tags=gay&thumbsize=medium&page=1&segment=gay&count=100", "tube8": "http://api.tube8.com/api.php?action=searchVideos&output=json&search=gay&thumbsize=all&page=1&orientation=gay", "xtube": "http://www.xtube.com/webmaster/api.php?action=getVideosBySearchParams&tags=gay&count=100&thumbsize=400x300&fields=rating,username,title,tags,duration,thumbnail,url,embed,categories&page=1&search=", "youporn": "http://www.youporn.com/api/webmasters/search?search=&page=1&tags[]=gay&thumbsize=medium"}

def makeFolderItems(itemlist):
    litems = []
    for item in itemlist:
        assert isinstance(item, dict)
        litems.append(dict(path=item.get('path')))
    return litems

def makeItemExtraThumbs(item, vid):
    getsrc = itemgetter('src')
    xitem = plugin._listitemify(item=item)
    img = []
    thumbslist = vid.get('thumbs')
    if thumbslist.has_key('big'):
        img = thumbslist.get('big')
    else:
示例#23
0
class Router(object):

   def __init__(self, addonPath, app=None):
      self.plugin=Plugin()
      self.app=app or FoxFanFun(self.plugin, addonPath)
      self.loadMenu()
      # xbmc.executebuiltin('Container.SetViewMode(500)') # Вид "Эскизы".
      # xbmc.executebuiltin('Container.SetViewMode(512)') # Вид "Инфо-стена"

   def loadMenu(self):
      self.plugin.add_url_rule('/', self.menu_shows, 'menu_shows')
      self.plugin.add_url_rule('/watch/<showId>', self.menu_seasons, 'menu_seasons')
      self.plugin.add_url_rule('/watch/<showId>/<seasonId>', self.menu_episodes, 'menu_episodes')
      self.plugin.add_url_rule('/watch/<showId>/<seasonId>/<episodeId>', self.menu_watch, 'menu_watch')

   def menu_shows(self):
      tArr=self.app.listShow()
      tArr=sorted((v for v in tArr.itervalues()), key=lambda o: o.watched)
      res=[]
      self.plugin.set_content('tvshows')
      for o in reversed(tArr):
         res.append({
            'label': o.name,
            # 'path': self.plugin.url_for(self.menu_seasons, showId=o.showId),
            'path':'plugin://plugin.video.FoxFanFun/watch/%(showId)s'%o,
            'info_type':'video',
            'info':{
               'count':o.watched,
               'tvshowtitle': o.name,
               'mediatype':'tvshow',
            },
            'icon':o.icon,
            'thumbnail':o.cover,
            'properties':{
               'fanart_image':o.coverBig,
            },
         })
      return res

   def menu_seasons(self, showId):
      tArr=self.app.listSeason(showId)
      tArr=sorted((v for v in tArr.itervalues()), key=lambda o: o.sorter)
      res=[]
      for o in reversed(tArr):
         res.append({
            'label': o.name,
            'path':'plugin://plugin.video.FoxFanFun/watch/%(showId)s/%(seasonId)s'%o,
            'info_type':'video',
            'info':{
               'count':o.sorter,
               'tvshowtitle': self.app.data[o.showId].name,
               'mediatype':'season',
               'season':int(o.seasonId),
            },
         })
      return res

   def menu_episodes(self, showId, seasonId):
      tArr=self.app.listEpisode(showId, seasonId)
      tArr=sorted((v for v in tArr.itervalues()), key=lambda o: o.sorter)
      res=[]
      self.plugin.set_content('episodes')
      for o in tArr:
         res.append({
            'label': o.name,
            'path':'plugin://plugin.video.FoxFanFun/watch/%(showId)s/%(seasonId)s/%(episodeId)s'%o,
            # 'info_type':'video',
            'info':{
               'count':o.sorter,
               'tvshowtitle':self.app.data[o.showId].name,
               'title': o.name,
               'mediatype':'episode',
               'season':int(o.seasonId),
               'episode':int(o.episodeId),
               'plot':o.descr,
               'plotoutline':o.descr,
            },
            'thumbnail':o.coverBig,
            'properties':{
               'fanart_image':o.coverBig,
            },
            'is_playable':True,
         })
      res=self.plugin.add_to_playlist(res, playlist='video')
      return res

   def menu_watch(self, showId, seasonId, episodeId):
      o=self.app.watch(showId, seasonId, episodeId)
      if not o:
         return []
      elif o.get('error'):
         return [{'label':o.error, 'path':None}]
      return self.plugin.set_resolved_url(o.file)
示例#24
0
 def __init__(self, addonPath, app=None):
    self.plugin=Plugin()
    self.app=app or FoxFanFun(self.plugin, addonPath)
    self.loadMenu()
# -*- coding: utf-8 -*-
from kodiswift import Plugin, actions
from kodiswift import xbmc, xbmcgui
import xbmcaddon
import requests
import copy
import platform
import os

# Global vars
plugin = Plugin()
addon = plugin.addon

USER_AGENT = "Kodi (" + platform.system(
) + ") hearthis.at-Plugin/" + addon.getAddonInfo('version')
HEARTHIS = 'hearthis.at'
API_BASE_URL = "https://api-v2.hearthis.at/"
USER = plugin.get_storage('user_data')
ADDON_PATH = xbmc.translatePath(addon.getAddonInfo('path')).decode('utf-8')

STRINGS = {
    'genres': 30000,
    'playlists': 30001,
    'show_artist': 30002,
    'recently_added': 30003,
    'search': 30004,
    'search_artist': 30005,
    'next': 30006,
    'likes': 30007,
    'popular': 30008,
    'search_track': 30009,
示例#26
0
LICENSE_URL = 'https://lic.drmtoday.com/license-proxy-widevine/cenc/'
LICENSE_URL_HEADERS = (
    'User-Agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.123 Safari/537.36&'
    'Host=lic.drmtoday.com&'
    'Origin=https://mubi.com&'
    'Referer=https://mubi.com/&'
    'Sec-Fetch-Dest=empty&'
    'Sec-Fetch-Mode=cors&'
    'Sec-Fetch-Site=cross-site&'
    'Accept-Encoding=gzip, deflate, br&'
    'Accept-Language=en-US,en;q=0.9&'
    'Connection=keep-alive&'
    'Content-Type=application/json;charset=utf-8'
)

plugin = Plugin(PLUGIN_NAME, PLUGIN_ID, __file__)

if not plugin.get_setting("username") or not plugin.get_setting("password"):
    plugin.open_settings()

mubi = Mubi(plugin.get_setting("username", unicode), plugin.get_setting("password", unicode))


@plugin.route('/')
def index():
    films = mubi.now_showing()
    items = [{
        'label': film.title,
        'is_playable': True,
        'path': plugin.url_for('play_film', identifier=film.mubi_id),
        'thumbnail': film.artwork,
示例#27
0
import base64
import time
import thread
import socket
from datetime import datetime
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from kodiswift import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path = xbmc.translatePath(
	xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
cache = xbmc.translatePath(os.path.join(path, ".cache"))
tmp = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin = Plugin()
#addon = xbmcaddon.Addon("plugin.video.vinh.livetv")
#pluginrootpath = "plugin://plugin.video.vinh.livetv"
addon = xbmcaddon.Addon("plugin.video.vinh.giaitritv")
pluginrootpath = "plugin://plugin.video.vinh.giatritv"
http = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers = {
	"User-Agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
	"Accept-Encoding": "gzip, deflate, sdch"
}


def GetSheetIDFromSettings():
	#sid = "1zL6Kw4ZGoNcIuW9TAlHWZrNIJbDU5xHTtz-o8vpoJss"
	sid = "18oBXoKaL64nx7tdKe0yqEdnRHabdfZS4iHfRT44Fnwg"
示例#28
0
import base64
import time
import thread
import socket
from datetime import datetime
# Tham khảo xbmcswift2 framework cho kodi addon tại
# http://xbmcswift2.readthedocs.io/en/latest/
from kodiswift import Plugin, xbmc, xbmcaddon, xbmcgui, actions
path = xbmc.translatePath(
    xbmcaddon.Addon().getAddonInfo('path')).decode("utf-8")
cache = xbmc.translatePath(os.path.join(path, ".cache"))
tmp = xbmc.translatePath('special://temp')
addons_folder = xbmc.translatePath('special://home/addons')
image = xbmc.translatePath(os.path.join(path, "icon.png"))

plugin = Plugin()
addon = xbmcaddon.Addon("plugin.video.family")
pluginrootpath = "plugin://plugin.video.family"
http = httplib2.Http(cache, disable_ssl_certificate_validation=True)
query_url = "https://docs.google.com/spreadsheets/d/{sid}/gviz/tq?gid={gid}&headers=1&tq={tq}"
sheet_headers = {
    "User-Agent":
    "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0)",
    "Accept-Encoding": "gzip, deflate, sdch"
}


def GetSheetIDFromSettings():
    sid = "13eYVS7eVDdzMjUeCQeGsQoYajUntmVSq7uCrtOTAxl4"
    resp, content = http.request(get_fshare_setting("GSheetURL"), "HEAD")
    try:
示例#29
0
# -*- coding: utf-8 -*-
# https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-web-api-v7-reference
from kodiswift import Plugin, xbmc, ListItem
from urllib import quote_plus as Quote, unquote_plus as Unquote
import webutil
import sys, os, os.path as path
import json
plugin = Plugin()
APIKEY=plugin.get_setting('apikey')
tplWho = '( jovenes OR chavalo OR chavo OR amigo OR hombre OR hermano OR novinho OR chico OR chavalito )'
tplWhat = '( mecos OR masturbo OR masturbandose OR batendo OR paja OR follando OR cogiendo OR cojiendo OR sobarse OR punheta OR verga OR lefa OR mear OR pipi )'
tplWhere = '( flagra OR flagrou OR trabajo OR publico OR biblioteca OR aula OR atrapado OR escuela OR omnibus OR autobus OR viajandor )'
tplWank = '( wank OR wanking OR wanked OR stroke OR stroking OR jerk OR jack OR m********e OR masturbating OR cumming OR cum OR jackoff OR jerkoff OR handjob )'
searchq = tplWhere + ' AND ' + tplWhat + ' ' + tplWho
cpath = path.join(xbmc.translatePath('special://userdata'), 'cookies.lwp')
dl = webutil.DemystifiedWebRequest(cookiePath=cpath)
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = os.path.join(__addondir__, 'resources')
__imgdir__ = os.path.join(__resdir__, 'images')
__imgsearch__ = os.path.join(__imgdir__, 'search.png')
__imgfav__ = os.path.join(__imgdir__, 'fav.png')
__imgnext__ = os.path.join(__imgdir__, 'next.png')
__imgback__ = os.path.join(__imgdir__, 'back.png')
__imgtumblr__ = os.path.join(__imgdir__, 'tumblr.png')

@plugin.route('/')
def index():
    itemnew = {
        'label': 'New Bing Video Search!',
        'icon': __imgsearch__, 'thumbnail': __imgsearch__,
        'path': plugin.url_for(endpoint=query, searchfor='NEW'),
示例#30
0
文件: addon.py 项目: badwog1/kodigay
# -*- coding: utf-8 -*-
import json
import os.path as path
import re
import urllib, urllib2
from operator import itemgetter
from kodiswift import Plugin, xbmc, ListItem

plugin = Plugin()
__addondir__ = xbmc.translatePath(plugin.addon.getAddonInfo('path'))
__resdir__ = path.join(__addondir__, 'resources')
__imgsearch__ = path.join(__resdir__, 'search.png')


def makeVideoItems(itemlist):
    """
    Takes a list of dict's returned from the API and looks for the specific fields to build XBMC ListItem for each item
    :param itemlist:
    :return: List of dict(Label, Label2, Icon, Thumb, Path) items created for each dict returned from the API
    """
    litems = []
    vitem = dict()
    vid = dict()
    item = dict()
    getsrc = itemgetter('src')
    try:
        for vitem in itemlist:
            assert isinstance(vitem, dict)
            if vitem.has_key('video'):
                vid = vitem.get('video')
            else:
示例#31
0
PLAYLIST_XML_FMT = urlunparse((MEDIA_SCHEME, MEDIA_HOST,
                               "index.php/partnerservices2/executeplaylist?" +
                               "partner_id={}&playlist_id={{}}".format(PARTNER_ID), None, None, None))

FIELD_NAME_ROOT_FMT = ("ctl00$ContentPlaceHolder1$DropZoneMainContent$columnDisplay$"
                       "ctl00$controlcolumn$ctl{:02d}$WidgetHost$WidgetHost_widget$")

PAGINATION_FMT = "Pagination1${}"

SEARCH_NAV_FMT = FIELD_NAME_ROOT_FMT.format(0) + PAGINATION_FMT

PLAYER_VARS_RE = re.compile("kWidget.embed\((.*?)\)", re.MULTILINE|re.DOTALL)
STADIUM_THUMB = HOST + ("/uploadedImages/Shared_Assets/Images/News_images/SEASON_16-17/"
                        "July_2016/NDP_update/west_elevation_instory.jpg")

plugin = Plugin()

form_data = plugin.get_storage('form_data')
debug = plugin.get_setting('debug', bool)


def kodi_version():
    query = dict(jsonrpc='2.0',
                 method='Application.GetProperties',
                 params=dict(properties=['version', 'name']),
                 id=1)
    response = json.loads(xbmc.executeJSONRPC(json.dumps(query)))
    return response['result']['version']

def log(msg):
    if debug:
示例#32
0
import os.path as path
import base64
import json
import re
import urllib
from urllib import quote_plus
import ssl
import requests
import webutil as WebUtils
#from xbmcswift2 import Plugin, xbmc, ListItem, download_page, clean_dict, SortMethod
from kodiswift import Plugin, xbmc, ListItem
#from xbmcswift2 import download_page, clean_dict, SortMethod


plugin = Plugin()
ssl._create_default_https_context = ssl._create_unverified_context
__BASEURL__ = 'https://watchseries-online.be'
__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__)


@plugin.route('/')
def index():
    litems = []
    plugin.set_content('episodes')
示例#33
0
# -*- coding: utf-8 -*-
from kodiswift import Plugin, actions
from kodiswift import xbmc, xbmcgui
import xbmcaddon
import requests
import copy
import platform
import os


# Global vars
plugin = Plugin()
addon = plugin.addon

USER_AGENT = "Kodi ("+platform.system() + ") hearthis.at-Plugin/" + addon.getAddonInfo('version')
HEARTHIS = 'hearthis.at'
API_BASE_URL = "https://api-v2.hearthis.at/"
USER = plugin.get_storage('user_data')
ADDON_PATH = xbmc.translatePath(addon.getAddonInfo('path')).decode('utf-8')

STRINGS = {
        'genres'        : 30000,
        'playlists'     : 30001,
        'show_artist'   : 30002,
        'recently_added': 30003,
        'search'        : 30004,
        'search_artist' : 30005,
        'next'          : 30006,
        'likes'         : 30007,
        'popular'       : 30008,
        'search_track'  : 30009,