本文整理汇总了Python中Plugins.Extensions.MediaPortal.resources.twagenthelper.TwAgentHelper类的典型用法代码示例。如果您正苦于以下问题:Python TwAgentHelper类的具体用法?Python TwAgentHelper怎么用?Python TwAgentHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TwAgentHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getRedirectedUrl
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)
示例2: __init__
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()
示例3: __init__
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)
示例4: __init__
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)
示例5: __init__
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)
示例6: __init__
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)
示例7: __init__
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)
示例8: get_stream_link
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()
示例9: wtfisthis
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)
示例10: keyOK
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)
示例11: 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()
示例12: __init__
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)
示例13: __init__
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)
示例14: __init__
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)
示例15: IStreamStreams
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!", "", ""))
#.........这里部分代码省略.........