#!/usr/bin/env python # coding=utf8 # # This file is part of PlayStream - enigma2 plugin to play video streams from various sources # Copyright (c) 2016 ivars777 (ivars777@gmail.com) # Distributed under the GNU GPL v3. For full terms see http://www.gnu.org/licenses/gpl-3.0.en.html # try: import json except: import simplejson as json import urllib2, urllib import datetime, re, sys,os import ConfigParser from collections import OrderedDict from SourceBase import SourceBase import ssl if "_create_unverified_context" in dir(ssl): ssl._create_default_https_context = ssl._create_unverified_context import resolver try: import util except: sys.path.insert(0,'..') import util headers2dict = lambda h: dict([l.strip().split(": ") for l in h.strip().splitlines()]) import HTMLParser h = HTMLParser.HTMLParser() class Source(SourceBase): def __init__(self, country="",cfg_path=None): self.hidden = True # nerāda menu nestrādājošos avotus self.name = "movieplace" self.title = "MoviePlace.lv" self.img = "movieplace.png" self.desc = "Movieplace.lv - filmas latviesu valodā" self.headers = headers2dict(""" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 """) self.headers2 = headers2dict(""" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 X-Requested-With: XMLHttpRequest Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 """) self.url = "http://movieplace.lv/" ######### Entry point ######## def get_content(self, data): print "[movieplace] get_content:", data source, data, path, plist, clist, params, qs = self.parse_data(data) content = [] content.append(("..return", "back","back.png","Return back")) if clist=="home": content.extend([ ("Meklēt", "movieplace::search/?q={0}","","Meklēt"), ("Jaunākās filmas", "movieplace::load/?page1","","Visu žanru jaunākās filmas"), ("Jaunākie seriāli", "movieplace::dir/?page1","","Visu žanru jaunākās filmas"), #("Top50 filmas", "movieplace::index/top_50_filmas/0-4","","Top 50 filmas"), ]) r = self.call("load/") #i = r.find('