#!/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 SourceBase import SourceBase #from collections import OrderedDict import os import ssl if "_create_unverified_context" in dir(ssl): ssl._create_default_https_context = ssl._create_unverified_context #sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from resolver import resolve 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 = "cinemalive" self.title = "cinemalive.tv" self.img = "cinemalive.png" #"https://cinemalive.tv/assets/img/logo.png" self.desc = "Filmas latviski" self.country=country self.headers = headers2dict(""" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,application/json """) self.headers2 = headers2dict(""" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Accept-Language: en-US,en;q=0.8 """) self.url = "https://cinemalive.tv/" #self.login() ######### Entry point ######## def get_content(self, data): print "[cinemalive] 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([ ("Search", "cinemalive::?s={0}","","Search"), #("Filmas latviski - visas", "cinemalive::filmaslatviski/","","Filmas latviski - visas"), ("Filmas angliski", "cinemalive::home_en","","Filmas angliski"), #("Filmas latviski - jaunākās", "cinemalive::filmaslatviski/?get=jaunakas","","Filmas latviski - jaunākās"), #("Filmas latviski - vertētākās", "cinemalive::filmaslatviski/?get=vertetakas","","Filmas latviski - vērtētākās"), #("Filmas latviski - skatitakās", "cinemalive::filmaslatviski/?get=skatitakas","","Filmas latviski - skatītākās"), #("Filmas latviski - animācija", "cinemalive::genre/animacija/","","Filmas latviski - animacijas"), #("Filmas latviski - ģimenes", "cinemalive::genre/gimenes/","","Filmas latviski - ģimenes"), ]) r = self.call("filmaslatviski") i0 = r.find('