Ejemplo n.º 1
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
from resources.lib.scraper import Scraper

STRINGS = {'page': 30001}

plugin = Plugin()
scraper = Scraper()


@plugin.route('/')
def show_topics():
    topics = scraper.get_video_topics()
    items = [{
        'label':
        topic['title'],
        'path':
        plugin.url_for(endpoint='show_videos', topic_id=topic['id'], page='1')
    } for topic in topics]
    return plugin.finish(items)


@plugin.route('/videos/<topic_id>/<page>/')