예제 #1
0
def index():
    channels = CHANNELS[int(plugin.get_setting('channels'))]
    if channels == 'all':
        items = [{'label': 'M6Replay', 'path': plugin.url_for('show_channel', channel='M6')},
                {'label': 'W9Replay', 'path': plugin.url_for('show_channel', channel='W9')}]
        return items
    else:
        return show_channel(channels)
예제 #2
0
def index():
    channels = CHANNELS[int(plugin.get_setting('channels'))]
    if channels == 'all':
        items = [{
            'label': 'M6Replay',
            'path': plugin.url_for('show_channel', channel='M6')
        }, {
            'label': 'W9Replay',
            'path': plugin.url_for('show_channel', channel='W9')
        }]
        return items
    else:
        return show_channel(channels)
예제 #3
0
# USA.
# http://www.gnu.org/copyleft/gpl.html

import requests
import time
import hashlib
import urlparse
from datetime import timedelta
from config import plugin


CATALOGUE_URL = 'http://static.m6replay.fr/catalog/m6group_web/%s/catalogue.json'
CLIP_URL = 'http://static.m6replay.fr/catalog/m6group_web/%s/clip/%s/clip_infos-%s.json'
IMAGES_URL = 'http://static.m6replay.fr/images/'
CODE = {'M6': 'm6replay', 'W9': 'w9replay'}
TTL = int(plugin.get_setting('cached_ttl'))


def get_json(url):
    """Return the json-encode content of the HTTP GET request"""
    try:
        plugin.log.info('JSON request: %s' % url)
        r = requests.get(url)
        return r.json
    except (requests.ConnectionError, requests.HTTPError):
        plugin.log.error('JSON request failed' % url)


def url_thumb(item):
    """Return the url of the thumb associated to item (program or clip)"""
    try:
예제 #4
0
def show_channel(channel):
    show_by = SHOW_BY[int(plugin.get_setting('show_by'))]
    if show_by == 'genre':
        return show_genres(channel)
    else:
        return show_clips(channel, 'all')
예제 #5
0
def show_channel(channel):
    show_by = SHOW_BY[int(plugin.get_setting('show_by'))]
    if show_by == 'genre':
        return show_genres(channel)
    else:
        return show_clips(channel, 'all')