Beispiel #1
0
	def __init__(self, session, streamFilmLink, streamName):
		self.session = session
		self.streamFilmLink = streamFilmLink
		self.streamName = streamName

		path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/%s/XXXGenreScreen.xml" % config.mediaportal.skin.value
		if not fileExists(path):
			path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/original/XXXGenreScreen.xml"
		print path
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		Screen.__init__(self, session)

		self["actions"]  = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions", "EPGSelectActions"], {
			"ok"    : self.keyOK,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("G-Stream.in")
		self['name'] = Label('Bitte warten...')
		self['coverArt'] = Pixmap()

		self.tw_agent_hlp = TwAgentHelper()
		self.keyLocked = True
		self.filmliste = []
		self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
		self.chooseMenuList.l.setItemHeight(25)
		self['genreList'] = self.chooseMenuList

		self.onLayoutFinish.append(self.loadPage)
    def __init__(self, session, title, episode, url):
        self.serieUrl = url
        self.Title = title
        self.episode = episode
        MPScreen.__init__(self, session, skin='MP_PluginDescr')

        self["actions"] = ActionMap(["MP_Actions"], {
            "0": self.closeAll,
            "ok": self.keyOK,
            "cancel": self.keyCancel
        }, -1)

        self['title'] = Label("watchseries-online")
        self['leftContentTitle'] = Label(_("Stream Selection"))
        self['ContentTitle'] = Label(_("Stream Selection"))
        self['name'] = Label(self.Title)

        self.streamList = []
        self.ml = MenuList([],
                           enableWrapAround=True,
                           content=eListboxPythonMultiContent)
        self['liste'] = self.ml
        self.keyLocked = True
        self.onLayoutFinish.append(self.loadPage)
        self.tw_agent_hlp = TwAgentHelper()
Beispiel #3
0
def getRedirectedUrl():
	def getUrl(result, err=False):
		if not err:
			global redirected_url
			redirected_url = result

	tw_agent_hlp = TwAgentHelper(redir_agent=False)
	tw_agent_hlp.getRedirectedUrl(BASE_URL).addCallback(getUrl).addErrback(getUrl, True)
Beispiel #4
0
    def __init__(self, session, filmUrl, filmName, imageLink):
        self.session = session
        self.filmUrl = filmUrl
        self.filmName = filmName
        self.imageUrl = imageLink

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path,
                                                config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ShortcutActions", "EPGSelectActions",
                "WizardActions", "ColorActions", "NumberActions",
                "MenuActions", "MoviePlayerActions", "InfobarSeekActions"
            ], {
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "green": self.keyTrailer,
                "ok": self.keyOK,
                "info": self.keyTMDbInfo,
                "cancel": self.keyCancel
            }, -1)

        self['title'] = Label(IS_Version)
        self['ContentTitle'] = Label("Stream Auswahl")
        self['coverArt'] = Pixmap()
        self['handlung'] = ScrollLabel("")
        self['name'] = Label(filmName)
        self['Page'] = Label("")
        self['page'] = Label("")
        self['F1'] = Label("Text-")
        self['F2'] = Label("")
        self['F3'] = Label("")
        self['F4'] = Label("Text+")

        self.trailerId = None
        self.tw_agent_hlp = TwAgentHelper()
        self.streamListe = []
        self.streamMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.streamMenuList.l.setFont(0, gFont('mediaportal', 24))
        self.streamMenuList.l.setItemHeight(25)
        self['liste'] = self.streamMenuList
        self.keyLocked = True
        self.onLayoutFinish.append(self.loadPage)
Beispiel #5
0
 def getRealdebrid(self, loop=False):
     self.agent = TwAgentHelper(
         headers={
             'User-Agent': 'E2 MediaPortal/%s' % self.mpversion,
             'Content-Type': 'application/x-www-form-urlencoded',
             'Authorization': 'Bearer %s' % self.raccesstoken
         })
     if self.calltype == 'link':
         self.getLink(loop)
     elif self.calltype == 'user':
         self.getUserInfo(loop)
     else:
         self.closeall()
Beispiel #6
0
    def __init__(self, session, phCatLink):
        self.session = session
        self.phCatLink = phCatLink
        path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/%s/XXXFilmScreen.xml" % config.mediaportal.skin.value
        if not fileExists(path):
            path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/original/XXXFilmScreen.xml"
        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ShortcutActions", "WizardActions",
                "ColorActions", "SetupActions", "NumberActions", "MenuActions",
                "EPGSelectActions"
            ], {
                "ok": self.keyOK,
                "cancel": self.keyCancel,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "green": self.keyPageNumber
            }, -1)

        self['title'] = Label("YouPorn.com")
        self['name'] = Label("Film Auswahl")
        self['views'] = Label("")
        self['runtime'] = Label("")
        self['page'] = Label("")
        self['coverArt'] = Pixmap()
        self.keyLocked = True
        self.page = 1
        self.lastpage = 1

        self.tw_agent_hlp = TwAgentHelper()
        self.tw_agent_hlp.headers.addRawHeader('Cookie', 'age_verified=1')
        self.filmliste = []
        self.chooseMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
        self.chooseMenuList.l.setItemHeight(25)
        self['genreList'] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadpage)
Beispiel #7
0
	def __init__(self, session, Title, Hoster, Data):
		self.Title = Title
		self.Hoster = Hoster
		self.Data = Data
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()
		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok"	: self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("alluc.to / Filter: %s" % config.mediaportal.alluc_country.value)
		self['ContentTitle'] = Label("Streamlist %s" %self.Title)

		self.keyLocked = True
		self.tw_agent_hlp = TwAgentHelper()
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml
		self.onLayoutFinish.append(self.loadPage)
Beispiel #8
0
	def __init__(self, session, streamFilmLink, streamName):
		self.streamFilmLink = streamFilmLink
		self.streamName = streamName
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
		path = "%s/%s/defaultGenreScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultGenreScreen.xml"
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok" : self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("MegaSkanks.com")
		self['name'] = Label(self.streamName)
		self['ContentTitle'] = Label("Streams:")

		self.tw_agent_hlp = TwAgentHelper(redir_agent=True)
		self.keyLocked = True
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)
Beispiel #9
0
	def __init__(self, session, streamFilmLink, streamName):
		self.session = session
		self.streamFilmLink = streamFilmLink
		self.streamName = streamName

		path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/%s/XXXGenreScreen.xml" % config.mediaportal.skin.value
		if not fileExists(path):
			path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/original/XXXGenreScreen.xml"
		print path
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		Screen.__init__(self, session)

		self["actions"]  = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions", "EPGSelectActions"], {
			"ok"    : self.keyOK,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("G-Stream.in")
		self['name'] = Label('Bitte warten...')
		self['coverArt'] = Pixmap()

		self.tw_agent_hlp = TwAgentHelper()
		self.keyLocked = True
		self.filmliste = []
		self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
		self.chooseMenuList.l.setItemHeight(25)
		self['genreList'] = self.chooseMenuList

		self.onLayoutFinish.append(self.loadPage)
Beispiel #10
0
    def __init__(self, session):
        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
        path = "%s/%s/defaultGenreScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + mp_globals.skinFallback + "/defaultGenreScreen.xml"
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()
        MPScreen.__init__(self, session)

        self["actions"] = ActionMap(
            ["MP_Actions"], {"ok": self.keyOK, "0": self.closeAll, "cancel": self.keyCancel}, -1
        )

        self["title"] = Label(BASE_NAME)
        self["ContentTitle"] = Label("Genre:")
        self.keyLocked = True
        self.suchString = ""

        self.tw_agent_hlp = TwAgentHelper(followRedirect=True)
        self.filmliste = []
        self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
        self["liste"] = self.ml

        self.onLayoutFinish.append(self.layoutFinished)
Beispiel #11
0
	def __init__(self, session, url, name, which):
		self.url = url
		self.name = name
		self.which = which
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
		path = "%s/%s/defaultGenreScreenCover.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultGenreScreenCover.xml"
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()
		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok"	: self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label(m4k)
		self['ContentTitle'] = Label(_("Stream Selection"))


		self.coverUrl = None
		self.base_url = m4k_url
		self.tw_agent_hlp = TwAgentHelper(redir_agent=True)
		self.keyLocked = True
		self.list = []
		self.keckse = {}
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)
	def __init__(self, session, title, episode, url):
		self.serieUrl = url
		self.Title = title
		self.episode = episode
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListScreen.xml"
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()
		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"0" : self.closeAll,
			"ok" : self.keyOK,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("watchseries-online")
		self['leftContentTitle'] = Label(_("Stream Selection"))
		self['ContentTitle'] = Label(_("Stream Selection"))
		self['name'] = Label(self.Title)

		self.streamList = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml
		self.keyLocked = True
		self.onLayoutFinish.append(self.loadPage)
		self.tw_agent_hlp = TwAgentHelper()
Beispiel #13
0
		else:
			get_stream_link(self.session).check_link(url, self.got_link)

	def wtfisthis(self, data):
		url = re.search('<a href="(http://wtf-is-this.xyz/\?r=.*?)"', data, re.S)
		if url:
			url = url.group(1)
			self.tw_agent_hlp = TwAgentHelper()
	def wtfisthis(self, data):
		url = re.search('<a href="(http://wtf-is-this.xyz/\?r=.*?)"', data, re.S)
		if url:
			url = url.group(1)
			self.tw_agent_hlp = TwAgentHelper()
			self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.wtfisthisdata).addErrback(self.dataError)
		else:
			self.adfly(data)
	def keyOK(self):
		if self.keyLocked:
			return
		streamid = self['liste'].getCurrent()[0][1]
		if streamid == None:
			return
		url = "%s/en/out/%s" % (BASE_URL, streamid)
		self.tw_agent_hlp = TwAgentHelper()
		self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.test_streamLink).addErrback(self.dataError)
Beispiel #16
0
class MTVdeLink:

    tw_agent_hlp = TwAgentHelper()

    def __init__(self, session):
        print "MTVdeLink:"
        self.session = session
        self._callback = None

    def getLink(self, cb_play, cb_err, title, artist, token, imgurl):
        self._callback = cb_play
        self._errback = cb_err
        self.title = title
        self.artist = artist
        self.imgurl = imgurl

        #data = ''
        url = "http://api.mtvnn.com/v2/mrss?uri=mgid:sensei:video:mtvnn.com:music_video-%s-DE" % token
        """
		try:
			data = urlopen2(url).read()
		except (URLError, HTTPException, socket.error), err:
			printl(err,self,"E")
			cb_err('MTVdeLink: Cannot get link!')
		"""
        self.tw_agent_hlp.getWebPage(self._parseData, cb_err, url, False)

    def _parseData(self, data):
        print "_parseData:"
        rtmpurl = re.search("<media:content.*?url='(.*?)'>", data)
        if rtmpurl:
            """
			try:
				data = urlopen2(rtmpurl.group(1)).read()
			except (URLError, HTTPException, socket.error), err:
				printl(err,self,"E")
			"""
            self.tw_agent_hlp.getWebPage(self._parseData2, self._errback,
                                         rtmpurl.group(1), False)
        else:
            self._errback('MTVdeLink: Cannot get link!')

    def _parseData2(self, data):
        print "_parseData2:"
        rtmplink = re.findall('<src>(rtmp.*?)</src>', data)
        if rtmplink:
            videourl = rtmplink[
                -1] + ' swfUrl=http://player.mtvnn.com/g2/g2player_2.1.4.swf swfVfy=1'
        else:
            #videourl = None
            self._errback('MTVdeLink: Cannot get link!')

        self._callback(self.title,
                       videourl,
                       imgurl=self.imgurl,
                       artist=self.artist)
	def getRealdebrid(self, loop=False):
		self.agent = TwAgentHelper(headers={'User-Agent': 'E2 MediaPortal/%s' % self.mpversion,
											'Content-Type': 'application/x-www-form-urlencoded',
											'Authorization': 'Bearer %s' % self.raccesstoken
											})
		if self.calltype == 'link':
			self.getLink(loop)
		elif self.calltype == 'user':
			self.getUserInfo(loop)
		else:
			self.closeall()
Beispiel #18
0
    def __init__(self, session, Link, Name):
        self.Link = Link
        self.Name = Name
        MPScreen.__init__(self,
                          session,
                          skin='MP_Plugin',
                          default_cover=default_cover)
        ThumbsHelper.__init__(self)

        self["actions"] = ActionMap(
            ["MP_Actions"], {
                "ok": self.keyOK,
                "0": self.closeAll,
                "cancel": self.keyCancel,
                "5": self.keyShowThumb,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "green": self.keyPageNumber
            }, -1)

        self['title'] = Label("xpaja.net")
        self['ContentTitle'] = Label("Genre: %s" % self.Name)
        self['F2'] = Label(_("Page"))

        self['Page'] = Label(_("Page:"))
        self.keyLocked = True
        self.page = 1
        self.lastpage = 1
        self.tw_agent_hlp = TwAgentHelper()

        self.filmliste = []
        self.ml = MenuList([],
                           enableWrapAround=True,
                           content=eListboxPythonMultiContent)
        self['liste'] = self.ml

        self.onLayoutFinish.append(self.loadPage)
Beispiel #19
0
	def __init__(self, session, Link, Name):
		self.session = session
		self.Link = Link
		self.Name = Name
		self.plugin_path = mp_globals.pluginPath
		self.skin_path =  mp_globals.pluginPath + "/skins"

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + "/original/defaultListScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		Screen.__init__(self, session)

		self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions", "EPGSelectActions"], {
		"ok"	: self.keyOK,
		"cancel": self.keyCancel,
		"up" : self.keyUp,
		"down" : self.keyDown,
		"right" : self.keyRight,
		"left" : self.keyLeft,
		"nextBouquet" : self.keyPageUp,
		"prevBouquet" : self.keyPageDown
		}, -1)

		self['title'] = Label("Arte Mediathek")
		self['ContentTitle'] = Label("Auswahl: %s" % self.Name)
		self['name'] = Label("")
		self['F1'] = Label("Exit")
		self['F2'] = Label("")
		self['F3'] = Label("")
		self['F4'] = Label("")
		self['F2'].hide()
		self['F3'].hide()
		self['F4'].hide()
		self['coverArt'] = Pixmap()
		self['Page'] = Label("Page: ")
		self['page'] = Label("")
		self['handlung'] = Label("")

		self.keyLocked = True
		self.filmliste = []
		self.tw_agent_hlp = TwAgentHelper()
		self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
		self.chooseMenuList.l.setItemHeight(25)
		self['liste'] = self.chooseMenuList
		self.page = 0
		self.onLayoutFinish.append(self.loadPage)
Beispiel #20
0
	def __init__(self, session, filmUrl, filmName, imageLink):
		self.session = session
		self.filmUrl = filmUrl
		self.filmName = filmName
		self.imageUrl = imageLink

		self.plugin_path = mp_globals.pluginPath
		self.skin_path =  mp_globals.pluginPath + "/skins"

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + "/original/defaultListScreen.xml"

		print path
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		Screen.__init__(self, session)

		self["actions"]  = ActionMap(["OkCancelActions", "ShortcutActions", "EPGSelectActions", "WizardActions", "ColorActions", "NumberActions", "MenuActions", "MoviePlayerActions", "InfobarSeekActions"], {
			"red" 		: self.keyTxtPageUp,
			"blue" 		: self.keyTxtPageDown,
			"green" 	: self.keyTrailer,
			"ok"    	: self.keyOK,
			"info" 		: self.keyTMDbInfo,
			"cancel"	: self.keyCancel
		}, -1)

		self['title'] = Label(IS_Version)
		self['ContentTitle'] = Label("Stream Auswahl")
		self['coverArt'] = Pixmap()
		self['handlung'] = ScrollLabel("")
		self['name'] = Label(filmName)
		self['Page'] = Label("")
		self['page'] = Label("")
		self['F1'] = Label("Text-")
		self['F2'] = Label("")
		self['F3'] = Label("")
		self['F4'] = Label("Text+")

		self.trailerId = None
		self.tw_agent_hlp = TwAgentHelper()
		self.streamListe = []
		self.streamMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.streamMenuList.l.setFont(0, gFont('mediaportal', 24))
		self.streamMenuList.l.setItemHeight(25)
		self['liste'] = self.streamMenuList
		self.keyLocked = True
		self.onLayoutFinish.append(self.loadPage)
Beispiel #21
0
	def __init__(self, session, Link, Name, mode):
		self.mode = mode
		self.Link = Link
		self.Name = Name
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)
		ThumbsHelper.__init__(self)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok" : self.keyOK,
			"0" : self.closeAll,
			"cancel" : self.keyCancel,
			"5" : self.keyShowThumb,
			"up" : self.keyUp,
			"down" : self.keyDown,
			"right" : self.keyRight,
			"left" : self.keyLeft,
			"nextBouquet" : self.keyPageUp,
			"prevBouquet" : self.keyPageDown,
			"green" : self.keyPageNumber
		}, -1)

		self['title'] = Label("GStream.to")
		self['ContentTitle'] = Label(self.Name)
		self['F2'] = Label(_("Page"))

		self['Page'] = Label(_("Page:"))
		self.keyLocked = True
		self.page = 1
		self.lastpage = 1

		self.tw_agent_hlp = TwAgentHelper(redir_agent=True)
		self.urlRedirected = ''
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)
	def __init__(self, session, Link, Name, Image, Handlung):
		self.Link = Link
		self.Name = Name
		self.image = Image
		self.handlung = Handlung
		MPScreen.__init__(self, session, skin='MP_PluginDescr')

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok"    : self.keyOK,
			"0": self.closeAll,
			"cancel": self.keyCancel,
		}, -1)

		self['title'] = Label("PrimeWire.ag")
		self['ContentTitle'] = Label("Streams: %s" % self.Name)

		self.tw_agent_hlp = TwAgentHelper()
		self.streamList = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.keyLocked = True
		self.onLayoutFinish.append(self.loadPage)
class pornhiveStreamListeScreen(MPScreen):

	def __init__(self, session, streamFilmLink, streamName, streamImage):
		self.streamFilmLink = streamFilmLink
		self.streamName = streamName
		self.streamImage = streamImage
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
		path = "%s/%s/defaultListWideScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListWideScreen.xml"
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok" : self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label(BASE_NAME)
		self['ContentTitle'] = Label("Streams:")
		self['name'] = Label(_("Please wait..."))

		self.captchainfo = {}
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		CoverHelper(self['coverArt']).getCover(self.streamImage)
		self.keyLocked = True
		self.filmliste = []
		getPage(self.streamFilmLink).addCallback(self.loadPageData).addErrback(self.dataError)

	def loadPageData(self, data):
		streams = re.findall('data-id="(.*?)".*?Watch\sit\son\s+(.*?)"', data, re.S)
		if streams:
			for (streamid, hostername) in streams:
				if isSupportedHoster(hostername, True):
					self.filmliste.append((hostername, streamid))
		if len(self.filmliste) == 0:
			self.filmliste.append((_("No supported streams found!"), None))
		self.ml.setList(map(self._defaultlisthoster, self.filmliste))
		self.keyLocked = False
		self['name'].setText(self.streamName)

	def keyOK(self):
		if self.keyLocked:
			return
		streamid = self['liste'].getCurrent()[0][1]
		if streamid == None:
			return
		url = "%s/en/out/%s" % (BASE_URL, streamid)
		self.tw_agent_hlp = TwAgentHelper()
		self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.test_streamLink).addErrback(self.dataError)

	def test_streamLink(self, url):
		if re.match(BASE_URL, url):
			getPage(url).addCallback(self.get_streamLink).addErrback(self.dataError)
		else:
			get_stream_link(self.session).check_link(url, self.got_link)

	def get_streamLink(self, data):
		streams = re.search('<iframe\ssrc="(.*?)"', data, re.S|re.I)
		if streams:
			get_stream_link(self.session).check_link(streams.group(1), self.got_link)
		else:
			message = self.session.open(MessageBoxExt, _("Broken URL parsing, please report to the developers."), MessageBoxExt.TYPE_INFO, timeout=3)

	def got_link(self, stream_url):
		self.session.open(SimplePlayer, [(self.streamName, stream_url, self.streamImage)], showPlaylist=False, ltype='pornhive', cover=True)
Beispiel #24
0
class rlstoGenreScreen(MPScreen):
    def __init__(self, session):
        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
        path = "%s/%s/defaultGenreScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + mp_globals.skinFallback + "/defaultGenreScreen.xml"
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()
        MPScreen.__init__(self, session)

        self["actions"] = ActionMap(
            ["MP_Actions"], {"ok": self.keyOK, "0": self.closeAll, "cancel": self.keyCancel}, -1
        )

        self["title"] = Label(BASE_NAME)
        self["ContentTitle"] = Label("Genre:")
        self.keyLocked = True
        self.suchString = ""

        self.tw_agent_hlp = TwAgentHelper(followRedirect=True)
        self.filmliste = []
        self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
        self["liste"] = self.ml

        self.onLayoutFinish.append(self.layoutFinished)

    def layoutFinished(self):
        url = "http://rls.to/a"
        self.tw_agent_hlp.getWebPage(url).addCallback(self.parseData).addErrback(self.dataError)

    def parseData(self, data):
        parse = re.search('class="right">(.*?)</ul>', data, re.S)
        raw = re.findall('class="menu-item.*?href="(.*?)">(.*?)</a>', parse.group(1), re.S)
        if raw:
            for (Url, Title) in raw:
                self.filmliste.append((decodeHtml(Title), Url))
        self.filmliste.insert(0, ("--- Search ---", None))
        self.ml.setList(map(self._defaultlistcenter, self.filmliste))
        self.keyLocked = False

    def SuchenCallback(self, callback=None, entry=None):
        if callback is not None and len(callback):
            self.suchString = callback.replace(" ", "+")
            Name = "--- Search ---"
            Link = self.suchString
            self.session.open(rlstoListScreen, Link, Name)

    def keyOK(self):
        if self.keyLocked:
            return
        if not config.mediaportal.premiumize_use.value and not config.mediaportal.realdebrid_use.value:
            message = self.session.open(
                MessageBoxExt,
                _("%s only works with enabled MP premiumize.me or Real-Debrid.com option (MP Setup)!" % BASE_NAME),
                MessageBoxExt.TYPE_INFO,
                timeout=10,
            )
            return
        Name = self["liste"].getCurrent()[0][0]
        Link = self["liste"].getCurrent()[0][1]
        if Name == "--- Search ---":
            self.suchen()
        else:
            self.session.open(rlstoListScreen, Link, Name)
Beispiel #25
0
class gstreaminxxxStreamListeScreen(MPScreen):

	def __init__(self, session, streamFilmLink, streamName, cover):
		self.streamFilmLink = streamFilmLink
		self.streamName = streamName
		self.cover = cover
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListScreen.xml"
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok"    : self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("GStream.to")
		self['ContentTitle'] = Label(_("Stream Selection"))
		self['name'] = Label(self.streamName)

		self.tw_agent_hlp = TwAgentHelper()
		self.keyLocked = True
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		CoverHelper(self['coverArt']).getCover(self.cover)
		self['name'].setText(_('Please wait...'))
		twAgentGetPage(self.streamFilmLink, agent=special_headers, headers={'Cookie': 'sitechrx='+sitechrx+'; overkill_in='+str(time())}).addCallback(self.loadPageData).addErrback(self.dataError)

	def loadPageData(self, data):
		raw = re.search('<table\sid="post[0-9]+"(.*?)id="post_thanks_box', data, re.S)
		raw = re.sub(r'<!-- 1<script type="text/javascript">jwplayer.key.*?</script>1 -->', "", raw.group(1))
		streams = re.findall('href="(http://(?!gstream\.to/(mirror|img|images)/)(?!www.youtube.com)(?!www.filefactory)(gstream\.to/secure/|)(.*?)\/.*?)[\'|"|\&|<]', raw, re.S)
		if streams:
			for (stream, dummy, dummy2, hostername) in streams:
				if isSupportedHoster(hostername, True):
					hostername = hostername.replace('www.','').replace('embed.','')
					self.filmliste.append((hostername, stream))
			# remove duplicates
			self.filmliste = list(set(self.filmliste))
		if len(self.filmliste) == 0:
			self.filmliste.append((_('No supported streams found!'), None))
		self.ml.setList(map(self._defaultlisthoster, self.filmliste))
		self['name'].setText(self.streamName)
		self.keyLocked = False

	def keyOK(self):
		if self.keyLocked:
			return
		url = self['liste'].getCurrent()[0][1]
		if url == None:
			return
		url = url.replace('&amp;','&')
		self['name'].setText(_('Please wait...'))
		if re.match('.*?gstream.to/secure/', url, re.S|re.I):
			print 'Secured Play'
			self.tw_agent_hlp.headers.addRawHeader('Referer','http://gstream.to/')
			self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.get_stream).addErrback(self.dataError)
		else:
			print 'Direct Play'
			self.get_stream(url)

	def get_stream(self,url):
		get_stream_link(self.session).check_link(url, self.got_link)

	def got_link(self, stream_url):
		self['name'].setText(self.streamName)
		if stream_url == None:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)
		else:
			self.session.open(SimplePlayer, [(self.streamName, stream_url)], showPlaylist=False, ltype='gstreaminxxx')
Beispiel #26
0
class realdebrid_oauth2(Screen):
    def __init__(self, session, link, calltype='link'):
        self.link = link
        self.calltype = calltype
        self.raccesstoken = config_mp.mediaportal.realdebrid_accesstoken.value
        self.rrefreshtoken = config_mp.mediaportal.realdebrid_refreshtoken.value
        self.rclient_id = config_mp.mediaportal.realdebrid_rclient_id.value
        self.rclient_secret = config_mp.mediaportal.realdebrid_rclient_secret.value
        self.rAPPid = "2BKDBPNPA4D3U"
        self.rdevicecode = ''
        self.mpversion = config_mp.mediaportal.version.value
        self.agent = None

        Screen.__init__(self, session)
        self.onLayoutFinish.append(self.getRealdebrid)

    def getRealdebrid(self, loop=False):
        self.agent = TwAgentHelper(
            headers={
                'User-Agent': 'E2 MediaPortal/%s' % self.mpversion,
                'Content-Type': 'application/x-www-form-urlencoded',
                'Authorization': 'Bearer %s' % self.raccesstoken
            })
        if self.calltype == 'link':
            self.getLink(loop)
        elif self.calltype == 'user':
            self.getUserInfo(loop)
        else:
            self.closeall()

    def getUserInfo(self, loop=False):
        if self.raccesstoken:
            url = "https://api.real-debrid.com/rest/1.0/user"
            self.agent.getWebPage(url).addCallback(
                self.getUserInfoData,
                loop).addErrback(self.getTokenError,
                                 loop).addErrback(self.noerrorload)
        else:
            url = 'https://api.real-debrid.com/oauth/v2/device/code?client_id=%s&new_credentials=yes' % self.rAPPid
            self.agent.getWebPage(url).addCallback(self.getAuth).addErrback(
                self.codeerror, 'getAuth code error')

    def getUserInfoData(self, data, loop):
        try:
            result = json.loads(data)
        except:
            self.session.open(MessageBoxExt,
                              _("Real-Debrid: Error getting Userdata!"),
                              MessageBoxExt.TYPE_INFO,
                              timeout=5)
            self.closeall()
        else:
            if not 'error' in result:
                pmsg = "Real-Debrid.com"
                if 'username' in result:
                    pmsg += "\nUser:\t%s" % str(result['username'])
                if 'type' in result:
                    pmsg += "\nType:\t%s" % str(result['type'])
                if 'expiration' in result:
                    pmsg += "\nExpires: \t%s" % str(
                        result['expiration']).replace('T', ' ').replace(
                            '.000Z', '')
                url = "https://api.real-debrid.com/rest/1.0/traffic"
                self.agent.getWebPage(url).addCallback(
                    self.getUserTrafficData, pmsg).addErrback(self.noerrorload)
            else:
                if not loop and result['error_code'] == 8:
                    self.getRefreshToken()
                else:
                    self.errorResult(result)

    def getUserTrafficData(self, data, pmsg=None):
        try:
            result = json.loads(data)
        except:
            self.session.open(MessageBoxExt,
                              _("Real-Debrid: Error getting Userdata!"),
                              MessageBoxExt.TYPE_INFO,
                              timeout=3)
            self.closeall()
        else:
            if not 'error' in result:
                pmsg += "\nLimits:"
                for item in result:
                    if 'type' in result[item] and item != 'remote':
                        limittype = str(result[item]['type'])
                        pmsg += "\n%s\t" % str(item)
                        if limittype == 'links':
                            if 'links' in result[item]:
                                pmsg += "Used: %s links" % str(
                                    result[item]['links'])
                            if 'limit' in result[item]:
                                pmsg += "\tLimit: %s links" % str(
                                    result[item]['limit'])
                            if 'reset' in result[item]:
                                pmsg += "/%s" % str(result[item]['reset'])
                        if limittype == 'gigabytes':
                            if 'bytes' in result[item]:
                                pmsg += "Used: %s MB" % str(
                                    result[item]['bytes'] / 1024 / 1024)
                            if 'left' in result[item]:
                                pmsg += " \tLimit: %s GB" % str(
                                    result[item]['left'] / 1024 / 1024 / 1024)
                            if 'reset' in result[item]:
                                pmsg += "/%s" % str(result[item]['reset'])
                self.session.open(MessageBoxExt, pmsg, MessageBoxExt.TYPE_INFO)
                self.closeall()
            else:
                self.session.open(MessageBoxExt,
                                  pmsg,
                                  MessageBoxExt.TYPE_INFO,
                                  timeout=10)
                self.errorResult(result)

    def errorResult(self, result):
        if 'error_code' in result:
            if result['error_code'] == 8:
                self.session.openWithCallback(
                    self.removetokens, MessageBoxExt,
                    _("Real-Debrid: Error %s. Do you want to remove AuthToken and AccessToken?"
                      % str(result['error'])), MessageBoxExt.TYPE_YESNO)
            else:
                self.session.open(
                    MessageBoxExt,
                    _("Real-Debrid: Error %s" % str(result['error'])),
                    MessageBoxExt.TYPE_INFO)
                self.closeall()
        else:
            self.closeall()

    def removetokens(self, answer):
        if answer is True:
            self.session.open(
                MessageBoxExt,
                _("Real-Debrid: AuthToken and AccessToken removed!"),
                MessageBoxExt.TYPE_INFO,
                timeout=5)
            config_mp.mediaportal.realdebrid_accesstoken.value = ''
            config_mp.mediaportal.realdebrid_accesstoken.save()
            self.raccesstoken = ''
            config_mp.mediaportal.realdebrid_refreshtoken.value = ''
            config_mp.mediaportal.realdebrid_refreshtoken.save()
        self.closeall()

    def getLink(self, loop=False):
        if self.raccesstoken:
            url = "https://api.real-debrid.com/rest/1.0/unrestrict/link"
            post = {'link': self.link}
            self.agent.getWebPage(url, method='POST',
                                  postdata=urlencode(post)).addCallback(
                                      self.getLinkData, loop).addErrback(
                                          self.getTokenError,
                                          loop).addErrback(self.noerrorload)
        else:
            url = 'https://api.real-debrid.com/oauth/v2/device/code?client_id=%s&new_credentials=yes' % self.rAPPid
            self.agent.getWebPage(url).addCallback(self.getAuth).addErrback(
                self.codeerror, 'getAuth code error')

    def getAuth(self, data):
        result = json.loads(data)
        self.rdevicecode = str(result['device_code'])
        verification_url = str(result['verification_url'])
        user_code = str(result['user_code'])
        self.session.openWithCallback(
            self.getAuthId,
            MessageBoxExt,
            _("Real-Debrid Authentication:\nTake a Browser and go to %(verification_url)s\nand enter the following code %(user_code)s.\nWhen done, press YES"
              % {
                  'verification_url': verification_url,
                  'user_code': user_code
              }),
            MessageBoxExt.TYPE_YESNO,
            timeout=600)

    def getAuthId(self, answer, loopcount=0):
        if answer is True:
            url = 'https://api.real-debrid.com/oauth/v2/device/credentials?client_id=%s&code=%s' % (
                self.rAPPid, self.rdevicecode)
            self.agent.getWebPage(url).addCallback(
                self.getAuthIdData,
                loopcount).addErrback(self.getAuthIdDataError,
                                      loopcount).addErrback(self.codeerror)
        else:
            self.session.open(MessageBoxExt,
                              _("Real-Debrid: Authentication aborted!"),
                              MessageBoxExt.TYPE_INFO,
                              timeout=3)
            self.closeall()

    def getAuthIdDataError(self, error, loopcount=0):
        loopcount += 1
        self.session.open(MessageBoxExt,
                          _("Real-Debrid: Retry %s/6 to get authentication" %
                            str(loopcount)),
                          MessageBoxExt.TYPE_INFO,
                          timeout=5)
        reactor.callLater(5, self.getAuthId, True, loopcount)
        raise error

    def getAuthIdData(self, data, loopcount=0):
        try:
            result = json.loads(data)
        except:
            result['error']
            self.closeall()
        else:
            if not 'error' in result:
                url = 'https://api.real-debrid.com/oauth/v2/token'
                self.rclient_id = str(result['client_id'])
                self.rclient_secret = str(result['client_secret'])
                config_mp.mediaportal.realdebrid_rclient_id.value = self.rclient_id
                config_mp.mediaportal.realdebrid_rclient_id.save()
                config_mp.mediaportal.realdebrid_rclient_secret.value = self.rclient_secret
                config_mp.mediaportal.realdebrid_rclient_secret.save()
                post = {
                    'client_id': self.rclient_id,
                    'client_secret': self.rclient_secret,
                    'code': self.rdevicecode,
                    'grant_type': 'http://oauth.net/grant_type/device/1.0'
                }
                self.agent.getWebPage(url,
                                      method='POST',
                                      postdata=urlencode(post)).addCallback(
                                          self.getAuthIdDataToken).addErrback(
                                              self.noerrorload
                                          )  #.addErrback(self.rapiaccesstoken)
            else:
                if loopcount < 6:
                    loopcount += 1
                    reactor.callLater(5, self.getAuthIdm, True, loopcount)
                else:
                    self.session.open(MessageBoxExt,
                                      _("Real-Debrid: Error %s" %
                                        str(result['error'])),
                                      MessageBoxExt.TYPE_INFO,
                                      timeout=5)
                    self.closeall()

    def getAuthIdDataToken(self, data):
        try:
            result = json.loads(data)
        except:
            self.session.open(
                MessageBoxExt,
                _("Real-Debrid: Error getting AuthIdDataToken! Please try again."
                  ),
                MessageBoxExt.TYPE_INFO,
                timeout=3)
        else:
            self.raccesstoken = str(result['access_token'])
            self.rrefreshtoken = str(result['refresh_token'])
            config_mp.mediaportal.realdebrid_accesstoken.value = self.raccesstoken
            config_mp.mediaportal.realdebrid_accesstoken.save()
            config_mp.mediaportal.realdebrid_refreshtoken.value = self.rrefreshtoken
            config_mp.mediaportal.realdebrid_refreshtoken.save()
            self.getRealdebrid(True)

    def getLinkData(self, data, loop):
        try:
            result = json.loads(data)
        except:
            self.session.open(MessageBoxExt,
                              _("Real-Debrid: Error getting token!"),
                              MessageBoxExt.TYPE_INFO,
                              timeout=3)
            self.closeall()
        else:
            if not 'error' in result:
                if 'download' in result:
                    downloadlink = str(result['download'])
                else:
                    downloadlink = self.link
                self.closeall(downloadlink)
            else:
                if not loop and result['error_code'] == 8:
                    self.getRefreshToken()
                else:
                    self.errorResult(result)

    def getTokenError(self, error, loop):
        if not loop and error.value.status == '401':
            self.getRefreshToken()
        else:
            if error.value.status == '503':
                self.session.open(
                    MessageBoxExt,
                    _("Real-Debrid: Generation failed (dead link, limit reached, too many downloads, hoster not supported, ip not allowed)."
                      ),
                    MessageBoxExt.TYPE_INFO,
                    timeout=5)
                self.closeall()
            elif error.value.status == '401':
                self.session.open(
                    MessageBoxExt,
                    _("Real-Debrid: Bad token (expired, invalid)."),
                    MessageBoxExt.TYPE_INFO,
                    timeout=5)
                config_mp.mediaportal.realdebrid_accesstoken.value = ''
                config_mp.mediaportal.realdebrid_accesstoken.save()
                self.closeall()
            elif error.value.status == '403':
                self.session.open(
                    MessageBoxExt,
                    _("Real-Debrid: Permission denied (or account locked). Check the account status!"
                      ),
                    MessageBoxExt.TYPE_INFO,
                    timeout=5)
                self.closeall()
            else:
                self.codeerror(error)

    def getRefreshToken(self):
        url = 'https://api.real-debrid.com/oauth/v2/token'
        post = {
            'client_id': self.rclient_id,
            'client_secret': self.rclient_secret,
            'code': self.rrefreshtoken,
            'grant_type': 'http://oauth.net/grant_type/device/1.0'
        }
        self.agent.getWebPage(
            url, method='POST', postdata=urlencode(post)).addCallback(
                self.getRefreshTokenData).addErrback(self.codeerror)

    def getRefreshTokenData(self, data):
        try:
            result = json.loads(data)
        except:
            config_mp.mediaportal.realdebrid_accesstoken.value = ''
            config_mp.mediaportal.realdebrid_accesstoken.save()
            self.codeerror('Realdebrid broken RefreshToken')
        if result.has_key('error_code') and result['error_code'] == 9:
            config_mp.mediaportal.realdebrid_accesstoken.value = ''
            config_mp.mediaportal.realdebrid_accesstoken.save()
            self.codeerror('Realdebrid broken RefreshToken')
        else:
            self.raccesstoken = str(result['access_token'])
            self.rrefreshtoken = str(result['refresh_token'])
            config_mp.mediaportal.realdebrid_accesstoken.value = self.raccesstoken
            config_mp.mediaportal.realdebrid_accesstoken.save()
            config_mp.mediaportal.realdebrid_refreshtoken.value = self.rrefreshtoken
            config_mp.mediaportal.realdebrid_refreshtoken.save()
            self.getRealdebrid(True)

    def closeall(self, downloadlink=None):
        self.close(downloadlink, self.link)

    def noerrorload(self, error):
        printl('[streams]: ' + str(error), '', 'E')

    def codeerror(self, error):
        printl('[streams]: ' + str(error), '', 'E')
        message = self.session.open(
            MessageBoxExt,
            _("Real-Debrid: Broken authentication, please report to the developers."
              ),
            MessageBoxExt.TYPE_INFO,
            timeout=5)
        self.closeall()
Beispiel #27
0
		Link = self['liste'].getCurrent()[0][1]
		self.session.open(youpornFilmScreen, Link, Name)

class youpornFilmScreen(MPScreen, ThumbsHelper):

	def __init__(self, session, Link, Name):
		self.Link = Link
		self.Name = Name
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
		path = "%s/%s/defaultListWideScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListWideScreen.xml"
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)
		ThumbsHelper.__init__(self)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok" : self.keyOK,
			"0" : self.closeAll,
			"cancel" : self.keyCancel,
			"5" : self.keyShowThumb,
			"up" : self.keyUp,
			"down" : self.keyDown,
			"right" : self.keyRight,
			"left" : self.keyLeft,
			"nextBouquet" : self.keyPageUp,
			"prevBouquet" : self.keyPageDown,
			"green" : self.keyPageNumber
		}, -1)

		self['title'] = Label("YouPorn.com")
		self['ContentTitle'] = Label("Genre: %s" % self.Name)
		self['F2'] = Label(_("Page"))

		self['Page'] = Label(_("Page:"))
		self.keyLocked = True
		self.page = 1
		self.lastpage = 1

		self.tw_agent_hlp = TwAgentHelper(redir_agent=True)
		self.tw_agent_hlp.headers.addRawHeader('Cookie','age_verified=1')
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		self.keyLocked = True
		self['name'].setText(_('Please wait...'))
		self.filmliste = []
		url = "%s%s" % (self.Link, str(self.page))
		self.tw_agent_hlp.getWebPage(url).addCallback(self.loadData).addErrback(self.dataError)

	def loadData(self, data):
		self.getLastPage(data, 'id="pagination">(.*?)</nav>')
		parse = re.search('Sub menu dropdown.*?/Sub menu dropdown(.*?)Our Friends', data, re.S)
		if not parse:
			parse = re.search('Sub menu dropdown.*?/Sub menu dropdown(.*?)pagination', data, re.S)
		if parse:
			Movies = re.findall('class="videoBox.*?<a\shref="(.*?)">.*?<img\ssrc=".*?"\salt="(.*?)".*?data-thumbnail="(.*?)".*?class="duration">(.*?)</span>.*?class="rating\sup"><i>(.*?)</i>', parse.group(1), re.S)
			if Movies:
				for (Url, Title, Image, Runtime, Rating) in Movies:
					Url = Url.replace("&amp;","&")
					self.filmliste.append((decodeHtml(Title), Url, Image, Runtime, Rating))
		if len(self.filmliste) == 0:
			self.filmliste.append(('Keine Filme gefunden.', '', None, '', ''))
		self.ml.setList(map(self._defaultlistleft, self.filmliste))
		self.ml.moveToIndex(0)
		self.keyLocked = False
		self.th_ThumbsQuery(self.filmliste, 0, 1, 2, None, None, self.page, self.lastpage, mode=1)
		self.showInfos()

	def showInfos(self):
		title = self['liste'].getCurrent()[0][0]
		pic = self['liste'].getCurrent()[0][2]
		runtime = self['liste'].getCurrent()[0][3]
		rating = self['liste'].getCurrent()[0][4]
		self['name'].setText(title)
		self['handlung'].setText("Runtime: %s\nRating: %s" % (runtime, rating))
		CoverHelper(self['coverArt']).getCover(pic)

	def keyOK(self):
		if self.keyLocked:
			return
		Link = 'http://www.youporn.com' + self['liste'].getCurrent()[0][1]
		self.keyLocked = True
		getPage(Link, headers={'Cookie': 'age_verified=1', 'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.getVideoPage).addErrback(self.dataError)

	def getVideoPage(self, data):
		videoPage = None
		Title = self['liste'].getCurrent()[0][0]
		encrypted_links = re.findall(r'encryptedQuality720URL\s=\s\'([a-zA-Z0-9+/]+={0,2})\',', data)
		for encrypted_link in encrypted_links:
			videoPage = aes_decrypt_text(encrypted_link, Title, 32)
		if videoPage:
			Title = '%s_720p' % Title
		else:
			videoPage = re.findall('videoSrc\s=\s\'(.*?)\',', data, re.S)
			if videoPage:
Beispiel #28
0
    def __init__(self, session, genreLink, genreName):
        self.session = session
        self.genreLink = genreLink
        self.genreName = genreName

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions",
                "ShortcutActions",
                "ColorActions",
                "SetupActions",
                "NumberActions",
                "MenuActions",
                "EPGSelectActions",
                "DirectionActions",
            ],
            {
                "ok": self.keyOK,
                "cancel": self.keyCancel,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "upUp": self.key_repeatedUp,
                "rightUp": self.key_repeatedUp,
                "leftUp": self.key_repeatedUp,
                "downUp": self.key_repeatedUp,
                "upRepeated": self.keyUpRepeated,
                "downRepeated": self.keyDownRepeated,
                "rightRepeated": self.keyRightRepeated,
                "leftRepeated": self.keyLeftRepeated,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "1": self.key_1,
                "3": self.key_3,
                "4": self.key_4,
                "6": self.key_6,
                "7": self.key_7,
                "9": self.key_9,
                "yellow": self.keySort,
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "info": self.keyTMDbInfo,
            },
            -1,
        )

        self.sortOrder = 0
        self.sortParStr = ["", "?orderby=title&order=ASC", "?imdb_rating=desc"]
        self.genreTitle = "Filme in Genre "
        self.sortOrderStr = [" - Sortierung neuste", " - Sortierung A-Z", " - Sortierung IMDb"]
        self.sortOrderStrGenre = ""
        self["title"] = Label(IS_Version)
        self["ContentTitle"] = Label("")
        self["name"] = Label("")
        self["handlung"] = ScrollLabel("")
        self["coverArt"] = Pixmap()
        self["Page"] = Label("Page")
        self["page"] = Label("")
        self["F1"] = Label("Text-")
        self["F2"] = Label("")
        self["F3"] = Label("Sortierung")
        self["F4"] = Label("Text+")

        self.tw_agent_hlp = TwAgentHelper()
        self.timerStart = False
        self.seekTimerRun = False
        self.eventL = threading.Event()
        self.eventH = threading.Event()
        self.eventP = threading.Event()
        self.filmQ = Queue.Queue(0)
        self.hanQ = Queue.Queue(0)
        self.picQ = Queue.Queue(0)
        self.updateP = 0
        self.keyLocked = True
        self.filmListe = []
        self.keckse = {}
        self.page = 0
        self.pages = 0
        self.neueFilme = re.match(".*?Neue Filme", self.genreName)
        self.sucheFilme = re.match(".*?Videosuche", self.genreName)
        self.setGenreStrTitle()

        self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont("mediaportal", 23))
        self.chooseMenuList.l.setItemHeight(25)
        self["liste"] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadPage)
Beispiel #29
0
class youpornFilmScreen(Screen):
    def __init__(self, session, phCatLink):
        self.session = session
        self.phCatLink = phCatLink
        path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/%s/XXXFilmScreen.xml" % config.mediaportal.skin.value
        if not fileExists(path):
            path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/original/XXXFilmScreen.xml"
        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ShortcutActions", "WizardActions",
                "ColorActions", "SetupActions", "NumberActions", "MenuActions",
                "EPGSelectActions"
            ], {
                "ok": self.keyOK,
                "cancel": self.keyCancel,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "green": self.keyPageNumber
            }, -1)

        self['title'] = Label("YouPorn.com")
        self['name'] = Label("Film Auswahl")
        self['views'] = Label("")
        self['runtime'] = Label("")
        self['page'] = Label("")
        self['coverArt'] = Pixmap()
        self.keyLocked = True
        self.page = 1
        self.lastpage = 1

        self.tw_agent_hlp = TwAgentHelper()
        self.tw_agent_hlp.headers.addRawHeader('Cookie', 'age_verified=1')
        self.filmliste = []
        self.chooseMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
        self.chooseMenuList.l.setItemHeight(25)
        self['genreList'] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadpage)

    def loadpage(self):
        self.keyLocked = True
        self['name'].setText('Bitte warten...')
        self.filmliste = []
        url = "%s%s" % (self.phCatLink, str(self.page))
        print url
        #getPage(url, headers={'Cookie': 'age_verified=1', 'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadData).addErrback(self.dataError)
        self.tw_agent_hlp.getWebPage(self.loadData, self.dataError, url, False)

    def loadData(self, data):
        lastpparse = re.search('id="pagination">(.*)</nav>', data, re.S)
        lastp = re.search('<li>.*">(.*?[0-9])<.*/li>', lastpparse.group(1),
                          re.S)
        if lastp:
            lastp = lastp.group(1)
            print lastp
            self.lastpage = int(lastp)
        else:
            self.lastpage = 1
        self['page'].setText(str(self.page) + ' / ' + str(self.lastpage))
        parse = re.search(
            'Sub menu dropdown.*?/Sub menu dropdown(.*?)Our Friends', data,
            re.S)
        if not parse:
            parse = re.search(
                'Sub menu dropdown.*?/Sub menu dropdown(.*?)pagination', data,
                re.S)
        phMovies = re.findall(
            'class="wrapping-video-box">.*?<a\shref="(.*?)">.*?<img\ssrc="(.*?)\?.*?"\salt="(.*?)".*?class="duration">(.*?)<span>length.*?class="views">(.*?)\s<span>views',
            parse.group(1), re.S)
        if phMovies:
            for (phUrl, phImage, phTitle, phRuntime, phViews) in phMovies:
                phUrl = phUrl.replace("&amp;", "&")
                self.filmliste.append(
                    (decodeHtml(phTitle), phUrl, phImage, phRuntime, phViews))
            self.chooseMenuList.setList(
                map(youpornFilmListEntry, self.filmliste))
            self.chooseMenuList.moveToIndex(0)
            self.keyLocked = False
            self.showInfos()

    def dataError(self, error):
        printl(error, self, "E")

    def showInfos(self):
        phTitle = self['genreList'].getCurrent()[0][0]
        phImage = self['genreList'].getCurrent()[0][2]
        phRuntime = self['genreList'].getCurrent()[0][3]
        phViews = self['genreList'].getCurrent()[0][4]
        self['name'].setText(phTitle)
        self['runtime'].setText(phRuntime)
        self['views'].setText(phViews)
        CoverHelper(self['coverArt']).getCover(phImage)

    def keyPageNumber(self):
        self.session.openWithCallback(self.callbackkeyPageNumber,
                                      VirtualKeyBoard,
                                      title=(_("Seitennummer eingeben")),
                                      text=str(self.page))

    def callbackkeyPageNumber(self, answer):
        if answer is not None:
            answer = re.findall('\d+', answer)
        else:
            return
        if answer:
            if int(answer[0]) < self.lastpage + 1:
                self.page = int(answer[0])
                self.loadpage()
            else:
                self.page = self.lastpage
                self.loadpage()

    def keyPageDown(self):
        print "PageDown"
        if self.keyLocked:
            return
        if not self.page < 2:
            self.page -= 1
            self.loadpage()

    def keyPageUp(self):
        print "PageUP"
        if self.keyLocked:
            return
        if self.page < self.lastpage:
            self.page += 1
            self.loadpage()

    def keyLeft(self):
        if self.keyLocked:
            return
        self['genreList'].pageUp()
        self.showInfos()

    def keyRight(self):
        if self.keyLocked:
            return
        self['genreList'].pageDown()
        self.showInfos()

    def keyUp(self):
        if self.keyLocked:
            return
        self['genreList'].up()
        self.showInfos()

    def keyDown(self):
        if self.keyLocked:
            return
        self['genreList'].down()
        self.showInfos()

    def keyOK(self):
        if self.keyLocked:
            return
        phTitle = self['genreList'].getCurrent()[0][0]
        phLink = 'http://www.youporn.com' + self['genreList'].getCurrent(
        )[0][1]
        self.keyLocked = True
        getPage(phLink,
                headers={
                    'Cookie': 'age_verified=1',
                    'Content-Type': 'application/x-www-form-urlencoded'
                }).addCallback(self.getVideoPage).addErrback(self.dataError)

    def getVideoPage(self, data):
        videoPage = re.findall('video.src\s=\s\'(.*?)\';', data, re.S)
        if videoPage:
            for (phurl) in videoPage:
                url = '%s' % (phurl)
                videos = urllib.unquote(url)
                videos = videos.replace('&amp;', '&')
                self.keyLocked = False
                self.play(videos)

    def play(self, file):
        xxxtitle = self['genreList'].getCurrent()[0][0]
        self.session.open(SimplePlayer, [(xxxtitle, file)],
                          showPlaylist=False,
                          ltype='youporn')

    def keyCancel(self):
        self.close()
Beispiel #30
0
class arteSecondScreen(Screen):

	def __init__(self, session, Link, Name):
		self.session = session
		self.Link = Link
		self.Name = Name
		self.plugin_path = mp_globals.pluginPath
		self.skin_path =  mp_globals.pluginPath + "/skins"

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + "/original/defaultListScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		Screen.__init__(self, session)

		self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions", "EPGSelectActions"], {
		"ok"	: self.keyOK,
		"cancel": self.keyCancel,
		"up" : self.keyUp,
		"down" : self.keyDown,
		"right" : self.keyRight,
		"left" : self.keyLeft,
		"nextBouquet" : self.keyPageUp,
		"prevBouquet" : self.keyPageDown
		}, -1)

		self['title'] = Label("Arte Mediathek")
		self['ContentTitle'] = Label("Auswahl: %s" % self.Name)
		self['name'] = Label("")
		self['F1'] = Label("Exit")
		self['F2'] = Label("")
		self['F3'] = Label("")
		self['F4'] = Label("")
		self['F2'].hide()
		self['F3'].hide()
		self['F4'].hide()
		self['coverArt'] = Pixmap()
		self['Page'] = Label("Page: ")
		self['page'] = Label("")
		self['handlung'] = Label("")

		self.keyLocked = True
		self.filmliste = []
		self.tw_agent_hlp = TwAgentHelper()
		self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
		self.chooseMenuList.l.setItemHeight(25)
		self['liste'] = self.chooseMenuList
		self.page = 0
		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		getPage(self.Link, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.parseData).addErrback(self.dataError)

	def parseData(self, data):
		videos = re.findall('<div class="video">.*?<a href="(.*?)"><img alt=.*?" class=.*?" width=.*?" height=.*?" src="(.*?)".*?<p class="teaserText">(.*?)</p>.*?<h2><a href=".*?">(.*?)</a></h2>.*?<p>(.*?)</p>', data, re.S)
		if videos:
			self.filmliste = []
			for (link, image, handlung, title, datum) in videos:
				title = "%s - %s" % (datum ,decodeHtml(title))
				link = "http://videos.arte.tv%s" % link
				image = "http://videos.arte.tv%s" % image
				self.filmliste.append((title, link, image, handlung))
			self.chooseMenuList.setList(map(arteEntry1, self.filmliste))
			self.keyLocked = False
			self.showInfos()

	def dataError(self, error):
		printl(error,self,"E")

	def showInfos(self):
		self.ImageUrl = self['liste'].getCurrent()[0][2]
		handlung = self['liste'].getCurrent()[0][3]
		self['handlung'].setText(decodeHtml(handlung))
		CoverHelper(self['coverArt']).getCover(self.ImageUrl)

	def keyPageDown(self):
		print "PageDown"
		if self.keyLocked:
			return
		if not self.page < 1:
			self.page -= 1
			self.loadPage()

	def keyPageUp(self):
		print "PageUP"
		if self.keyLocked:
			return
		self.page += 1
		self.loadPage()

	def keyLeft(self):
		if self.keyLocked:
			return
		self['liste'].pageUp()
		self.showInfos()

	def keyRight(self):
		if self.keyLocked:
			return
		self['liste'].pageDown()
		self.showInfos()

	def keyUp(self):
		if self.keyLocked:
			return
		self['liste'].up()
		self.showInfos()

	def keyDown(self):
		if self.keyLocked:
			return
		self['liste'].down()
		self.showInfos()

	def keyOK(self):
		if self.keyLocked:
			return

		self.title = self['liste'].getCurrent()[0][0]
		link = self['liste'].getCurrent()[0][1].replace('&amp;','&')

		print self.title, link
		api_url = "http://www.arte.tv/player/v2//index.php?json_url=http://arte.tv/papi/tvguide/videos/stream/player/D/049880-014_PLUS7-D/ALL/ALL.json&lang=de_DE&config=arte_tvguide&rendering_place=" + str(link)
		print api_url
		getPage(api_url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.getDataStream).addErrback(self.dataError)

	def getDataStream(self, data):
		guide_url = '<link rel="alternate" hreflang="de" href="(.*?)" />'
		if guide_url:
			print guide_url
			getPage(guide_url[0], headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.getStream).addErrback(self.dataError)

	def getDataStream(self, data):
		stream_url = re.findall('<meta name="twitter:player:stream" content="(.*?)">', data)
		if stream_url:
			self.tw_agent_hlp.getRedirectedUrl(self.playStream, self.dataError, stream_url[0])

	def playStream(self, url):
		print url
		self.session.open(SimplePlayer, [(self.title, url, self.ImageUrl)], showPlaylist=False, ltype='Arte')

	def keyCancel(self):
		self.close()
Beispiel #31
0
class IStreamFilmListeScreen(Screen):
    def __init__(self, session, genreLink, genreName):
        self.session = session
        self.genreLink = genreLink
        self.genreName = genreName

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path,
                                                config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ShortcutActions", "ColorActions",
                "SetupActions", "NumberActions", "MenuActions",
                "EPGSelectActions", "DirectionActions"
            ], {
                "ok": self.keyOK,
                "cancel": self.keyCancel,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "upUp": self.key_repeatedUp,
                "rightUp": self.key_repeatedUp,
                "leftUp": self.key_repeatedUp,
                "downUp": self.key_repeatedUp,
                "upRepeated": self.keyUpRepeated,
                "downRepeated": self.keyDownRepeated,
                "rightRepeated": self.keyRightRepeated,
                "leftRepeated": self.keyLeftRepeated,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "1": self.key_1,
                "3": self.key_3,
                "4": self.key_4,
                "6": self.key_6,
                "7": self.key_7,
                "9": self.key_9,
                "green": self.keySortAZ,
                "yellow": self.keySortIMDB,
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "info": self.keyTMDbInfo
            }, -1)

        self.sortOrder = 0
        self.sortParIMDB = "?imdb_rating=desc"
        self.sortParAZ = "?orderby=title&order=ASC"
        self.genreTitle = "Filme in Genre "
        self.sortOrderStrAZ = " - Sortierung A-Z"
        self.sortOrderStrIMDB = " - Sortierung IMDb"
        self.sortOrderStrGenre = ""
        self['title'] = Label(IS_Version)
        self['ContentTitle'] = Label("")
        self['name'] = Label("")
        self['handlung'] = ScrollLabel("")
        self['coverArt'] = Pixmap()
        self['Page'] = Label("Page")
        self['page'] = Label("")
        self['F1'] = Label("Text-")
        self['F2'] = Label("SortA-Z")
        self['F3'] = Label("SortIMDb")
        self['F4'] = Label("Text+")

        self.tw_agent_hlp = TwAgentHelper()
        self.timerStart = False
        self.seekTimerRun = False
        self.eventL = threading.Event()
        self.eventH = threading.Event()
        self.eventP = threading.Event()
        self.filmQ = Queue.Queue(0)
        self.hanQ = Queue.Queue(0)
        self.picQ = Queue.Queue(0)
        self.updateP = 0
        self.keyLocked = True
        self.filmListe = []
        self.keckse = {}
        self.page = 0
        self.pages = 0
        self.neueFilme = re.match('.*?Neue Filme', self.genreName)
        self.sucheFilme = re.match('.*?Videosuche', self.genreName)
        self.setGenreStrTitle()

        self.chooseMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
        self.chooseMenuList.l.setItemHeight(25)
        self['liste'] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadPage)

    def setGenreStrTitle(self):
        if not self.neueFilme and not self.sucheFilme:
            if not self.sortOrder:
                self.sortOrderStrGenre = self.sortOrderStrAZ
            else:
                self.sortOrderStrGenre = self.sortOrderStrIMDB
        else:
            self.sortOrderStrGenre = ""
        self['ContentTitle'].setText(
            "%s%s%s" %
            (self.genreTitle, self.genreName, self.sortOrderStrGenre))

    def loadPage(self):
        print "loadPage:"
        if not self.sucheFilme:
            if not self.sortOrder:
                url = "%s%d%s" % (self.genreLink, self.page, self.sortParAZ)
            else:
                url = "%s%d%s" % (self.genreLink, self.page, self.sortParIMDB)
        else:
            url = self.genreLink

        if self.page:
            self['page'].setText("%d / %d" % (self.page, self.pages))

        #if self.seekTimerRun:
        #	return

        self.filmQ.put(url)
        print "eventL ", self.eventL.is_set()
        if not self.eventL.is_set():
            self.eventL.set()
            self.loadPageQueued()
        print "eventL ", self.eventL.is_set()

    def loadPageQueued(self):
        print "loadPageQueued:"
        self['name'].setText('Bitte warten...')
        while not self.filmQ.empty():
            url = self.filmQ.get_nowait()
        #self.eventL.clear()
        print url
        #getPage(url, cookies=self.keckse, agent=std_headers, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadPageData).addErrback(self.dataError)
        self.tw_agent_hlp.getWebPage(self.loadPageData, self.dataError, url,
                                     False)

    def dataError(self, error):
        self.eventL.clear()
        print "dataError:"
        printl(error, self, "E")
        self.filmListe.append(("No movies found !", ""))
        self.chooseMenuList.setList(map(IStreamFilmListEntry, self.filmListe))

    def loadPageData(self, data):
        print "loadPageData:", len(data)

        if not self.neueFilme:
            filme = re.findall(
                '<div class="cover">.*?<a href="(.*?)" rel=.*?title="(.*?)">.*?data-original="(.*?)"',
                data, re.S)
        else:
            print "Parse new movies"
            filme = re.findall(
                '<div class="voting".*?<a href="(.*?)".*?title="(.*?)">.*?data-original="(.*?)"',
                data)

        if filme:
            print "Movies found !"
            if not self.pages:
                m = re.findall('<span class=\'pages\'>Seite 1 von (.*?)</',
                               data)
                if m:
                    self.pages = int(m[0])
                else:
                    self.pages = 1

                self.page = 1
                print "Page: %d / %d" % (self.page, self.pages)
                self['page'].setText("%d / %d" % (self.page, self.pages))

            self.filmListe = []
            for (url, name, imageurl) in filme:
                #print	"Url: ", url, "Name: ", name, "ImgUrl: ", imageurl
                self.filmListe.append((decodeHtml(name), url, imageurl))

            self.chooseMenuList.setList(
                map(IStreamFilmListEntry, self.filmListe))
            self.loadPicQueued()
        else:
            print "No movies found !"
            self.filmListe.append(("No movies found !", ""))
            self.chooseMenuList.setList(
                map(IStreamFilmListEntry, self.filmListe))
            if self.filmQ.empty():
                self.eventL.clear()
            else:
                self.loadPageQueued()

    def loadPicQueued(self):
        print "loadPicQueued:"
        self.picQ.put(None)
        if not self.eventP.is_set():
            self.eventP.set()
            self.loadPic()
        print "eventP: ", self.eventP.is_set()

    def loadPic(self):
        print "loadPic:"

        if self.picQ.empty():
            self.eventP.clear()
            print "picQ is empty"
            return

        if self.eventH.is_set() or self.updateP:
            print "Pict. or descr. update in progress"
            print "eventH: ", self.eventH.is_set()
            print "eventP: ", self.eventP.is_set()
            print "updateP: ", self.updateP
            return

        while not self.picQ.empty():
            self.picQ.get_nowait()

        streamName = self['liste'].getCurrent()[0][0]
        self['name'].setText(streamName)
        streamPic = self['liste'].getCurrent()[0][2]

        streamUrl = self['liste'].getCurrent()[0][1]
        self.getHandlung(streamUrl)
        self.updateP = 1
        if streamPic == None:
            print "ImageUrl is None !"
            self.ShowCoverNone()
        else:
            print "Download pict."
            downloadPage(streamPic, "/tmp/Icon.jpg").addCallback(
                self.ShowCover).addErrback(self.dataErrorP)

    def dataErrorP(self, error):
        print "dataError:"
        printl(error, self, "E")
        self.ShowCoverNone()

    def getHandlung(self, url):
        print "getHandlung:"
        if url == None:
            print "No Infos found !"
            self['handlung'].setText("Keine Infos gefunden.")
            return

        self.hanQ.put(url)
        if not self.eventH.is_set():
            self.eventH.set()
            self.getHandlungQeued()
        print "eventH: ", self.eventH.is_set()

    def getHandlungQeued(self):
        while not self.hanQ.empty():
            url = self.hanQ.get_nowait()
        #print url
        #getPage(url, cookies=self.keckse, agent=std_headers, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.setHandlung).addErrback(self.dataErrorH)
        self.tw_agent_hlp.getWebPage(self.setHandlung, self.dataErrorH, url,
                                     False)

    def dataErrorH(self, error):
        self.eventH.clear()
        print "dataErrorH:"
        printl(error, self, "E")
        self['handlung'].setText("Keine Infos gefunden.")

    def setHandlung(self, data):
        print "setHandlung:"

        m = re.findall('meta property="og:description".*?=\'(.*?)\' />', data)
        if m:
            self['handlung'].setText(decodeHtml(re.sub(r"\s+", " ", m[0])))
        else:
            print "No Infos found !"
            self['handlung'].setText("Keine Infos gefunden.")

        if not self.hanQ.empty():
            self.getHandlungQeued()
        else:
            self.eventH.clear()
            self.loadPic()
        print "eventH: ", self.eventH.is_set()
        print "eventL: ", self.eventL.is_set()

    def ShowCover(self, picData):
        print "ShowCover:"
        picPath = "/tmp/Icon.jpg"
        self.ShowCoverFile(picPath)

    def ShowCoverNone(self):
        print "ShowCoverNone:"
        picPath = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/%s/images/no_coverArt.png" % config.mediaportal.skin.value
        self.ShowCoverFile(picPath)

    def ShowCoverFile(self, picPath):
        if fileExists(picPath):
            self['coverArt'].instance.setPixmap(gPixmapPtr())
            self.scale = AVSwitch().getFramebufferScale()
            self.picload = ePicLoad()
            size = self['coverArt'].instance.size()
            self.picload.setPara((size.width(), size.height(), self.scale[0],
                                  self.scale[1], False, 1, "#FF000000"))
            if self.picload.startDecode(picPath, 0, 0, False) == 0:
                ptr = self.picload.getData()
                if ptr != None:
                    self['coverArt'].instance.setPixmap(ptr)
                    self['coverArt'].show()
                    del self.picload

        self.updateP = 0
        self.keyLocked = False
        if not self.filmQ.empty():
            self.loadPageQueued()
        else:
            self.eventL.clear()
            self.loadPic()

    def keyOK(self):
        if (self.keyLocked | self.eventL.is_set() | self.eventH.is_set()):
            return

        streamLink = self['liste'].getCurrent()[0][1]
        streamName = self['liste'].getCurrent()[0][0]
        imageLink = self['liste'].getCurrent()[0][2]
        self.session.open(IStreamStreams, streamLink, streamName, imageLink)

    def keyUp(self):
        if self.keyLocked:
            return
        self['liste'].up()

    def keyDown(self):
        if self.keyLocked:
            return
        self['liste'].down()

    def keyUpRepeated(self):
        #print "keyUpRepeated"
        if self.keyLocked:
            return
        self['liste'].up()

    def keyDownRepeated(self):
        #print "keyDownRepeated"
        if self.keyLocked:
            return
        self['liste'].down()

    def key_repeatedUp(self):
        #print "key_repeatedUp"
        if self.keyLocked:
            return
        self.loadPicQueued()

    def keyLeft(self):
        if self.keyLocked:
            return
        self['liste'].pageUp()

    def keyRight(self):
        if self.keyLocked:
            return
        self['liste'].pageDown()

    def keyLeftRepeated(self):
        if self.keyLocked:
            return
        self['liste'].pageUp()

    def keyRightRepeated(self):
        if self.keyLocked:
            return
        self['liste'].pageDown()

    def keyPageDown(self):
        #print "keyPageDown()"
        if self.seekTimerRun:
            self.seekTimerRun = False
        self.keyPageDownFast(1)

    def keyPageUp(self):
        #print "keyPageUp()"
        if self.seekTimerRun:
            self.seekTimerRun = False
        self.keyPageUpFast(1)

    def keyPageUpFast(self, step):
        if self.keyLocked:
            return
        #print "keyPageUpFast: ",step
        oldpage = self.page
        if (self.page + step) <= self.pages:
            self.page += step
        else:
            self.page = 1
        #print "Page %d/%d" % (self.page,self.pages)
        if oldpage != self.page:
            self.loadPage()

    def keyPageDownFast(self, step):
        if self.keyLocked:
            return
        print "keyPageDownFast: ", step
        oldpage = self.page
        if (self.page - step) >= 1:
            self.page -= step
        else:
            self.page = self.pages
        #print "Page %d/%d" % (self.page,self.pages)
        if oldpage != self.page:
            self.loadPage()

    #def keyPageDownMan(self):
    #	self.keyPageDownUp = 0;
    #	self.seekTimerRun = True

    #def keyPageUpMan(self):
    #	self.keyPageDownUp = 1;
    #	self.seekTimerRun = True

    #def seekTimer(self):
    #	print "seekTimer:"
    #	if self.seekTimerRun:
    #		if not self.keyPageDownUp:
    #			self.keyPageDown()
    #		else:
    #			self.keyPageUp()

    def key_1(self):
        #print "keyPageDownFast(2)"
        self.keyPageDownFast(2)

    def key_4(self):
        #print "keyPageDownFast(5)"
        self.keyPageDownFast(5)

    def key_7(self):
        #print "keyPageDownFast(10)"
        self.keyPageDownFast(10)

    def key_3(self):
        #print "keyPageUpFast(2)"
        self.keyPageUpFast(2)

    def key_6(self):
        #print "keyPageUpFast(5)"
        self.keyPageUpFast(5)

    def key_9(self):
        #print "keyPageUpFast(10)"
        self.keyPageUpFast(10)

    def keySortAZ(self):
        if (self.keyLocked):
            return
        if self.sortOrder and not self.neueFilme:
            self.sortOrder = 0
            self.setGenreStrTitle()
            self.loadPage()

    def keySortIMDB(self):
        if (self.keyLocked):
            return
        if not (self.sortOrder or self.neueFilme):
            self.sortOrder = 1
            self.setGenreStrTitle()
            self.loadPage()

    # teilweise von movie2k geliehen
    def keyTMDbInfo(self):
        if not self.keyLocked and TMDbPresent:
            title = self['liste'].getCurrent()[0][0]
            self.session.open(TMDbMain, title)
        elif not self.keyLocked and IMDbPresent:
            title = self['liste'].getCurrent()[0][0]
            self.session.open(IMDB, title)

    def keyTxtPageUp(self):
        self['handlung'].pageUp()

    def keyTxtPageDown(self):
        self['handlung'].pageDown()

    def keyCancel(self):
        self.close()
Beispiel #32
0
class streamitStreams(Screen, ConfigListScreen):

	def __init__(self, session, filmUrl, filmName, imageLink):
		self.session = session
		self.filmUrl = filmUrl
		self.filmName = filmName
		self.imageUrl = imageLink

		self.plugin_path = mp_globals.pluginPath
		self.skin_path =  mp_globals.pluginPath + "/skins"

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + "/original/defaultListScreen.xml"

		print path
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		Screen.__init__(self, session)

		self["actions"]  = ActionMap(["OkCancelActions", "ShortcutActions", "EPGSelectActions", "WizardActions", "ColorActions", "NumberActions", "MenuActions", "MoviePlayerActions", "InfobarSeekActions"], {
			"red" 		: self.keyTxtPageUp,
			"blue" 		: self.keyTxtPageDown,
			"green" 	: self.keyTrailer,
			"ok"    	: self.keyOK,
			"info" 		: self.keyTMDbInfo,
			"cancel"	: self.keyCancel
		}, -1)

		self['title'] = Label(IS_Version)
		self['ContentTitle'] = Label("Stream Auswahl")
		self['coverArt'] = Pixmap()
		self['handlung'] = ScrollLabel("")
		self['name'] = Label(filmName)
		self['Page'] = Label("")
		self['page'] = Label("")
		self['F1'] = Label("Text-")
		self['F2'] = Label("")
		self['F3'] = Label("")
		self['F4'] = Label("Text+")

		self.trailerId = None
		self.tw_agent_hlp = TwAgentHelper()
		self.streamListe = []
		self.streamMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.streamMenuList.l.setFont(0, gFont('mediaportal', 24))
		self.streamMenuList.l.setItemHeight(25)
		self['liste'] = self.streamMenuList
		self.keyLocked = True
		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		print "loadPage:"
		streamUrl = self.filmUrl
		#print "FilmUrl: %s" % self.filmUrl
		#print "FilmName: %s" % self.filmName
		self.tw_agent_hlp.getWebPage(self.parseData, self.dataError, streamUrl, False)

	def parseData(self, data):
		print "parseData:"
		m = re.search('<div id="stream">(.*?)</div>',data, re.S)
		if not m:
			m = re.search('<strong><h2>Hoster:</h2></strong>(.*?)</div>',data, re.S)
		if m:
			streams = re.findall('\s\s<a href="(.*?)".*?value="(.*?)"', m.group(1), re.S)
		else:
			streams = None

		m = re.search('href="http://www.youtube.com/(.*?)\?', data)
		if m:
			s = m.group(1).split('/')
			try:
				self.trailerId = m.group(1).split('/')[-1]
			except:
				pass
			else:
				self['F2'].setText('Trailer')

		mdesc = re.search('\s{4}(.*?&hellip;)',data)
		if mdesc:
			print "Descr. found"
			desc = mdesc.group(1).strip()
		else:
			desc = "Keine weiteren Info's !"
		#print desc

		self.streamListe = []
		if streams:
			print "Streams found"
			for (isUrl,isStream) in streams:
				if re.search('(putlocker|sockshare|streamclou|xvidstage|filenuke|movreel|nowvideo|xvidstream|uploadc|vreer|MonsterUploads|Novamov|Videoweed|Divxstage|Ginbig|Flashstrea|Movshare|yesload|faststream|Vidstream|PrimeShare|flashx|Divxmov|Putme|Click.*?Play|BitShare)', isStream, re.S|re.I):
					streamPart = ''
					isUrl = isUrl.replace('\n','')
					isUrl = isUrl.replace('\r','')
					print isUrl
					print isStream,streamPart
					self.streamListe.append((isStream,isUrl,streamPart))
				else:
					print "No supported hoster:"
					print isStream
					print isUrl
		else:
			print "No Streams found"
			self.streamListe.append(("No streams found!","",""))

		self.streamMenuList.setList(map(streamitStreamListEntry, self.streamListe))
		self['handlung'].setText(decodeHtml(desc))
		self.keyLocked = False
		print "imageUrl: ",self.imageUrl
		CoverHelper(self['coverArt']).getCover(self.imageUrl)

	def dataError(self, error):
		print "dataError:"
		printl(error,self,"E")
		self.streamListe.append(("Read error !",""))
		self.streamMenuList.setList(map(streamitStreamListEntry, self.streamListe))

	def got_link(self, stream_url):
		print "got_link:"
		if stream_url == None:
			message = self.session.open(MessageBox, _("Stream not found, try another Stream Hoster."), MessageBox.TYPE_INFO, timeout=3)
		else:
			title = self.filmName + self['liste'].getCurrent()[0][2]
			if config.mediaportal.useHttpDump.value:
				movieinfo = [stream_url,self.filmName,""]
				self.session.open(PlayHttpMovie, movieinfo, title)
			else:
				self.session.open(SimplePlayer, [(title, stream_url, self.imageUrl)], cover=True, showPlaylist=False, ltype='streamit')

	def keyTrailer(self):
		if self.trailerId:
			self.session.open(
				YoutubePlayer,
				[(self.filmName, '', self.trailerId, self.imageUrl)],
				playAll = False,
				showPlaylist=False,
				showCover=True
				)

	def keyTMDbInfo(self):
		if TMDbPresent:
			self.session.open(TMDbMain, self.filmName)
		elif IMDbPresent:
			self.session.open(IMDB, self.filmName)

	def keyOK(self):
		if self.keyLocked:
			return
		streamLink = self['liste'].getCurrent()[0][1]
		self.tw_agent_hlp.getRedirectedUrl(self.keyOK2, self.dataError, streamLink)
		#get_stream_link(self.session).check_link(streamLink, self.got_link)

	def keyOK2(self, streamLink):
		saveads = re.search('.*?saveads.org', streamLink, re.S)
		if saveads:
			id = re.search('url=(.*?)%3D', streamLink, re.S)
			url = "http://streamit.ws/go.php?url=" + id.group(1)
			self.tw_agent_hlp.getRedirectedUrl(self.keyOK3, self.dataError, url)
		else:
			get_stream_link(self.session).check_link(streamLink, self.got_link)

	def keyOK3(self, streamLink):
		get_stream_link(self.session).check_link(streamLink, self.got_link)

	def keyTxtPageUp(self):
		self['handlung'].pageUp()

	def keyTxtPageDown(self):
		self['handlung'].pageDown()

	def keyCancel(self):
		self.close()
Beispiel #33
0
class wsoStreams(MPScreen):

	def __init__(self, session, title, episode, url):
		self.serieUrl = url
		self.Title = title
		self.episode = episode
		MPScreen.__init__(self, session, skin='MP_Plugin', default_cover=default_cover)

		self["actions"] = ActionMap(["MP_Actions"], {
			"0" : self.closeAll,
			"ok" : self.keyOK,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("watchseries-online")
		self['leftContentTitle'] = Label(_("Stream Selection"))
		self['ContentTitle'] = Label(_("Stream Selection"))
		self['name'] = Label(self.Title)

		self.streamList = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml
		self.keyLocked = True
		self.onLayoutFinish.append(self.loadPage)
		self.tw_agent_hlp = TwAgentHelper()

	def loadPage(self):
		twAgentGetPage(self.serieUrl).addCallback(self.parseData).addErrback(self.dataError)

	def parseData(self, data):
		streams = re.findall('<a\starget="_blank"\srel="nofollow"\shref="(.*?)">(.*?)</a>', data, re.S)
		if streams:
			for (url, hoster) in streams:
				if isSupportedHoster(hoster, True):
					self.streamList.append((hoster, url))
		if len(self.streamList) == 0:
			self.streamList.append((_('No supported streams found!'), None))
		self.ml.setList(map(self._defaultlisthoster, self.streamList))
		self.keyLocked = False

	def keyOK(self):
		current = self['liste'].getCurrent()
		if self.keyLocked or current == None:
			return
		url = current[0][1]
		if url:
			if "linkOut?id=" in url:
				import base64
				url = url.split('id=')[-1]
				url = base64.b64decode(url)
				get_stream_link(self.session).check_link(url, self.playfile)
			else:
				self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.getStream).addErrback(self.dataError)

	def getStream(self, url):
		get_stream_link(self.session).check_link(url, self.playfile)

	def playfile(self, stream_url):
		if not re.search('\S[0-9][0-9]E[0-9][0-9]', self.Title, re.I):
			self.streamname = self.Title + " - " + self.episode
		else:
			self.streamname = self.Title
		if not fileExists(config_mp.mediaportal.watchlistpath.value+"mp_wso_watched"):
			open(config_mp.mediaportal.watchlistpath.value+"mp_wso_watched","w").close()
		self.update_list = []
		empty = os.path.getsize(config_mp.mediaportal.watchlistpath.value+"mp_wso_watched")
		if not empty == 0:
			self.updates_read = open(config_mp.mediaportal.watchlistpath.value+"mp_wso_watched" , "r")
			for lines in sorted(self.updates_read.readlines()):
				line = re.findall('"(.*?)"', lines)
				if line:
					self.update_list.append("%s" % (line[0]))
			self.updates_read.close()
			updates_read2 = open(config_mp.mediaportal.watchlistpath.value+"mp_wso_watched" , "a")
			check = ("%s" % self.streamname)
			if not check in self.update_list:
				print "update add: %s" % (self.streamname)
				updates_read2.write('"%s"\n' % (self.streamname))
				updates_read2.close()
			else:
				print "dupe %s" % (self.streamname)
		else:
			updates_read3 = open(config_mp.mediaportal.watchlistpath.value+"mp_wso_watched" , "a")
			print "update add: %s" % (self.streamname)
			updates_read3.write('"%s"\n' % (self.streamname))
			updates_read3.close()
		self.session.open(SimplePlayer, [(self.streamname, stream_url)], showPlaylist=False, ltype='watchseriesonline')
Beispiel #34
0
class gstreaminxxxStreamListeScreen(Screen):
    def __init__(self, session, streamFilmLink, streamName):
        self.session = session
        self.streamFilmLink = streamFilmLink
        self.streamName = streamName

        path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/%s/XXXGenreScreen.xml" % config.mediaportal.skin.value
        if not fileExists(path):
            path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/original/XXXGenreScreen.xml"
        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap([
            "OkCancelActions", "ShortcutActions", "WizardActions",
            "ColorActions", "SetupActions", "NumberActions", "MenuActions",
            "EPGSelectActions"
        ], {
            "ok": self.keyOK,
            "cancel": self.keyCancel
        }, -1)

        self['title'] = Label("G-Stream.in")
        self['name'] = Label('Bitte warten...')
        self['coverArt'] = Pixmap()

        self.tw_agent_hlp = TwAgentHelper()
        self.keyLocked = True
        self.filmliste = []
        self.chooseMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
        self.chooseMenuList.l.setItemHeight(25)
        self['genreList'] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadPage)

    def loadPage(self):
        getPage(self.streamFilmLink,
                agent=special_headers,
                headers={
                    'Cookie':
                    'sitechrx=' + sitechrx + '; overkill_in=' + str(time())
                }).addCallback(self.loadPageData).addErrback(self.dataError)

    def dataError(self, error):
        printl(error, self, "E")

    def loadPageData(self, data):
        print "daten bekommen"
        raw = re.findall('<table\sid="post[0-9]+"(.*?)id="post_thanks_box',
                         data, re.S)
        streams = re.findall(
            '"(http://.*?(g-stream.in\/secure\/.*?\/|flashx|[w]+.putlocker|[w]+.sockshare|.).*?)"',
            raw[0], re.S)
        if streams:
            for (stream, hostername) in streams:
                if re.match(
                        '.*?(putlocker|sockshare|streamclou|xvidstage|filenuke|movreel|nowvideo|xvidstream|uploadc|vreer|MonsterUploads|Novamov|Videoweed|Divxstage|Ginbig|Flashstrea|Movshare|yesload|faststream|Vidstream|PrimeShare|flashx|Divxmov|Putme|Zooupload|Wupfile|BitShare)',
                        hostername.strip(' '), re.S | re.I):
                    print hostername, stream
                    if hostername == 'flashx':
                        hostername = 'Flashx'
                    if hostername == 'www.putlocker':
                        hostername = 'Putlocker'
                    if hostername == 'www.sockshare':
                        hostername = 'Sockshare'
                    hostername = hostername.replace(
                        'g-stream.in/secure/streamcloud.eu/',
                        'Streamcloud (Secure)')
                    hostername = hostername.replace(
                        'g-stream.in/secure/flashx.tv/', 'Flashx (Secure)')
                    hostername = hostername.replace(
                        'g-stream.in/secure/www.putlocker.com/',
                        'Putlocker (Secure)')
                    hostername = hostername.replace(
                        'g-stream.in/secure/www.sockshare.com/',
                        'Sockshare (Secure)')
                    self.filmliste.append((hostername, stream))
        if len(self.filmliste) < 1:
            self.filmliste.append(('Keine Streams gefunden.', None))
        self.filmliste = list(set(self.filmliste))
        self.filmliste.sort()
        self.chooseMenuList.setList(
            map(gstreaminxxxHosterListEntry, self.filmliste))
        self['name'].setText(self.streamName)
        self.keyLocked = False

    def keyOK(self):
        if self.keyLocked:
            return
        streamLink = self['genreList'].getCurrent()[0][1]
        streamHoster = self['genreList'].getCurrent()[0][0]
        if streamLink == None:
            return
        url = streamLink
        url = url.replace('&amp;', '&')
        print 'Hoster: ' + streamHoster
        print 'URL: ' + url
        self['name'].setText('Bitte warten...')
        if streamHoster == 'Flashx':
            print 'Direct Play'
            self.get_stream(url)
        elif streamHoster == 'Putlocker':
            print 'Direct Play'
            self.get_stream(url)
        elif streamHoster == 'Sockshare':
            print 'Direct Play'
            self.get_stream(url)
        else:
            print 'Secured Play'
            self.tw_agent_hlp.getRedirectedUrl(self.get_stream, self.dataError,
                                               streamLink)

    def get_stream(self, url):
        get_stream_link(self.session).check_link(url, self.got_link)

    def got_link(self, stream_url):
        self['name'].setText(self.streamName)
        if stream_url == None:
            message = self.session.open(
                MessageBox,
                _("Stream not found, try another Stream Hoster."),
                MessageBox.TYPE_INFO,
                timeout=3)
        else:
            #fx = re.match('.*?flashx', stream_url)
            fx = None
            if config.mediaportal.useHttpDump.value or fx:
                if fx:
                    movieinfo = [
                        stream_url, self.streamName, "http://play.flashx.tv/"
                    ]
                else:
                    movieinfo = [stream_url, self.streamName, ""]
                self.session.open(PlayHttpMovie, movieinfo, self.streamName)
            else:
                sref = eServiceReference(0x1001, 0, stream_url)
                sref.setName(self.streamName)
                self.session.open(MoviePlayer, sref)

    def keyCancel(self):
        self.close()
Beispiel #35
0
class IStreamStreams(Screen, ConfigListScreen):
	
	def __init__(self, session, filmUrl, filmName, imageLink):
		self.session = session
		self.filmUrl = filmUrl
		self.filmName = filmName
		self.imageUrl = imageLink
		
		self.plugin_path = mp_globals.pluginPath
		self.skin_path =  mp_globals.pluginPath + "/skins"
		
		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + "/original/defaultListScreen.xml"

		print path
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()
			
		Screen.__init__(self, session)

		self["actions"]  = ActionMap(["OkCancelActions", "ShortcutActions", "EPGSelectActions", "WizardActions", "ColorActions", "NumberActions", "MenuActions", "MoviePlayerActions", "InfobarSeekActions"], {
			"red" 		: self.keyTxtPageUp,
			"blue" 		: self.keyTxtPageDown,
			"ok"    	: self.keyOK,
			"cancel"	: self.keyCancel
		}, -1)
		
		self['title'] = Label(IS_Version)
		self['ContentTitle'] = Label("Stream Auswahl")
		self['coverArt'] = Pixmap()
		self['handlung'] = ScrollLabel("")
		self['name'] = Label(filmName)
		self['Page'] = Label("")
		self['page'] = Label("")
		self['F1'] = Label("Text-")
		self['F2'] = Label("")
		self['F3'] = Label("")
		self['F4'] = Label("Text+")
		
		self.tw_agent_hlp = TwAgentHelper()
		self.streamListe = []
		self.streamMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.streamMenuList.l.setFont(0, gFont('mediaportal', 24))
		self.streamMenuList.l.setItemHeight(25)
		self['liste'] = self.streamMenuList
		self.keyLocked = True
		self.onLayoutFinish.append(self.loadPage)
		
	def loadPage(self):
		print "loadPage:"
		streamUrl = self.filmUrl
		#print "FilmUrl: %s" % self.filmUrl
		#print "FilmName: %s" % self.filmName
		#getPage(streamUrl, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.parseData).addErrback(self.dataError)
		self.tw_agent_hlp.getWebPage(self.parseData, self.dataError, streamUrl, False)
		
	def parseData(self, data):
		print "parseData:"
		streams = re.findall('a class="hoster-button.*?href="(.*?)".*?title=".*?\[(.*?)\](.*?)"', data)
		mdesc = re.search('class="desc">(.*?)<br />',data, re.S)
		if mdesc:
			print "Descr. found"
			desc = mdesc.group(1).strip()
		else:
			desc = "Keine weiteren Info's !"
				
		self.streamListe = []
		if streams:
			print "Streams found"
			for (isUrl,isStream,streamPart) in streams:
				if re.match('.*?(putlocker|sockshare|flash strea|streamclou|xvidstage|filenuke|movreel|nowvideo|xvidstream|uploadc|vreer|MonsterUploads|Novamov|Videoweed|Divxstage|Ginbig|Flashstrea|Movshare|yesload|faststream|Vidstream|PrimeShare|flashx|Divxmov|Putme|Zooupload|Click.*?Play|BitShare)', isStream, re.S|re.I):
					#print isUrl
					#print isStream,streamPart
					self.streamListe.append((isStream,isUrl,streamPart))
				else:
					print "No supported hoster:"
					print isStream
					print isUrl
		else:
			print "No Streams found"
			self.streamListe.append(("No streams found !","",""))
			
		self.streamMenuList.setList(map(IStreamStreamListEntry, self.streamListe))
		self['handlung'].setText(decodeHtml(desc))
		self.keyLocked = False			
		print "imageUrl: ",self.imageUrl
		if self.imageUrl:
			downloadPage(self.imageUrl, "/tmp/Icon.jpg").addCallback(self.ShowCover)			
	
	def ShowCover(self, picData):
		print "ShowCover:"
		if fileExists("/tmp/Icon.jpg"):
			self['coverArt'].instance.setPixmap(gPixmapPtr())
			self.scale = AVSwitch().getFramebufferScale()
			self.picload = ePicLoad()
			size = self['coverArt'].instance.size()
			self.picload.setPara((size.width(), size.height(), self.scale[0], self.scale[1], False, 1, "#FF000000"))
			if self.picload.startDecode("/tmp/Icon.jpg", 0, 0, False) == 0:
				ptr = self.picload.getData()
				if ptr != None:
					self['coverArt'].instance.setPixmap(ptr)
					self['coverArt'].show()
					del self.picload

	def dataError(self, error):
		print "dataError:"
		print error
		self.streamListe.append(("Read error !",""))			
		self.streamMenuList.setList(map(IStreamStreamListEntry, self.streamListe))
			
	def got_link(self, stream_url):
		print "got_link:"
		if stream_url == None:
			message = self.session.open(MessageBox, _("Stream not found, try another Stream Hoster."), MessageBox.TYPE_INFO, timeout=3)
		else:
			title = self.filmName + self['liste'].getCurrent()[0][2]
			if config.mediaportal.useHttpDump.value:
				movieinfo = [stream_url,self.filmName,""]
				self.session.open(PlayHttpMovie, movieinfo, title)
			else:
				self.session.open(iStreamPlayer, [(title, stream_url, self.imageUrl)], showCover=True)
				
	def keyOK(self):
		if self.keyLocked:
			return
		streamLink = self['liste'].getCurrent()[0][1]
		self.tw_agent_hlp.getRedirectedUrl(self.keyOK2, self.dataError, streamLink)
	
	def keyOK2(self, streamLink):
		get_stream_link(self.session).check_link(streamLink, self.got_link)
			
	def keyTxtPageUp(self):
		self['handlung'].pageUp()
			
	def keyTxtPageDown(self):
		self['handlung'].pageDown()
			
	def keyCancel(self):
		self.close()
Beispiel #36
0
class gstreaminxxxFilmScreen(MPScreen, ThumbsHelper):

	def __init__(self, session, Link, Name, mode):
		self.mode = mode
		self.Link = Link
		self.Name = Name
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)
		ThumbsHelper.__init__(self)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok" : self.keyOK,
			"0" : self.closeAll,
			"cancel" : self.keyCancel,
			"5" : self.keyShowThumb,
			"up" : self.keyUp,
			"down" : self.keyDown,
			"right" : self.keyRight,
			"left" : self.keyLeft,
			"nextBouquet" : self.keyPageUp,
			"prevBouquet" : self.keyPageDown,
			"green" : self.keyPageNumber
		}, -1)

		self['title'] = Label("GStream.to")
		self['ContentTitle'] = Label(self.Name)
		self['F2'] = Label(_("Page"))

		self['Page'] = Label(_("Page:"))
		self.keyLocked = True
		self.page = 1
		self.lastpage = 1

		self.tw_agent_hlp = TwAgentHelper(redir_agent=True)
		self.urlRedirected = ''
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		self.keyLocked = True
		self['name'].setText(_('Please wait...'))
		self.filmliste = []
		if re.search('Search', self.Name) or self.Name == 'HD Filme':
			if self.urlRedirected =='':
				if self.Name == 'HD Filme':
					baseurl = 'http://gstream.to/search.php?do=process&prefixchoice[]=hd'
				else:
					if re.search('Entire Post', self.Name):
						titleonly = 0
					else:
						titleonly = 1
					if self.mode == "p**n":
						searchType = '661'
					else:
						searchType = '528'
					baseurl = 'http://gstream.to/search.php?do=process&childforums=1&do=process&exactname=1&forumchoice[]=%s&query=%s&s=&securitytoken=guest&titleonly=%s' % (searchType,self.Link,titleonly)
				self.tw_agent_hlp.headers.addRawHeader('Cookie', 'sitechrx='+sitechrx+'; overkill_in='+str(time()))
				self.tw_agent_hlp.headers.addRawHeader('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31')
				self.tw_agent_hlp.headers.addRawHeader('Accept-Charset','ISO-8859-1,utf-8;q=0.7,*;q=0.3')
				self.tw_agent_hlp.headers.addRawHeader('Accept','text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
				self.tw_agent_hlp.headers.addRawHeader('Accept-Language','de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4')
				self.tw_agent_hlp.headers.addRawHeader('Referer','http://gstream.to/')
				self.tw_agent_hlp.getRedirectedUrl(baseurl).addCallback(self.getRedirectedData).addErrback(self.dataError)
			else:
				self.getRedirectedData(self.urlRedirected)
		else:
			if self.mode == "p**n":
				baseurl = 'http://gstream.to/forumdisplay.php?s=&f=661&pp=20&sort=lastpost&order=desc&daysprune=-1&prefixid='
				url = baseurl + "%s&page=%s" % (self.Link, str(self.page))
			else:
				url = 'http://gstream.to/forumdisplay.php?f=%s&pp=20&sort=lastpost&order=desc&page=%s' % (self.Link, str(self.page))
			twAgentGetPage(url, agent=special_headers, followRedirect=False, headers={'Cookie': 'sitechrx='+sitechrx+'; overkill_in='+str(time())}).addCallback(self.loadData).addErrback(self.dataError)

	def getRedirectedData(self, urlRedirected):
		self.urlRedirected = urlRedirected
		url = self.urlRedirected + "&page=%s" % str(self.page)
		twAgentGetPage(url, agent=special_headers, headers={'Cookie': 'sitechrx='+sitechrx+'; overkill_in='+str(time())}).addCallback(self.loadData).addErrback(self.dataError)

	def loadData(self, data):
		self.getLastPage(data, '', 'normal">Seite.*?von\s(.*?)</td>')
		Movies = re.findall('class="p1"\shref="(.*?)".*?class="large"\ssrc="(.*?)".*?thread_title_[0-9]+".*?>(.*?)</a>', data, re.S)
		if Movies:
			for (Url, Image, Title) in Movies:
				if Title != "DE. MILFs brauchen anonymen Sex!":
					Url = Url.replace('&amp;','&')
					Url = 'http://gstream.to/' + Url
					if re.search('images-box.com|rapidimg.org|your-imag.es|pics-traderz.org|imgload.biz|lulzimg.com|shareimage.me|pic.ms', str(Image), re.S):
						Image = None
					self.filmliste.append((decodeHtml(Title), Url, Image))
		if len(self.filmliste) < 1:
			self.filmliste.append(("No streams found!", None,""))
		self.ml.setList(map(self._defaultlistleft, self.filmliste))
		self.ml.moveToIndex(0)
		self.keyLocked = False
		self.th_ThumbsQuery(self.filmliste, 0, 1, 2, None, None, self.page, self.lastpage)
		self.showInfos()

	def showInfos(self):
		title = self['liste'].getCurrent()[0][0]
		pic = self['liste'].getCurrent()[0][2]
		self['name'].setText(title)
		CoverHelper(self['coverArt']).getCover(pic)

	def keyOK(self):
		if self.keyLocked:
			return
		Title = self['liste'].getCurrent()[0][0]
		Link = self['liste'].getCurrent()[0][1]
		Cover = self['liste'].getCurrent()[0][2]
		self.session.open(gstreaminxxxStreamListeScreen, Link, Title, Cover)
Beispiel #37
0
class megaskanksStreamListeScreen(MPScreen):

	def __init__(self, session, streamFilmLink, streamName):
		self.streamFilmLink = streamFilmLink
		self.streamName = streamName
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath
		path = "%s/%s/defaultGenreScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultGenreScreen.xml"
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok" : self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("MegaSkanks.com")
		self['name'] = Label(self.streamName)
		self['ContentTitle'] = Label("Streams:")

		self.tw_agent_hlp = TwAgentHelper(redir_agent=True)
		self.keyLocked = True
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml

		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		getPage(self.streamFilmLink, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadPageData).addErrback(self.dataError)

	def loadPageData(self, data):
		self.filmliste = []
		parse = re.search('PostHeaderIcon.png(.*?)PostMetadataFooter', data, re.S)
		streams = re.findall('(<p>(\w+):\s)?<a\shref="(http.*?//(.*?)/.*?)"', parse.group(1), re.S|re.I)
		if streams:
			for (x, hoster, stream, hostername) in streams:
				stream = stream.split('"')[0].replace("putlocker","firedrive").replace('https', 'http')
				if isSupportedHoster(stream, True):
					self.filmliste.append((hostername, stream))
				if re.match('(.*?\.allanalpass.com|sh.st|linkshrink.net|adfoc.us|adf.ly|www\.amy\.gs)', hostername, re.S|re.I):
					hostername = hostername.replace('www.allanalpass.com', 'Allanalpass redirect')
					hostername = hostername.replace('sh.st', 'Sh redirect %s' % hoster.capitalize())
					hostername = hostername.replace('linkshrink.net', 'Linkshrink redirect')
					hostername = hostername.replace('adfoc.us', 'Adfoc redirect')
					hostername = hostername.replace('adf.ly', 'ADF redirect %s' % hoster.capitalize())
					hostername = hostername.replace('www.amy.gs', 'AMY redirect %s' % hoster.capitalize())
					disc = re.search('.*?(CD1|CD2).*?', stream, re.S|re.I)
					if disc:
						discno = disc.group(1)
						discno = discno.replace('CD1','Teil 1').replace('CD2','Teil 2')
						hostername = hostername + ' (' + discno + ')'
					self.filmliste.append((hostername, stream))
		if len(self.filmliste) == 0:
			self.filmliste.append(("No Hoster found.", ""))
		self.ml.setList(map(self._defaultlisthoster, self.filmliste))
		self['name'].setText(self.streamName)
		self.keyLocked = False

	def keyOK(self):
		if self.keyLocked:
			return
		streamLink = self['liste'].getCurrent()[0][1]
		streamHoster = self['liste'].getCurrent()[0][0]
		if streamLink == None:
			return
		url = streamLink
		self['name'].setText(_('Please wait...'))
		if re.search('redirect', streamHoster):
			self.checkStreamLink(url)
		else:
			self.get_stream(url)

	def checkStreamLink(self, url):
		if re.search('http.*?sh\.st', url): # and allanal sh.st
			getPage(url, agent=spezialagent).addCallback(self.shst, url).addErrback(self.dataError)
		elif re.search('http.*?allanalpass\.com', url): # and allanal sh.st
			getPage(url, agent=spezialagent).addCallback(self.allanal, url).addErrback(self.dataError)
		elif re.search('http.*?linkshrink\.net', url): # and allanal sh.st
			getPage(url, agent=spezialagent).addCallback(self.linkshrink, url).addErrback(self.dataError)
		elif re.search('http.*?adfoc\.us', url): # and allanal sh.st
			getPage(url, headers={'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'}).addCallback(self.adfoc).addErrback(self.dataError)
		elif re.search('http.*?adf\.ly', url):
			getPage(url, agent=spezialagent, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.adfly).addErrback(self.dataError)
		elif re.search('http.*?amy\.gs', url):
			getPage(url, agent=spezialagent).addCallback(self.allanal, url).addErrback(self.dataError)

	def adfly(self, data):
		ysmm = re.search("var\sysmm\s=\s'(.*?)'", data)
		if ysmm:
			ysmm = ysmm.group(1)
			left = ''
			right = ''
			for c in [ysmm[i:i+2] for i in range(0, len(ysmm), 2)]:
				left += c[0]
				right = c[1] + right
			url = base64.b64decode(left.encode() + right.encode())[2:].decode()
			if re.search(r'go\.php\?u\=', url):
				url = base64.b64decode(re.sub(r'(.*?)u=', '', url)).decode()
			self.get_stream(str(url))
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def adfoc(self, data):
		link = re.findall('var\sclick_url\s=\s"(.*?)"', data, re.S)
		if link:
			self.get_stream(link[0])
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def linkshrink(self, data, baseurl):
		link = re.findall('<a\sclass="bt"\shref="(.*?)"', data)
		if link:
			url = link[0]
			user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
			self.tw_agent_hlp.headers.addRawHeader('User-Agent', user_agent)
			self.tw_agent_hlp.headers.addRawHeader('Referer', baseurl)
			self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.linkshrinkLink).addErrback(self.dataError)

	def linkshrinkLink(self, url):
		if url:
			if re.search('(www.allanalpass.com|linkbucks.com|adfoc.us)', url):
				self.checkStreamLink(url)
			else:
				self.get_stream(url)
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def shst(self, data, baseurl):
		session_id = re.findall('sessionId:\s"(.*?)"', data)
		if session_id:
			url = 'http://sh.st/shortest-url/end-adsession?adSessionId=%s' % (session_id[0])
			reactor.callLater(6, self.shstData, url, baseurl)
			message = self.session.open(MessageBoxExt, _("Stream starts in 6 sec."), MessageBoxExt.TYPE_INFO, timeout=6)
		else:
			self.stream_not_found()

	def shstData(self, url, baseurl):
		http_header = {
			"Accept": "*/*",
			"Accept-Encoding": "gzip,deflate",
			"Accept-Language": "en-US,en;,q=0.8",
			"Host": "sh.st",
			"Referer": baseurl,
			"Origin": "http://sh.st",
			"X-Requested-With": "XMLHttpRequest"
		}
		getPage(url, agent=spezialagent, headers=http_header).addCallback(self.shstLink).addErrback(self.dataError)

	def shstLink(self, data):
		VideoUrl = re.findall('destinationUrl":"(.*?)"', data, re.S)
		if VideoUrl:
			url = VideoUrl[0].replace('\/','/')
			if re.search('(www.allanalpass.com|linkbucks.com|adfoc.us)', url):
				self.checkStreamLink(url)
			else:
				self.get_stream(url)
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def allanal(self, data, baseurl):
		Tokens = re.findall("Token:\s'(.*?)',.*?'thKey']\s=\s(.*?);", data, re.S)
		if Tokens:
			addToken = re.findall("\s\s\sparams\['Au' \+ 'th' \+ 'Key'\] = params\['AuthK' \+ 'ey'\] \+ (.*?);", data)
			if addToken:
				Token2 = int(Tokens[-1][1]) + int(addToken[-1])
				if Token2 == int(Tokens[0][1]):
					Token2 = int(Tokens[1][1]) + int(addToken[-1])
				if Token2 == int(Tokens[1][1]):
					Token2 = int(Tokens[1][1]) + int(addToken[-1])
				if Token2 == int(Tokens[0][1]):
					Token2 = int(Tokens[0][1]) + int(addToken[-1])
				rand = random.randrange(10000000,99999999)
				url = "http://www.allanalpass.com/scripts/generated/key.js?t=%s&%s" % (Tokens[-1][0],rand)
				getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.allanalVideoLink2, Tokens[-1][0], Token2).addErrback(self.dataError)
			else:
				message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def allanalVideoLink2(self, data, token1, token2):
		url = "http://www.linkbucksmedia.com/director/?t=%s" % token1
		getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.allanalVideoLink3, token1, token2).addErrback(self.dataError)

	def allanalVideoLink3(self, data, token1, token2):
		url = "http://www.allanalpass.com/intermission/loadTargetUrl?t=%s&aK=%s" % (token1, token2)
		reactor.callLater(6, self.allanalVideoLink4, url)
		message = self.session.open(MessageBoxExt, _("Stream starts in 6 sec."), MessageBoxExt.TYPE_INFO, timeout=6)

	def allanalVideoLink4(self, url):
		getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded','Referer':'http://www.allanalpass.com/ZRv2'}).addCallback(self.allanalVideoLink5).addErrback(self.dataError)

	def allanalVideoLink5(self, data):
		VideoUrl = re.findall('Url":"(.*?)"', data, re.S)
		if VideoUrl:
			url = VideoUrl[0]
			self.get_stream(url)
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def get_stream(self,url):
		self['name'].setText(self.streamName)
		get_stream_link(self.session).check_link(url, self.got_link)

	def got_link(self, stream_url):
		self['name'].setText(self.streamName)
		if stream_url == None:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)
		else:
			self.session.open(SimplePlayer, [(self.streamName, stream_url)], showPlaylist=False, ltype='megaskanks')
Beispiel #38
0
class SubStreamAuswahl(MPScreen):

	def __init__(self, session, Title, Hoster, Data):
		self.Title = Title
		self.Hoster = Hoster
		self.Data = Data
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath

		path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()
		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok"	: self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("alluc.to / Filter: %s" % config.mediaportal.alluc_country.value)
		self['ContentTitle'] = Label("Streamlist %s" %self.Title)

		self.keyLocked = True
		self.tw_agent_hlp = TwAgentHelper()
		self.filmliste = []
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml
		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		streamparts = re.split('collinkname', self.Data )
		for streampart in streamparts[1:]:
			hits = re.findall('class="openlink.*?>(.*?)<.*?openlink.*?href="(.*?)".*?ratingscore.*?>(.*?)<.*?Hits">(.*?)<', streampart, re.S)
			if hits:
				url = "http://dir.alluc.to/%s" % hits[0][1]
				self.filmliste.append((self.Hoster, hits[0][0].strip(), url, hits[0][2].strip(), hits[0][3].strip()))
		if len(self.filmliste) == 0:
			self.filmliste.append((None, _('No supported streams found!'), '', '', ''))
		self.ml.setList(map(self.allucSubHostersEntry, self.filmliste))
		self.keyLocked = False

	def keyOK(self):
		if self.keyLocked:
			return
		url = self['liste'].getCurrent()[0][2]
		self['name'].setText(_("Please wait..."))
		if url == None:
			return

		user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
		self.tw_agent_hlp.headers.addRawHeader('User-Agent', user_agent)
		self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.get_redirect).addErrback(self.dataError)
		self['name'].setText("%s" % self.Title)

	def get_redirect(self, url):
		get_stream_link(self.session).check_link(url, self.got_link)

	def got_link(self, stream_url):
		if stream_url == None:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)
		else:
			self.session.open(SimplePlayer, [(self.Title, stream_url)], showPlaylist=False, ltype='alluc')
Beispiel #39
0
class xpajaFilmScreen(MPScreen, ThumbsHelper):
    def __init__(self, session, Link, Name):
        self.Link = Link
        self.Name = Name
        MPScreen.__init__(self,
                          session,
                          skin='MP_Plugin',
                          default_cover=default_cover)
        ThumbsHelper.__init__(self)

        self["actions"] = ActionMap(
            ["MP_Actions"], {
                "ok": self.keyOK,
                "0": self.closeAll,
                "cancel": self.keyCancel,
                "5": self.keyShowThumb,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "green": self.keyPageNumber
            }, -1)

        self['title'] = Label("xpaja.net")
        self['ContentTitle'] = Label("Genre: %s" % self.Name)
        self['F2'] = Label(_("Page"))

        self['Page'] = Label(_("Page:"))
        self.keyLocked = True
        self.page = 1
        self.lastpage = 1
        self.tw_agent_hlp = TwAgentHelper()

        self.filmliste = []
        self.ml = MenuList([],
                           enableWrapAround=True,
                           content=eListboxPythonMultiContent)
        self['liste'] = self.ml

        self.onLayoutFinish.append(self.loadPage)

    def loadPage(self):
        self.keyLocked = True
        self['name'].setText(_('Please wait...'))
        self.filmliste = []
        if re.match(".*?Search", self.Name):
            url = "https://www.xpaja.net/search/videos/%s/page/%s" % (
                self.Link, str(self.page))
        else:
            url = "%s/page/%s" % (self.Link, str(self.page))
        self.tw_agent_hlp.getWebPage(url).addCallback(
            self.loadData).addErrback(self.dataError)

    def loadData(self, data):
        self.getLastPage(data, 'class="pagination">(.*?)</ul>',
                         '.*[\/|>](\d+)[\"|<]')
        Movies = re.findall(
            'class="preload".*?thumb-post"\ssrc="(.*?)"\salt="(.*?)".*?amount">(.*?)</div.*?href="(.*?)".*?post-inf">(.*?)\sVisi',
            data, re.S)
        if Movies:
            for (Image, Title, Runtime, Url, Views) in Movies:
                Url = "https://www.xpaja.net/" + Url
                Image = "https://www.xpaja.net" + Image
                Views = Views.replace(',', '')
                self.filmliste.append(
                    (decodeHtml(Title), Url, Image, Runtime, Views))
        if len(self.filmliste) == 0:
            self.filmliste.append(
                (_('No movies found!'), None, None, None, None))
        self.ml.setList(map(self._defaultlistleft, self.filmliste))
        self.ml.moveToIndex(0)
        self.keyLocked = False
        self.th_ThumbsQuery(self.filmliste,
                            0,
                            1,
                            2,
                            None,
                            None,
                            self.page,
                            self.lastpage,
                            mode=1)
        self.showInfos()

    def showInfos(self):
        Url = self['liste'].getCurrent()[0][1]
        if Url == None:
            return
        title = self['liste'].getCurrent()[0][0]
        pic = self['liste'].getCurrent()[0][2]
        runtime = self['liste'].getCurrent()[0][3]
        views = self['liste'].getCurrent()[0][4]
        self['name'].setText(title)
        self['handlung'].setText("Runtime: %s\nViews: %s" % (runtime, views))
        CoverHelper(self['coverArt']).getCover(pic)

    def keyOK(self):
        if self.keyLocked:
            return
        Link = self['liste'].getCurrent()[0][1]
        if Link == None:
            return
        self.keyLocked = True
        getPage(Link).addCallback(self.getVideoPage).addErrback(self.dataError)

    def getVideoPage(self, data):
        videoPage = re.findall("<source src=\"(.*?)\" type='video/mp4'", data,
                               re.S)
        if videoPage:
            self.keyLocked = False
            Title = self['liste'].getCurrent()[0][0]
            url = "https://www.xpaja.net/" + videoPage[0]
            self.session.open(SimplePlayer, [(Title, url)],
                              showPlaylist=False,
                              ltype='xpaja')
Beispiel #40
0
class IStreamFilmListeScreen(Screen):
    def __init__(self, session, genreLink, genreName):
        self.session = session
        self.genreLink = genreLink
        self.genreName = genreName

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path,
                                                config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ShortcutActions", "ColorActions",
                "SetupActions", "NumberActions", "MenuActions",
                "EPGSelectActions", "DirectionActions"
            ], {
                "ok": self.keyOK,
                "cancel": self.keyCancel,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "upUp": self.key_repeatedUp,
                "rightUp": self.key_repeatedUp,
                "leftUp": self.key_repeatedUp,
                "downUp": self.key_repeatedUp,
                "upRepeated": self.keyUpRepeated,
                "downRepeated": self.keyDownRepeated,
                "rightRepeated": self.keyRightRepeated,
                "leftRepeated": self.keyLeftRepeated,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "1": self.key_1,
                "3": self.key_3,
                "4": self.key_4,
                "6": self.key_6,
                "7": self.key_7,
                "9": self.key_9,
                "yellow": self.keySort,
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "info": self.keyTMDbInfo
            }, -1)

        self.sortOrder = 0
        self.sortParStr = ["", "?orderby=title&order=ASC", "?imdb_rating=desc"]
        self.genreTitle = "Filme in Genre "
        self.sortOrderStr = [
            " - Sortierung neuste", " - Sortierung A-Z", " - Sortierung IMDb"
        ]
        self.sortOrderStrGenre = ""
        self['title'] = Label(IS_Version)
        self['ContentTitle'] = Label("")
        self['name'] = Label("")
        self['handlung'] = ScrollLabel("")
        self['coverArt'] = Pixmap()
        self['Page'] = Label("Page")
        self['page'] = Label("")
        self['F1'] = Label("Text-")
        self['F2'] = Label("")
        self['F3'] = Label("Sortierung")
        self['F4'] = Label("Text+")

        self.tw_agent_hlp = TwAgentHelper()
        self.timerStart = False
        self.seekTimerRun = False
        self.eventL = threading.Event()
        self.eventH = threading.Event()
        self.eventP = threading.Event()
        self.filmQ = Queue.Queue(0)
        self.hanQ = Queue.Queue(0)
        self.picQ = Queue.Queue(0)
        self.updateP = 0
        self.keyLocked = True
        self.filmListe = []
        self.keckse = {}
        self.page = 0
        self.pages = 0
        self.neueFilme = re.match('.*?Neue Filme', self.genreName)
        self.sucheFilme = re.match('.*?Videosuche', self.genreName)
        self.setGenreStrTitle()

        self.chooseMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
        self.chooseMenuList.l.setItemHeight(25)
        self['liste'] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadPage)

    def setGenreStrTitle(self):
        if not self.neueFilme and not self.sucheFilme:
            self.sortOrderStrGenre = self.sortOrderStr[self.sortOrder]
        else:
            self.sortOrderStrGenre = ""
        self['ContentTitle'].setText(
            "%s%s%s" %
            (self.genreTitle, self.genreName, self.sortOrderStrGenre))

    def loadPage(self):
        print "loadPage:"
        if not self.sucheFilme:
            url = "%s%d%s" % (self.genreLink, self.page,
                              self.sortParStr[self.sortOrder])
        else:
            url = self.genreLink

        if self.page:
            self['page'].setText("%d / %d" % (self.page, self.pages))

        self.filmQ.put(url)
        print "eventL ", self.eventL.is_set()
        if not self.eventL.is_set():
            self.eventL.set()
            self.loadPageQueued()
        else:
            self['name'].setText('Bitte warten...')
            self['handlung'].setText("")
            self['coverArt'].hide()

        print "eventL ", self.eventL.is_set()

    def loadPageQueued(self):
        print "loadPageQueued:"
        self['name'].setText('Bitte warten...')
        self['handlung'].setText("")
        self['coverArt'].hide()

        while not self.filmQ.empty():
            url = self.filmQ.get_nowait()
        print url
        self.tw_agent_hlp.getWebPage(self.loadPageData, self.dataError, url,
                                     False)

    def dataError(self, error):
        self.eventL.clear()
        print "dataError:"
        printl(error, self, "E")
        self.filmListe.append(("No movies found !", ""))
        self.chooseMenuList.setList(map(IStreamFilmListEntry, self.filmListe))

    def loadPageData(self, data):
        print "loadPageData:", len(data)

        self.filmListe = []
        if not self.neueFilme:
            filme = re.findall(
                '<div class="cover">.*?<a href="(.*?)" rel=.*?title="(.*?)">.*?data-original="(.*?)"',
                data, re.S)
        else:
            print "Parse new movies"
            filme = re.findall(
                '<div class="voting".*?<a href="(.*?)".*?title="(.*?)">.*?data-original="(.*?)"',
                data)

        if filme:
            print "Movies found !"
            if not self.pages:
                m = re.findall('<span class=\'pages\'>Seite 1 von (.*?)</',
                               data)
                if m:
                    self.pages = int(m[0])
                else:
                    self.pages = 1

                self.page = 1
                print "Page: %d / %d" % (self.page, self.pages)
                self['page'].setText("%d / %d" % (self.page, self.pages))

            for (url, name, imageurl) in filme:
                #print	"Url: ", url, "Name: ", name, "ImgUrl: ", imageurl
                self.filmListe.append((decodeHtml(name), url, imageurl))

            self.chooseMenuList.setList(
                map(IStreamFilmListEntry, self.filmListe))
            self.keyLocked = False
            self.loadPicQueued()
        else:
            print "No movies found !"
            self.filmListe.append(("No movies found !", ""))
            self.chooseMenuList.setList(
                map(IStreamFilmListEntry, self.filmListe))
            if self.filmQ.empty():
                self.eventL.clear()
            else:
                self.loadPageQueued()

    def loadPicQueued(self):
        print "loadPicQueued:"
        self.picQ.put(None)
        if not self.eventP.is_set():
            self.eventP.set()
            self.loadPic()
        print "eventP: ", self.eventP.is_set()

    def loadPic(self):
        print "loadPic:"

        if self.picQ.empty():
            self.eventP.clear()
            print "picQ is empty"
            return

        if self.eventH.is_set() or self.updateP:
            print "Pict. or descr. update in progress"
            print "eventH: ", self.eventH.is_set()
            print "eventP: ", self.eventP.is_set()
            print "updateP: ", self.updateP
            return

        while not self.picQ.empty():
            self.picQ.get_nowait()

        streamName = self['liste'].getCurrent()[0][0]
        self['name'].setText(streamName)
        streamPic = self['liste'].getCurrent()[0][2]

        streamUrl = self['liste'].getCurrent()[0][1]
        self.getHandlung(streamUrl)
        self.updateP = 1
        CoverHelper(self['coverArt'], self.showCoverExit).getCover(streamPic)

    def dataErrorP(self, error):
        print "dataError:"
        printl(error, self, "E")
        self.ShowCoverNone()

    def getHandlung(self, url):
        print "getHandlung:"
        if url == None:
            print "No Infos found !"
            self['handlung'].setText("Keine Infos gefunden.")
            return

        self.hanQ.put(url)
        if not self.eventH.is_set():
            self.eventH.set()
            self.getHandlungQeued()
        print "eventH: ", self.eventH.is_set()

    def getHandlungQeued(self):
        while not self.hanQ.empty():
            url = self.hanQ.get_nowait()
        #print url
        self.tw_agent_hlp.getWebPage(self.setHandlung, self.dataErrorH, url,
                                     False)

    def dataErrorH(self, error):
        self.eventH.clear()
        print "dataErrorH:"
        printl(error, self, "E")
        self['handlung'].setText("Keine Infos gefunden.")

    def setHandlung(self, data):
        print "setHandlung:"

        m = re.findall('meta property="og:description".*?=\'(.*?)\' />', data)
        if m:
            self['handlung'].setText(decodeHtml(re.sub(r"\s+", " ", m[0])))
        else:
            print "No Infos found !"
            self['handlung'].setText("Keine Infos gefunden.")

        if not self.hanQ.empty():
            self.getHandlungQeued()
        else:
            self.eventH.clear()
            self.loadPic()
        print "eventH: ", self.eventH.is_set()
        print "eventL: ", self.eventL.is_set()

    def showCoverExit(self):
        self.updateP = 0
        if not self.filmQ.empty():
            self.loadPageQueued()
        else:
            self.eventL.clear()
            self.loadPic()

    def keyOK(self):
        if self.keyLocked or self.eventL.is_set():
            return

        streamLink = self['liste'].getCurrent()[0][1]
        streamName = self['liste'].getCurrent()[0][0]
        imageLink = self['liste'].getCurrent()[0][2]
        self.session.open(IStreamStreams, streamLink, streamName, imageLink)

    def keyUp(self):
        if self.keyLocked:
            return
        self['liste'].up()

    def keyDown(self):
        if self.keyLocked:
            return
        self['liste'].down()

    def keyUpRepeated(self):
        #print "keyUpRepeated"
        if self.keyLocked:
            return
        self['coverArt'].hide()
        self['liste'].up()

    def keyDownRepeated(self):
        #print "keyDownRepeated"
        if self.keyLocked:
            return
        self['coverArt'].hide()
        self['liste'].down()

    def key_repeatedUp(self):
        #print "key_repeatedUp"
        if self.keyLocked:
            return
        self.loadPicQueued()

    def keyLeft(self):
        if self.keyLocked:
            return
        self['liste'].pageUp()

    def keyRight(self):
        if self.keyLocked:
            return
        self['liste'].pageDown()

    def keyLeftRepeated(self):
        if self.keyLocked:
            return
        self['coverArt'].hide()
        self['liste'].pageUp()

    def keyRightRepeated(self):
        if self.keyLocked:
            return
        self['coverArt'].hide()
        self['liste'].pageDown()

    def keyPageDown(self):
        #print "keyPageDown()"
        if self.seekTimerRun:
            self.seekTimerRun = False
        self.keyPageDownFast(1)

    def keyPageUp(self):
        #print "keyPageUp()"
        if self.seekTimerRun:
            self.seekTimerRun = False
        self.keyPageUpFast(1)

    def keyPageUpFast(self, step):
        if self.keyLocked:
            return
        #print "keyPageUpFast: ",step
        oldpage = self.page
        if (self.page + step) <= self.pages:
            self.page += step
        else:
            self.page = 1
        #print "Page %d/%d" % (self.page,self.pages)
        if oldpage != self.page:
            self.loadPage()

    def keyPageDownFast(self, step):
        if self.keyLocked:
            return
        print "keyPageDownFast: ", step
        oldpage = self.page
        if (self.page - step) >= 1:
            self.page -= step
        else:
            self.page = self.pages
        #print "Page %d/%d" % (self.page,self.pages)
        if oldpage != self.page:
            self.loadPage()

    def key_1(self):
        #print "keyPageDownFast(2)"
        self.keyPageDownFast(2)

    def key_4(self):
        #print "keyPageDownFast(5)"
        self.keyPageDownFast(5)

    def key_7(self):
        #print "keyPageDownFast(10)"
        self.keyPageDownFast(10)

    def key_3(self):
        #print "keyPageUpFast(2)"
        self.keyPageUpFast(2)

    def key_6(self):
        #print "keyPageUpFast(5)"
        self.keyPageUpFast(5)

    def key_9(self):
        #print "keyPageUpFast(10)"
        self.keyPageUpFast(10)

    def keySort(self):
        if (self.keyLocked):
            return
        if not self.neueFilme:
            if self.sortOrder < 2:
                self.sortOrder += 1
            else:
                self.sortOrder = 0
            self.setGenreStrTitle()
            self.loadPage()

    def keyTMDbInfo(self):
        if not self.keyLocked and TMDbPresent:
            title = self['liste'].getCurrent()[0][0]
            self.session.open(TMDbMain, title)
        elif not self.keyLocked and IMDbPresent:
            title = self['liste'].getCurrent()[0][0]
            self.session.open(IMDB, title)

    def keyTxtPageUp(self):
        self['handlung'].pageUp()

    def keyTxtPageDown(self):
        self['handlung'].pageDown()

    def keyCancel(self):
        self.close()
Beispiel #41
0
		Title = self['liste'].getCurrent()[0][1]
		self.session.open(StreamAuswahl, Link, Title)

class StreamAuswahl(MPScreen):

	def __init__(self, session, Title, Link):
		self.Link = Link
		self.Title = Title
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath

		path = "%s/%s/defaultListWideScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListWideScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok"	: self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label(basename)
		self['ContentTitle'] = Label("%s" %self.Title)

		self.filmliste = []
		self.keyLocked = True
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml
		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		self.keyLocked = True
		url = self.Link
		getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadPageData).addErrback(self.dataError)

	def loadPageData(self, data):
		parse = re.search('class="wordpress-post-tabs(.*?)class="wpts_cr', data, re.S)
		if parse:
			streamsids = re.findall('#tabs-(.*?)".*?(><a href="(http[s]?://(.*?)\/.*?)" target="_blank"|)>((?!<s).*?)<', parse.group(1), re.S)
			if streamsids:
				for (id, x, link, hoster, quality) in streamsids:
					if not link:
						stream = re.findall('id="tabs-'+id+'.*?="(http[s]?://(.*?)\/.*?)"', parse.group(1), re.S)
						if stream:
							if isSupportedHoster(stream[0][1], True):
								hoster = '%s - %s' % (quality, stream[0][1].replace('wtf-is-this.xyz', 'WTFISTHIS redirect'))
								self.filmliste.append((hoster, stream[0][0]))
					else:
						hoster = '%s - %s' % (quality, hoster.replace('wtf-is-this.xyz', 'WTFISTHIS redirect'))
						self.filmliste.append((hoster, link))
		else:
			streamsids = re.findall('center;">.*?<strong>(\w.*?)<.*?<iframe\ssrc="(http[s]?://(.*?)\/.*?)"', data, re.S)
			if streamsids:
				for (quality, link, hoster) in streamsids:
					if isSupportedHoster(hoster, True) or hoster == 'wtf-is-this.xyz':
						hoster = '%s - %s' % (quality, hoster.replace('wtf-is-this.xyz', 'WTFISTHIS redirect'))
						self.filmliste.append((hoster, link))
		if len(self.filmliste) == 0:
			self.filmliste.append((_('No supported streams found!'), None))
		self.ml.setList(map(self._defaultlisthoster, self.filmliste))
		self.keyLocked = False

	def keyOK(self):
		if self.keyLocked:
			return
		streamHoster = self['liste'].getCurrent()[0][0]
		url = self['liste'].getCurrent()[0][1]
		if url == None:
			return
		if re.search('redirect', streamHoster):
			getPage(url).addCallback(self.wtfisthis).addErrback(self.dataError)
		else:
			get_stream_link(self.session).check_link(url, self.got_link)

	def wtfisthis(self, data):
		url = re.search('<a href="(http://wtf-is-this.xyz/\?r=.*?)"', data, re.S)
		if url:
			url = url.group(1)
			self.tw_agent_hlp = TwAgentHelper()
			self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.wtfisthisdata).addErrback(self.dataError)
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def wtfisthisdata(self, data):
		getPage(data, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.adfly).addErrback(self.dataError)

	def adfly(self, data):
		ysmm = re.search("var\sysmm\s=\s'(.*?)'", data)
		if ysmm:
			ysmm = ysmm.group(1)
			left = ''
			right = ''
			for c in [ysmm[i:i+2] for i in range(0, len(ysmm), 2)]:
				left += c[0]
				right = c[1] + right
			url = base64.b64decode(left.encode() + right.encode())[2:].decode()
			if re.search(r'go\.php\?u\=', url):
				url = base64.b64decode(re.sub(r'(.*?)u=', '', url)).decode()
			if re.search('wtf-zone\.xyz', url, re.S):
				self.wtfzone(str(url))
			else:
				get_stream_link(self.session).check_link(str(url), self.got_link)
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def wtfzone(self, url):
		if re.search('wtf-zone\.xyz/embed', url, re.S):
			link = url
		else:
			id = re.search('wtf-zone\.xyz/view/.*?/(.*?)$', url)
			if id:
				link = "http://wtf-zone.xyz/embed/%s" % str(id.group(1))
		getPage(link, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.wtfzonedata).addErrback(self.dataError)

	def wtfzonedata(self, data):
		stream_url = re.search('\'player\'><iframe.*?src="(http.*?)"', data, re.S)
		if stream_url:
			stream_url = stream_url.group(1)
			get_stream_link(self.session).check_link(str(stream_url), self.got_link)
		else:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)

	def got_link(self, stream_url):
		if stream_url == None:
			message = self.session.open(MessageBoxExt, _("Stream not found, try another Stream Hoster."), MessageBoxExt.TYPE_INFO, timeout=3)
Beispiel #42
0
    def __init__(self, session, genreLink, genreName):
        self.session = session
        self.genreLink = genreLink
        self.genreName = genreName

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path,
                                                config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ShortcutActions", "ColorActions",
                "SetupActions", "NumberActions", "MenuActions",
                "EPGSelectActions", "DirectionActions"
            ], {
                "ok": self.keyOK,
                "cancel": self.keyCancel,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "upUp": self.key_repeatedUp,
                "rightUp": self.key_repeatedUp,
                "leftUp": self.key_repeatedUp,
                "downUp": self.key_repeatedUp,
                "upRepeated": self.keyUpRepeated,
                "downRepeated": self.keyDownRepeated,
                "rightRepeated": self.keyRightRepeated,
                "leftRepeated": self.keyLeftRepeated,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "1": self.key_1,
                "3": self.key_3,
                "4": self.key_4,
                "6": self.key_6,
                "7": self.key_7,
                "9": self.key_9,
                "yellow": self.keySort,
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "info": self.keyTMDbInfo
            }, -1)

        self.sortOrder = 0
        self.sortParStr = ["", "?orderby=title&order=ASC", "?imdb_rating=desc"]
        self.genreTitle = "Filme in Genre "
        self.sortOrderStr = [
            " - Sortierung neuste", " - Sortierung A-Z", " - Sortierung IMDb"
        ]
        self.sortOrderStrGenre = ""
        self['title'] = Label(IS_Version)
        self['ContentTitle'] = Label("")
        self['name'] = Label("")
        self['handlung'] = ScrollLabel("")
        self['coverArt'] = Pixmap()
        self['Page'] = Label("Page")
        self['page'] = Label("")
        self['F1'] = Label("Text-")
        self['F2'] = Label("")
        self['F3'] = Label("Sortierung")
        self['F4'] = Label("Text+")

        self.tw_agent_hlp = TwAgentHelper()
        self.timerStart = False
        self.seekTimerRun = False
        self.eventL = threading.Event()
        self.eventH = threading.Event()
        self.eventP = threading.Event()
        self.filmQ = Queue.Queue(0)
        self.hanQ = Queue.Queue(0)
        self.picQ = Queue.Queue(0)
        self.updateP = 0
        self.keyLocked = True
        self.filmListe = []
        self.keckse = {}
        self.page = 0
        self.pages = 0
        self.neueFilme = re.match('.*?Neue Filme', self.genreName)
        self.sucheFilme = re.match('.*?Videosuche', self.genreName)
        self.setGenreStrTitle()

        self.chooseMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
        self.chooseMenuList.l.setItemHeight(25)
        self['liste'] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadPage)
Beispiel #43
0
class gstreaminxxxStreamListeScreen(Screen):

	def __init__(self, session, streamFilmLink, streamName):
		self.session = session
		self.streamFilmLink = streamFilmLink
		self.streamName = streamName

		path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/%s/XXXGenreScreen.xml" % config.mediaportal.skin.value
		if not fileExists(path):
			path = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/skins/original/XXXGenreScreen.xml"
		print path
		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		Screen.__init__(self, session)

		self["actions"]  = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", "NumberActions", "MenuActions", "EPGSelectActions"], {
			"ok"    : self.keyOK,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label("G-Stream.in")
		self['name'] = Label('Bitte warten...')
		self['coverArt'] = Pixmap()

		self.tw_agent_hlp = TwAgentHelper()
		self.keyLocked = True
		self.filmliste = []
		self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self.chooseMenuList.l.setFont(0, gFont('mediaportal', 23))
		self.chooseMenuList.l.setItemHeight(25)
		self['genreList'] = self.chooseMenuList

		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		getPage(self.streamFilmLink, agent=special_headers, headers={'Cookie': 'sitechrx='+sitechrx+'; overkill_in='+str(time())}).addCallback(self.loadPageData).addErrback(self.dataError)

	def dataError(self, error):
		printl(error,self,"E")

	def loadPageData(self, data):
		print "daten bekommen"
		raw = re.findall('<table\sid="post[0-9]+"(.*?)id="post_thanks_box', data, re.S)
		streams = re.findall('"(http://.*?(g-stream.in\/secure\/.*?\/|flashx|[w]+.putlocker|[w]+.sockshare|vidx.to|.).*?)"', raw[0], re.S)
		if streams:
			for (stream, hostername) in streams:
				if re.match('.*?(vidx|putlocker|sockshare|streamclou|xvidstage|filenuke|movreel|nowvideo|xvidstream|uploadc|vreer|MonsterUploads|Novamov|Videoweed|Divxstage|Ginbig|Flashstrea|Movshare|yesload|faststream|Vidstream|PrimeShare|flashx|Divxmov|Putme|BitShare)', hostername.strip(' '), re.S|re.I):
					print hostername, stream
					if hostername == 'flashx':
						hostername = 'Flashx'
					if hostername == 'www.putlocker':
						hostername = 'Putlocker'
					if hostername == 'www.sockshare':
						hostername = 'Sockshare'
					hostername = hostername.replace('g-stream.in/secure/streamcloud.eu/', 'Streamcloud (Secure)')
					hostername = hostername.replace('g-stream.in/secure/flashx.tv/', 'Flashx (Secure)')
					hostername = hostername.replace('g-stream.in/secure/www.putlocker.com/', 'Putlocker (Secure)')
					hostername = hostername.replace('g-stream.in/secure/www.sockshare.com/', 'Sockshare (Secure)')
					self.filmliste.append((hostername, stream))
		if len(self.filmliste) < 1:
			self.filmliste.append(('Keine Streams gefunden.', None))
		self.filmliste = list(set(self.filmliste))
		self.filmliste.sort()
		self.chooseMenuList.setList(map(gstreaminxxxHosterListEntry, self.filmliste))
		self['name'].setText(self.streamName)
		self.keyLocked = False

	def keyOK(self):
		if self.keyLocked:
			return
		streamLink = self['genreList'].getCurrent()[0][1]
		streamHoster = self['genreList'].getCurrent()[0][0]
		if streamLink == None:
			return
		url = streamLink
		url = url.replace('&amp;','&')
		print 'Hoster: ' + streamHoster
		print 'URL: ' + url
		self['name'].setText('Bitte warten...')
		if streamHoster == 'Flashx':
			print 'Direct Play'
			self.get_stream(url)
		elif streamHoster == 'Putlocker':
			print 'Direct Play'
			self.get_stream(url)
		elif streamHoster == 'Sockshare':
			print 'Direct Play'
			self.get_stream(url)
		else:
			print 'Secured Play'
			self.tw_agent_hlp.headers.addRawHeader('Referer','http://g-stream.in')
			self.tw_agent_hlp.getRedirectedUrl(self.get_stream, self.dataError, streamLink)

	def get_stream(self,url):
		get_stream_link(self.session).check_link(url, self.got_link)

	def got_link(self, stream_url):
		self['name'].setText(self.streamName)
		if stream_url == None:
			message = self.session.open(MessageBox, _("Stream not found, try another Stream Hoster."), MessageBox.TYPE_INFO, timeout=3)
		else:
			#fx = re.match('.*?flashx', stream_url)
			fx = None
			if config.mediaportal.useHttpDump.value or fx:
				if fx:
					movieinfo = [stream_url,self.streamName,"http://play.flashx.tv/"]
				else:
					movieinfo = [stream_url,self.streamName,""]
				self.session.open(PlayHttpMovie, movieinfo, self.streamName)
			else:
				self.session.open(SimplePlayer, [(self.streamName, stream_url)], showPlaylist=False, ltype='gstreaminxxx')

	def keyCancel(self):
		self.close()
Beispiel #44
0
class IStreamStreams(Screen, ConfigListScreen):
    def __init__(self, session, filmUrl, filmName, imageLink):
        self.session = session
        self.filmUrl = filmUrl
        self.filmName = filmName
        self.imageUrl = imageLink

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path,
                                                config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions", "ShortcutActions", "EPGSelectActions",
                "WizardActions", "ColorActions", "NumberActions",
                "MenuActions", "MoviePlayerActions", "InfobarSeekActions"
            ], {
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "ok": self.keyOK,
                "info": self.keyTMDbInfo,
                "cancel": self.keyCancel
            }, -1)

        self['title'] = Label(IS_Version)
        self['ContentTitle'] = Label("Stream Auswahl")
        self['coverArt'] = Pixmap()
        self['handlung'] = ScrollLabel("")
        self['name'] = Label(filmName)
        self['Page'] = Label("")
        self['page'] = Label("")
        self['F1'] = Label("Text-")
        self['F2'] = Label("")
        self['F3'] = Label("")
        self['F4'] = Label("Text+")

        self.tw_agent_hlp = TwAgentHelper()
        self.streamListe = []
        self.streamMenuList = MenuList([],
                                       enableWrapAround=True,
                                       content=eListboxPythonMultiContent)
        self.streamMenuList.l.setFont(0, gFont('mediaportal', 24))
        self.streamMenuList.l.setItemHeight(25)
        self['liste'] = self.streamMenuList
        self.keyLocked = True
        self.onLayoutFinish.append(self.loadPage)

    def loadPage(self):
        print "loadPage:"
        streamUrl = self.filmUrl
        #print "FilmUrl: %s" % self.filmUrl
        #print "FilmName: %s" % self.filmName
        self.tw_agent_hlp.getWebPage(self.parseData, self.dataError, streamUrl,
                                     False)

    def parseData(self, data):
        print "parseData:"
        streams = re.findall(
            'a class="hoster-button.*?href="(.*?)".*?title=".*?\[(.*?)\](.*?)"',
            data)
        mdesc = re.search('class="desc">(.*?)<br />', data, re.S)
        if mdesc:
            print "Descr. found"
            desc = mdesc.group(1).strip()
        else:
            desc = "Keine weiteren Info's !"

        self.streamListe = []
        if streams:
            print "Streams found"
            for (isUrl, isStream, streamPart) in streams:
                if re.match(
                        '.*?(putlocker|sockshare|streamclou|xvidstage|filenuke|movreel|nowvideo|xvidstream|uploadc|vreer|MonsterUploads|Novamov|Videoweed|Divxstage|Ginbig|Flashstrea|Movshare|yesload|faststream|Vidstream|PrimeShare|flashx|Divxmov|Putme|Click.*?Play|BitShare)',
                        isStream, re.S | re.I):
                    #print isUrl
                    #print isStream,streamPart
                    self.streamListe.append((isStream, isUrl, streamPart))
                else:
                    print "No supported hoster:"
                    print isStream
                    print isUrl
        else:
            print "No Streams found"
            self.streamListe.append(("No streams found!", "", ""))

        self.streamMenuList.setList(
            map(IStreamStreamListEntry, self.streamListe))
        self['handlung'].setText(decodeHtml(desc))
        self.keyLocked = False
        print "imageUrl: ", self.imageUrl
        CoverHelper(self['coverArt']).getCover(self.imageUrl)

    def dataError(self, error):
        print "dataError:"
        printl(error, self, "E")
        self.streamListe.append(("Read error !", ""))
        self.streamMenuList.setList(
            map(IStreamStreamListEntry, self.streamListe))

    def got_link(self, stream_url):
        print "got_link:"
        if stream_url == None:
            message = self.session.open(
                MessageBox,
                _("Stream not found, try another Stream Hoster."),
                MessageBox.TYPE_INFO,
                timeout=3)
        else:
            title = self.filmName + self['liste'].getCurrent()[0][2]
            if config.mediaportal.useHttpDump.value:
                movieinfo = [stream_url, self.filmName, ""]
                self.session.open(PlayHttpMovie, movieinfo, title)
            else:
                self.session.open(SimplePlayer,
                                  [(title, stream_url, self.imageUrl)],
                                  cover=True,
                                  showPlaylist=False,
                                  ltype='istream.ws')

    def keyTMDbInfo(self):
        if TMDbPresent:
            self.session.open(TMDbMain, self.filmName)
        elif IMDbPresent:
            self.session.open(IMDB, self.filmName)

    def keyOK(self):
        if self.keyLocked:
            return
        streamLink = self['liste'].getCurrent()[0][1]
        self.tw_agent_hlp.getRedirectedUrl(self.keyOK2, self.dataError,
                                           streamLink)

    def keyOK2(self, streamLink):
        saveads = re.search('.*?saveads.org', streamLink, re.S)
        if saveads:
            id = re.search('url=(.*?)%3D', streamLink, re.S)
            url = "http://istream.ws/go.php?url=" + id.group(1)
            self.tw_agent_hlp.getRedirectedUrl(self.keyOK3, self.dataError,
                                               url)
        else:
            get_stream_link(self.session).check_link(streamLink, self.got_link)

    def keyOK3(self, streamLink):
        get_stream_link(self.session).check_link(streamLink, self.got_link)

    def keyTxtPageUp(self):
        self['handlung'].pageUp()

    def keyTxtPageDown(self):
        self['handlung'].pageDown()

    def keyCancel(self):
        self.close()
Beispiel #45
0
class IStreamFilmListeScreen(Screen):
    def __init__(self, session, genreLink, genreName):
        self.session = session
        self.genreLink = genreLink
        self.genreName = genreName

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions",
                "ShortcutActions",
                "ColorActions",
                "SetupActions",
                "NumberActions",
                "MenuActions",
                "EPGSelectActions",
                "DirectionActions",
            ],
            {
                "ok": self.keyOK,
                "cancel": self.keyCancel,
                "up": self.keyUp,
                "down": self.keyDown,
                "right": self.keyRight,
                "left": self.keyLeft,
                "upUp": self.key_repeatedUp,
                "rightUp": self.key_repeatedUp,
                "leftUp": self.key_repeatedUp,
                "downUp": self.key_repeatedUp,
                "upRepeated": self.keyUpRepeated,
                "downRepeated": self.keyDownRepeated,
                "rightRepeated": self.keyRightRepeated,
                "leftRepeated": self.keyLeftRepeated,
                "nextBouquet": self.keyPageUp,
                "prevBouquet": self.keyPageDown,
                "1": self.key_1,
                "3": self.key_3,
                "4": self.key_4,
                "6": self.key_6,
                "7": self.key_7,
                "9": self.key_9,
                "yellow": self.keySort,
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "info": self.keyTMDbInfo,
            },
            -1,
        )

        self.sortOrder = 0
        self.sortParStr = ["", "?orderby=title&order=ASC", "?imdb_rating=desc"]
        self.genreTitle = "Filme in Genre "
        self.sortOrderStr = [" - Sortierung neuste", " - Sortierung A-Z", " - Sortierung IMDb"]
        self.sortOrderStrGenre = ""
        self["title"] = Label(IS_Version)
        self["ContentTitle"] = Label("")
        self["name"] = Label("")
        self["handlung"] = ScrollLabel("")
        self["coverArt"] = Pixmap()
        self["Page"] = Label("Page")
        self["page"] = Label("")
        self["F1"] = Label("Text-")
        self["F2"] = Label("")
        self["F3"] = Label("Sortierung")
        self["F4"] = Label("Text+")

        self.tw_agent_hlp = TwAgentHelper()
        self.timerStart = False
        self.seekTimerRun = False
        self.eventL = threading.Event()
        self.eventH = threading.Event()
        self.eventP = threading.Event()
        self.filmQ = Queue.Queue(0)
        self.hanQ = Queue.Queue(0)
        self.picQ = Queue.Queue(0)
        self.updateP = 0
        self.keyLocked = True
        self.filmListe = []
        self.keckse = {}
        self.page = 0
        self.pages = 0
        self.neueFilme = re.match(".*?Neue Filme", self.genreName)
        self.sucheFilme = re.match(".*?Videosuche", self.genreName)
        self.setGenreStrTitle()

        self.chooseMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
        self.chooseMenuList.l.setFont(0, gFont("mediaportal", 23))
        self.chooseMenuList.l.setItemHeight(25)
        self["liste"] = self.chooseMenuList

        self.onLayoutFinish.append(self.loadPage)

    def setGenreStrTitle(self):
        if not self.neueFilme and not self.sucheFilme:
            self.sortOrderStrGenre = self.sortOrderStr[self.sortOrder]
        else:
            self.sortOrderStrGenre = ""
        self["ContentTitle"].setText("%s%s%s" % (self.genreTitle, self.genreName, self.sortOrderStrGenre))

    def loadPage(self):
        print "loadPage:"
        if not self.sucheFilme:
            url = "%s%d%s" % (self.genreLink, self.page, self.sortParStr[self.sortOrder])
        else:
            url = self.genreLink

        if self.page:
            self["page"].setText("%d / %d" % (self.page, self.pages))

        self.filmQ.put(url)
        print "eventL ", self.eventL.is_set()
        if not self.eventL.is_set():
            self.eventL.set()
            self.loadPageQueued()
        else:
            self["name"].setText("Bitte warten...")
            self["handlung"].setText("")
            self["coverArt"].hide()

        print "eventL ", self.eventL.is_set()

    def loadPageQueued(self):
        print "loadPageQueued:"
        self["name"].setText("Bitte warten...")
        self["handlung"].setText("")
        self["coverArt"].hide()

        while not self.filmQ.empty():
            url = self.filmQ.get_nowait()
        print url
        self.tw_agent_hlp.getWebPage(self.loadPageData, self.dataError, url, False)

    def dataError(self, error):
        self.eventL.clear()
        print "dataError:"
        printl(error, self, "E")
        self.filmListe.append(("No movies found !", ""))
        self.chooseMenuList.setList(map(IStreamFilmListEntry, self.filmListe))

    def loadPageData(self, data):
        print "loadPageData:", len(data)

        self.filmListe = []
        if not self.neueFilme:
            filme = re.findall(
                '<div class="cover">.*?<a href="(.*?)" rel=.*?title="(.*?)">.*?data-original="(.*?)"', data, re.S
            )
        else:
            print "Parse new movies"
            filme = re.findall('<div class="voting".*?<a href="(.*?)".*?title="(.*?)">.*?data-original="(.*?)"', data)

        if filme:
            print "Movies found !"
            if not self.pages:
                m = re.findall("<span class='pages'>Seite 1 von (.*?)</", data)
                if m:
                    self.pages = int(m[0])
                else:
                    self.pages = 1

                self.page = 1
                print "Page: %d / %d" % (self.page, self.pages)
                self["page"].setText("%d / %d" % (self.page, self.pages))

            for (url, name, imageurl) in filme:
                # print	"Url: ", url, "Name: ", name, "ImgUrl: ", imageurl
                self.filmListe.append((decodeHtml(name), url, imageurl))

            self.chooseMenuList.setList(map(IStreamFilmListEntry, self.filmListe))
            self.keyLocked = False
            self.loadPicQueued()
        else:
            print "No movies found !"
            self.filmListe.append(("No movies found !", ""))
            self.chooseMenuList.setList(map(IStreamFilmListEntry, self.filmListe))
            if self.filmQ.empty():
                self.eventL.clear()
            else:
                self.loadPageQueued()

    def loadPicQueued(self):
        print "loadPicQueued:"
        self.picQ.put(None)
        if not self.eventP.is_set():
            self.eventP.set()
            self.loadPic()
        print "eventP: ", self.eventP.is_set()

    def loadPic(self):
        print "loadPic:"

        if self.picQ.empty():
            self.eventP.clear()
            print "picQ is empty"
            return

        if self.eventH.is_set() or self.updateP:
            print "Pict. or descr. update in progress"
            print "eventH: ", self.eventH.is_set()
            print "eventP: ", self.eventP.is_set()
            print "updateP: ", self.updateP
            return

        while not self.picQ.empty():
            self.picQ.get_nowait()

        streamName = self["liste"].getCurrent()[0][0]
        self["name"].setText(streamName)
        streamPic = self["liste"].getCurrent()[0][2]

        streamUrl = self["liste"].getCurrent()[0][1]
        self.getHandlung(streamUrl)
        self.updateP = 1
        CoverHelper(self["coverArt"], self.showCoverExit).getCover(streamPic)

    def dataErrorP(self, error):
        print "dataError:"
        printl(error, self, "E")
        self.ShowCoverNone()

    def getHandlung(self, url):
        print "getHandlung:"
        if url == None:
            print "No Infos found !"
            self["handlung"].setText("Keine Infos gefunden.")
            return

        self.hanQ.put(url)
        if not self.eventH.is_set():
            self.eventH.set()
            self.getHandlungQeued()
        print "eventH: ", self.eventH.is_set()

    def getHandlungQeued(self):
        while not self.hanQ.empty():
            url = self.hanQ.get_nowait()
            # print url
        self.tw_agent_hlp.getWebPage(self.setHandlung, self.dataErrorH, url, False)

    def dataErrorH(self, error):
        self.eventH.clear()
        print "dataErrorH:"
        printl(error, self, "E")
        self["handlung"].setText("Keine Infos gefunden.")

    def setHandlung(self, data):
        print "setHandlung:"

        m = re.findall("meta property=\"og:description\".*?='(.*?)' />", data)
        if m:
            self["handlung"].setText(decodeHtml(re.sub(r"\s+", " ", m[0])))
        else:
            print "No Infos found !"
            self["handlung"].setText("Keine Infos gefunden.")

        if not self.hanQ.empty():
            self.getHandlungQeued()
        else:
            self.eventH.clear()
            self.loadPic()
        print "eventH: ", self.eventH.is_set()
        print "eventL: ", self.eventL.is_set()

    def showCoverExit(self):
        self.updateP = 0
        if not self.filmQ.empty():
            self.loadPageQueued()
        else:
            self.eventL.clear()
            self.loadPic()

    def keyOK(self):
        if self.keyLocked or self.eventL.is_set():
            return

        streamLink = self["liste"].getCurrent()[0][1]
        streamName = self["liste"].getCurrent()[0][0]
        imageLink = self["liste"].getCurrent()[0][2]
        self.session.open(IStreamStreams, streamLink, streamName, imageLink)

    def keyUp(self):
        if self.keyLocked:
            return
        self["liste"].up()

    def keyDown(self):
        if self.keyLocked:
            return
        self["liste"].down()

    def keyUpRepeated(self):
        # print "keyUpRepeated"
        if self.keyLocked:
            return
        self["coverArt"].hide()
        self["liste"].up()

    def keyDownRepeated(self):
        # print "keyDownRepeated"
        if self.keyLocked:
            return
        self["coverArt"].hide()
        self["liste"].down()

    def key_repeatedUp(self):
        # print "key_repeatedUp"
        if self.keyLocked:
            return
        self.loadPicQueued()

    def keyLeft(self):
        if self.keyLocked:
            return
        self["liste"].pageUp()

    def keyRight(self):
        if self.keyLocked:
            return
        self["liste"].pageDown()

    def keyLeftRepeated(self):
        if self.keyLocked:
            return
        self["coverArt"].hide()
        self["liste"].pageUp()

    def keyRightRepeated(self):
        if self.keyLocked:
            return
        self["coverArt"].hide()
        self["liste"].pageDown()

    def keyPageDown(self):
        # print "keyPageDown()"
        if self.seekTimerRun:
            self.seekTimerRun = False
        self.keyPageDownFast(1)

    def keyPageUp(self):
        # print "keyPageUp()"
        if self.seekTimerRun:
            self.seekTimerRun = False
        self.keyPageUpFast(1)

    def keyPageUpFast(self, step):
        if self.keyLocked:
            return
            # print "keyPageUpFast: ",step
        oldpage = self.page
        if (self.page + step) <= self.pages:
            self.page += step
        else:
            self.page = 1
            # print "Page %d/%d" % (self.page,self.pages)
        if oldpage != self.page:
            self.loadPage()

    def keyPageDownFast(self, step):
        if self.keyLocked:
            return
        print "keyPageDownFast: ", step
        oldpage = self.page
        if (self.page - step) >= 1:
            self.page -= step
        else:
            self.page = self.pages
            # print "Page %d/%d" % (self.page,self.pages)
        if oldpage != self.page:
            self.loadPage()

    def key_1(self):
        # print "keyPageDownFast(2)"
        self.keyPageDownFast(2)

    def key_4(self):
        # print "keyPageDownFast(5)"
        self.keyPageDownFast(5)

    def key_7(self):
        # print "keyPageDownFast(10)"
        self.keyPageDownFast(10)

    def key_3(self):
        # print "keyPageUpFast(2)"
        self.keyPageUpFast(2)

    def key_6(self):
        # print "keyPageUpFast(5)"
        self.keyPageUpFast(5)

    def key_9(self):
        # print "keyPageUpFast(10)"
        self.keyPageUpFast(10)

    def keySort(self):
        if self.keyLocked:
            return
        if not self.neueFilme:
            if self.sortOrder < 2:
                self.sortOrder += 1
            else:
                self.sortOrder = 0
            self.setGenreStrTitle()
            self.loadPage()

    def keyTMDbInfo(self):
        if not self.keyLocked and TMDbPresent:
            title = self["liste"].getCurrent()[0][0]
            self.session.open(TMDbMain, title)
        elif not self.keyLocked and IMDbPresent:
            title = self["liste"].getCurrent()[0][0]
            self.session.open(IMDB, title)

    def keyTxtPageUp(self):
        self["handlung"].pageUp()

    def keyTxtPageDown(self):
        self["handlung"].pageDown()

    def keyCancel(self):
        self.close()
Beispiel #46
0
	def __init__(self, session, host, hash, playList, playIdx, listTitle,cover):
		SimplePlayer.__init__(self, session, playList, playIdx=playIdx, playAll=True, listTitle=listTitle, ltype='myfreemp3', autoScrSaver=True, cover=cover, playerMode='MP3', googleCoverSupp=True, embeddedCoverArt=True)
		self.mfmp3_playIdx = 0
		self._host = host
		self._hash = hash
		self.tw_agent_hlp = TwAgentHelper(followRedirect=True)
Beispiel #47
0
class IStreamStreams(Screen, ConfigListScreen):
    def __init__(self, session, filmUrl, filmName, imageLink):
        self.session = session
        self.filmUrl = filmUrl
        self.filmName = filmName
        self.imageUrl = imageLink

        self.plugin_path = mp_globals.pluginPath
        self.skin_path = mp_globals.pluginPath + "/skins"

        path = "%s/%s/defaultListScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
        if not fileExists(path):
            path = self.skin_path + "/original/defaultListScreen.xml"

        print path
        with open(path, "r") as f:
            self.skin = f.read()
            f.close()

        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            [
                "OkCancelActions",
                "ShortcutActions",
                "EPGSelectActions",
                "WizardActions",
                "ColorActions",
                "NumberActions",
                "MenuActions",
                "MoviePlayerActions",
                "InfobarSeekActions",
            ],
            {
                "red": self.keyTxtPageUp,
                "blue": self.keyTxtPageDown,
                "ok": self.keyOK,
                "info": self.keyTMDbInfo,
                "cancel": self.keyCancel,
            },
            -1,
        )

        self["title"] = Label(IS_Version)
        self["ContentTitle"] = Label("Stream Auswahl")
        self["coverArt"] = Pixmap()
        self["handlung"] = ScrollLabel("")
        self["name"] = Label(filmName)
        self["Page"] = Label("")
        self["page"] = Label("")
        self["F1"] = Label("Text-")
        self["F2"] = Label("")
        self["F3"] = Label("")
        self["F4"] = Label("Text+")

        self.tw_agent_hlp = TwAgentHelper()
        self.streamListe = []
        self.streamMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
        self.streamMenuList.l.setFont(0, gFont("mediaportal", 24))
        self.streamMenuList.l.setItemHeight(25)
        self["liste"] = self.streamMenuList
        self.keyLocked = True
        self.onLayoutFinish.append(self.loadPage)

    def loadPage(self):
        print "loadPage:"
        streamUrl = self.filmUrl
        # print "FilmUrl: %s" % self.filmUrl
        # print "FilmName: %s" % self.filmName
        self.tw_agent_hlp.getWebPage(self.parseData, self.dataError, streamUrl, False)

    def parseData(self, data):
        print "parseData:"
        streams = re.findall('a class="hoster-button.*?href="(.*?)".*?title=".*?\[(.*?)\](.*?)"', data)
        mdesc = re.search('class="desc">(.*?)<br />', data, re.S)
        if mdesc:
            print "Descr. found"
            desc = mdesc.group(1).strip()
        else:
            desc = "Keine weiteren Info's !"

        self.streamListe = []
        if streams:
            print "Streams found"
            for (isUrl, isStream, streamPart) in streams:
                if re.match(
                    ".*?(putlocker|sockshare|streamclou|xvidstage|filenuke|movreel|nowvideo|xvidstream|uploadc|vreer|MonsterUploads|Novamov|Videoweed|Divxstage|Ginbig|Flashstrea|Movshare|yesload|faststream|Vidstream|PrimeShare|flashx|Divxmov|Putme|Click.*?Play|BitShare)",
                    isStream,
                    re.S | re.I,
                ):
                    # print isUrl
                    # print isStream,streamPart
                    self.streamListe.append((isStream, isUrl, streamPart))
                else:
                    print "No supported hoster:"
                    print isStream
                    print isUrl
        else:
            print "No Streams found"
            self.streamListe.append(("No streams found!", "", ""))

        self.streamMenuList.setList(map(IStreamStreamListEntry, self.streamListe))
        self["handlung"].setText(decodeHtml(desc))
        self.keyLocked = False
        print "imageUrl: ", self.imageUrl
        CoverHelper(self["coverArt"]).getCover(self.imageUrl)

    def dataError(self, error):
        print "dataError:"
        printl(error, self, "E")
        self.streamListe.append(("Read error !", ""))
        self.streamMenuList.setList(map(IStreamStreamListEntry, self.streamListe))

    def got_link(self, stream_url):
        print "got_link:"
        if stream_url == None:
            message = self.session.open(
                MessageBox, _("Stream not found, try another Stream Hoster."), MessageBox.TYPE_INFO, timeout=3
            )
        else:
            title = self.filmName + self["liste"].getCurrent()[0][2]
            if config.mediaportal.useHttpDump.value:
                movieinfo = [stream_url, self.filmName, ""]
                self.session.open(PlayHttpMovie, movieinfo, title)
            else:
                self.session.open(
                    SimplePlayer,
                    [(title, stream_url, self.imageUrl)],
                    cover=True,
                    showPlaylist=False,
                    ltype="istream.ws",
                )

    def keyTMDbInfo(self):
        if TMDbPresent:
            self.session.open(TMDbMain, self.filmName)
        elif IMDbPresent:
            self.session.open(IMDB, self.filmName)

    def keyOK(self):
        if self.keyLocked:
            return
        streamLink = self["liste"].getCurrent()[0][1]
        self.tw_agent_hlp.getRedirectedUrl(self.keyOK2, self.dataError, streamLink)

    def keyOK2(self, streamLink):
        saveads = re.search(".*?saveads.org", streamLink, re.S)
        if saveads:
            id = re.search("url=(.*?)%3D", streamLink, re.S)
            url = "http://istream.ws/go.php?url=" + id.group(1)
            self.tw_agent_hlp.getRedirectedUrl(self.keyOK3, self.dataError, url)
        else:
            get_stream_link(self.session).check_link(streamLink, self.got_link)

    def keyOK3(self, streamLink):
        get_stream_link(self.session).check_link(streamLink, self.got_link)

    def keyTxtPageUp(self):
        self["handlung"].pageUp()

    def keyTxtPageDown(self):
        self["handlung"].pageDown()

    def keyCancel(self):
        self.close()
class StreamAuswahl(MPScreen):

	def __init__(self, session, Title, Link):
		self.Link = Link
		self.Title = Title
		self.plugin_path = mp_globals.pluginPath
		self.skin_path = mp_globals.pluginPath + mp_globals.skinsPath

		path = "%s/%s/defaultListWideScreen.xml" % (self.skin_path, config.mediaportal.skin.value)
		if not fileExists(path):
			path = self.skin_path + mp_globals.skinFallback + "/defaultListWideScreen.xml"

		with open(path, "r") as f:
			self.skin = f.read()
			f.close()

		MPScreen.__init__(self, session)

		self["actions"] = ActionMap(["MP_Actions"], {
			"ok"	: self.keyOK,
			"0" : self.closeAll,
			"cancel": self.keyCancel
		}, -1)

		self['title'] = Label(basename)
		self['ContentTitle'] = Label("%s" %self.Title)

		self.filmliste = []
		self.keyLocked = True
		self.ml = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent)
		self['liste'] = self.ml
		self.onLayoutFinish.append(self.loadPage)

	def loadPage(self):
		self.keyLocked = True
		url = self.Link
		getPage(url).addCallback(self.loadPageData).addErrback(self.dataError)

	def loadPageData(self, data):
		parse = re.search('class="wordpress-post-tabs(.*?)class="wpts_cr', data, re.S)
		if parse:
			streamsids = re.findall('#tabs-(.*?)".*?(><a href="\s*(http[s]?://(.*?)\/.*?)" target="_blank"|)>((?!<s).*?)<', parse.group(1), re.S)
			if streamsids:
				for (id, x, link, hoster, quality) in streamsids:
					if not link:
						stream = re.findall('id="tabs-'+id+'.*?="\s*(http[s]?://(.*?)\/.*?)"', parse.group(1), re.S)
						if stream:
							if "streamdefence" in stream[0][1]:
								hoster = '%s - %s' % (quality, 'WTFCrypt')
								self.filmliste.append((hoster, stream[0][0]))
							elif "wtf-zone.xyz" in stream[0][1]:
								hoster = '%s - %s' % (quality, 'WTFZONE')
								self.filmliste.append((hoster, stream[0][0]))
							elif isSupportedHoster(stream[0][1], True):
								hoster = '%s - %s' % (quality, stream[0][1].replace('wtf-is-this.xyz', 'WTFISTHIS'))
								self.filmliste.append((hoster, stream[0][0]))
					else:
						if hoster != 'wtf-videos.xyz':
							hoster = '%s - %s' % (quality, hoster.replace('wtf-is-this.xyz', 'WTFISTHIS').replace('wtf-zone.xyz', 'WTFZONE'))
							self.filmliste.append((hoster, link.split(' ')[0]))
		if len(self.filmliste) == 0:
			self.filmliste.append((_('No supported streams found!'), None))
		self.ml.setList(map(self._defaultlisthoster, self.filmliste))
		self.keyLocked = False

	def keyOK(self):
		if self.keyLocked:
			return
		streamHoster = self['liste'].getCurrent()[0][0]
		url = self['liste'].getCurrent()[0][1]
		if url == None:
			return
		if re.search('WTFZONE', streamHoster):
			getPage(url).addCallback(self.wtfzoneembed).addErrback(self.dataError)
		elif re.search('WTFISTHIS', streamHoster):
			getPage(url).addCallback(self.wtfisthis).addErrback(self.dataError)
		elif re.search('WTFCrypt', streamHoster):
			getPage(url, headers={'Referer': self.Link}).addCallback(self.wtfcrypt).addErrback(self.dataError)
		else:
			get_stream_link(self.session).check_link(url, self.got_link)

	def wtfcrypt(self, data):
		key = re.search('document.write.*?\("(.*?)"', data)
		if key:
			wtfcode = re.sub('[^A-Za-z0-9\+\/\=]', '', key.group(1))
			mycode = base64.b64decode(base64.b64decode(wtfcode))
			key = re.search('document.write.*?\("(.*?)"', mycode)
			if key:
				wtfcode = re.sub('[^A-Za-z0-9\+\/\=]', '', key.group(1))
				mycode2 = base64.b64decode(base64.b64decode(wtfcode))
				stream_url = re.search('src="(http.*?)"', mycode2)
				if stream_url:
					stream_url = stream_url.group(1)
					get_stream_link(self.session).check_link(str(stream_url), self.got_link)
					return
		message = self.session.open(MessageBoxExt, _("Broken URL parsing, please report to the developers."), MessageBoxExt.TYPE_INFO, timeout=3)

	def wtfisthis(self, data):
		url = re.search('<a href="(http://wtf-is-this.xyz/\?r=.*?)"', data, re.S)
		if url:
			url = url.group(1)
			self.tw_agent_hlp = TwAgentHelper()
			self.tw_agent_hlp.getRedirectedUrl(url).addCallback(self.wtfisthisdata).addErrback(self.dataError)
		else:
			self.adfly(data)

	def wtfisthisdata(self, data):
		getPage(data).addCallback(self.adfly).addErrback(self.dataError)

	def wtfisthisembed(self, data):
		getPage(data).addCallback(self.adfly).addErrback(self.dataError)

	def adfly(self, data):
		ysmm = re.search("var\sysmm\s=\s'(.*?)'", data)
		if ysmm:
			ysmm = ysmm.group(1)
			left = ''
			right = ''
			for c in [ysmm[i:i+2] for i in range(0, len(ysmm), 2)]:
				left += c[0]
				right = c[1] + right
			url = base64.b64decode(left.encode() + right.encode())[2:].decode()
			if re.search(r'go\.php\?u\=', url):
				url = base64.b64decode(re.sub(r'(.*?)u=', '', url)).decode()
			if re.search('wtf-zone\.xyz', url, re.S):
				self.wtfzone(str(url))
				return
			else:
				get_stream_link(self.session).check_link(str(url), self.got_link)
				return
		else:
			link = re.findall('="(http://wtf-zone\.xyz/view.*?)"', data, re.S)
			if link:
				self.wtfzone(link[0])
				return
		message = self.session.open(MessageBoxExt, _("Broken URL parsing, please report to the developers."), MessageBoxExt.TYPE_INFO, timeout=3)

	def wtfzone(self, url):
		if re.search('wtf-zone\.xyz/embed', url, re.S):
			link = url
		else:
			id = re.search('wtf-zone\.xyz/view/.*?/(.*?)$', url)
			if id:
				link = "http://wtf-zone.xyz/embed/%s" % str(id.group(1))
		getPage(link).addCallback(self.wtfzonelink).addErrback(self.dataError)

	def wtfzoneembed(self, data):
		link = re.search('embedURL"\scontent="(.*?)"', data)
		if link:
			getPage(link.group(1)).addCallback(self.wtfzonelink).addErrback(self.dataError)

	def wtfzonelink(self, data):
		stream_url = re.findall('\s+src="(http://[^wtf\-zone\.xyz].*?)"', data)
		if stream_url:
			stream_url = stream_url[-1]
			get_stream_link(self.session).check_link(str(stream_url), self.got_link)
		else:
			message = self.session.open(MessageBoxExt, _("Broken URL parsing, please report to the developers."), MessageBoxExt.TYPE_INFO, timeout=3)

	def got_link(self, stream_url):
		title = self.Title
		self.session.open(SimplePlayer, [(self.Title, stream_url)], showPlaylist=False, ltype='wtfvideofree')