Пример #1
0
#    You should have received a copy of the GNU General Public License
#    along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from datetime import datetime
import time
from string import ascii_lowercase, digits
import json
import requests
import urllib
from xbmcswift2 import Plugin, xbmc, xbmcgui
from resources.lib.api import DokuMonsterApi, NetworkError

PER_PAGE = 50

plugin = Plugin()
api = DokuMonsterApi(default_count=PER_PAGE)

STRINGS = {
    'topics': 30001,
    'new_docus': 30002,
    'tags': 30003,
    'all': 30004,
    'top_docus': 30005,
    'search': 30006,
    'network_error': 30200
}


class DialogSelect(xbmcgui.WindowXMLDialog):
    def __init__(self, *args, **kwargs):
Пример #2
0
from xbmcswift2 import xbmc, xbmcgui, Plugin
from resources.lib.mubi import Mubi

PLUGIN_NAME = 'MUBI'
PLUGIN_ID = 'plugin.video.mubi'

plugin = Plugin(PLUGIN_NAME, PLUGIN_ID, __file__)

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

mubi = Mubi()
mubi.login(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,
        'info': film.metadata._asdict()
    } for film in films]
    return items


@plugin.route('/play/<identifier>')
def play_film(identifier):
Пример #3
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
from converter import JsonListItemConverter
from functools import wraps
from twitch import TwitchTV, TwitchVideoResolver, Keys, TwitchException
from xbmcswift2 import Plugin  #@UnresolvedImport
import sys

ITEMS_PER_PAGE = 20
LINE_LENGTH = 60

PLUGIN = Plugin()
CONVERTER = JsonListItemConverter(PLUGIN, LINE_LENGTH)
TWITCHTV = TwitchTV()


def managedTwitchExceptions(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except TwitchException as error:
            handleTwitchException(error)

    return wrapper


def handleTwitchException(exception):
    codeTranslations = {
        TwitchException.NO_STREAM_URL: 32004,
        TwitchException.STREAM_OFFLINE: 32002,
Пример #4
0
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/>  
'''

from xbmcswift2 import Plugin, xbmcaddon, xbmc, xbmcgui
import urlfetch
from BeautifulSoup import BeautifulSoup
import json, re

xbmcplugin = Plugin()
__mysettings__ = xbmcaddon.Addon(id='plugin.video.hieuhien.vn.itv.fptplay')
__homeUrl__ = 'http://fptplay.net/livetv'

reg = {
    'User-agent':
    'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1',
    'Content-type': 'application/x-www-form-urlencoded',
    'X-Requested-With': 'XMLHttpRequest',
    'Referer': 'http://fptplay.net'
}


@xbmcplugin.route('/')
def main():
    channel = []
Пример #5
0
#!/usr/bin/python
# coding=utf-8
import urllib, requests, re, json, os, uuid, random
from xbmcswift2 import Plugin, xbmc, xbmcgui, xbmcaddon

requests.packages.urllib3.disable_warnings()
oo000 = Plugin()
if 9 - 9: Ii.o0o00Oo0O - iI11I1II1I1I


def oooo():
    iIIii1IIi = requests.get(
        "https://docs.google.com/spreadsheets/d/13VzQebjGYac5hxe1I-z1pIvMiNB0gSG7oWJlFHWnqsA/export?format=tsv&gid=126722574"
    )
    o0OO00 = iIIii1IIi.text.strip().splitlines()
    random.shuffle(o0OO00)
    return o0OO00
    if 78 - 78: i11i.oOooOoO0Oo0O


@oo000.route('/play/<args_json>')
def iI1(args_json={}):
    i1I11i = json.loads(args_json)
    OoOoOO00(
        "[Play] %s" % (i1I11i["title"].encode("utf8") if "title" in i1I11i else
                       "Unknow Title"), '/play/%s/%s' %
        (i1I11i["url"],
         json.dumps(i1I11i["payloads"]) if "payloads" in i1I11i else "{}"))
    I11i = xbmcgui.DialogProgress()
    I11i.create('HPlus.vn',
                'Đang tải, Xin quý khách vui lòng đợi trong giây lát...')