import xbmcplugin
import sys
import urllib
import xbmcaddon
import auth
from datetime import datetime
try:
    import json
except ImportError:
    import simplejson as json

PLUGIN_NAME = 'Moja webTV'
PLUGIN_ID = 'plugin.video.mojawebtv'

pluginhandle = int(sys.argv[1])
plugin = Plugin(PLUGIN_NAME, PLUGIN_ID, __file__)
usern = xbmcplugin.getSetting(pluginhandle, 'username')
passwd = xbmcplugin.getSetting(pluginhandle, 'password')


def parse_video(video):
    '''Returns a dict of information for a given json video object.'''
    info = {
        'title':
        video['epgstart'] + '  ' + video['epgtitle'] + ' (' +
        str(video['epgduration']) + ' min)',
        'summary':
        video['title'],
        'videoid':
        video['ch'],
        'start':
# 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 xbmcswift import Plugin, download_page, xbmc, xbmcgui
from xbmcswift.ext.playlist import playlist


PLUGIN_NAME = 'OffeneKanaele'
PLUGIN_ID = 'plugin.video.offene_kanaele'


plugin = Plugin(PLUGIN_NAME, PLUGIN_ID, __file__)
plugin.register_module(playlist, url_prefix='/_playlist')


@plugin.route('/', default=True)
def show_homepage():
    items = [
        # Berlin
        {'label': 'Berlin',
         'url': plugin.url_for('berlin')},
        # Dessau
        {'label': 'Dessau',
         'url': plugin.url_for('dessau')},
        # Landau, Neustadt & Haßloch
        {'label': 'Landau, Neustadt & Haßloch',
         'url': plugin.url_for('landau')},
Example #3
0
#!/usr/bin/env python

from xbmcswift 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_session = Mubi()
mubi_session.login(plugin.get_setting("username"),
                   plugin.get_setting("password"))


@plugin.route('/')
def index():
    items = [{'label': plugin.get_string(31001), 'is_folder': True,
              'url': plugin.url_for('select_filter')},
             {'label': plugin.get_string(31002), 'is_folder': True,
              'url': plugin.url_for('show_cinemas')},
             {'label': plugin.get_string(31003), 'is_folder': True,
              'url': plugin.url_for('show_films', filter='watchlist',
                                    argument='0', page='1')},
             {'label': plugin.get_string(31004), 'is_folder': True,
              'url': plugin.url_for('show_search_targets')}]
    return plugin.add_items(items)
Example #4
0
from xbmcswift import Plugin
import resources.lib.scraper as scraper

plugin = Plugin('CollegeHumor', 'plugin.video.collegehumor')


@plugin.route('/', default=True)
def show_categories():
    categories = scraper.getCategories()
    items = [{
        'label': category['title'],
        'url': plugin.url_for(
            'show_videos',
            category=category['link'],
            page='1',
        ),
    } for category in categories]
    return plugin.add_items(items)


@plugin.route('/category/<category>/<page>/')
def show_videos(category, page):
    videos, has_next_page = scraper.getVideos(category, page)
    items = [{
        'label': video['title'],
        'thumbnail': video['image'],
        'info': {
            'originaltitle': video['title'],
            #'tagline': video['tagline']
        },
        'url': plugin.url_for(
Example #5
0
from datetime import datetime
try:
    import json
except ImportError:
    import simplejson as json


PLUGIN_NAME = 'Moja webTV'
PLUGIN_ID = 'plugin.video.mojawebtv'





pluginhandle = int(sys.argv[1])
plugin = Plugin(PLUGIN_NAME, PLUGIN_ID, __file__)
usern =  xbmcplugin.getSetting(pluginhandle, 'username')
passwd = xbmcplugin.getSetting(pluginhandle, 'password')

def parse_video(video):
    '''Returns a dict of information for a given json video object.'''
    info = {
        'title': video['epgstart']+'  '+video['epgtitle']+' ('+str(video['epgduration'])+' min)',
        'summary': video['title'],
        'videoid': video['ch'],
        'start': video['epgstart'],
        'thumbnail': 'http://webtv.bhtelecom.ba/thumbs/'+video['ch']+'.jpg?x='+datetime.now().strftime('%Y%m%d%H%M%S'),
        'logo': 'http://webtv.bhtelecom.ba/hq_logo/'+video['ch']+'.png',
        'cluster': int(video['cluster'])
    }
    return info
Example #6
0
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
from xbmcswift import Plugin, download_page, xbmc, xbmcgui
from xbmcswift.ext.playlist import playlist
from BeautifulSoup import BeautifulSoup as BS
from urllib import urlencode
from urlparse import urljoin
import re
try:
    import json
except ImportError:
    import simplejson as json

PLUGIN_NAME = 'AlJazeera'
PLUGIN_ID = 'plugin.video.aljazeera'

plugin = Plugin(PLUGIN_NAME, PLUGIN_ID, __file__)
plugin.register_module(playlist, url_prefix='/_playlist')

BASE_URL = 'http://english.aljazeera.net'


def full_url(path):
    return urljoin(BASE_URL, path)


def extract_videoid(url):
    return url.split("/")[-1:][0]


YOUTUBE_PTN = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s'
Example #7
0
#!/usr/bin/env python
from xbmcswift import Plugin, download_page
from BeautifulSoup import BeautifulSoup as BS, SoupStrainer as SS
from urlparse import urljoin
import re

__plugin_name__ = '{plugin_name}'
__plugin_id__ = '{plugin_id}'

plugin = Plugin(__plugin_name__, __plugin_id__)

#### Plugin Views ####


# Default View
@plugin.route('/')
def show_categories():
    items = [
        {
            'label': 'Show Topics',
            'url': plugin.url_for('show_topics')
        },
    ]
    return plugin.add_items(items)


@plugin.route('/topics/')
def show_topics():
    pass