def DoPlayer(url,destfile="",destpath="",useResolver=False): destpath=xbmc.translatePath(destpath); debob(str(useResolver)); if useResolver==True: try: import urlresolver; link=urlresolver.HostedMediaFile(url).resolve(); #debob(urlresolver.HostedMediaFile(url)); except: link=url else: link=url deb('downloadable url',link); import axelproxy as proxy; axelhelper=proxy.ProxyHelper(); #axelhelper.playUrl(link); AxelConnections=addst('axel-connections','Default'); AxelUseName=tfalse(addst('axel-usename','false')); AxelKeepFile=tfalse(addst('axel-keepfile','false')); if len(destpath) > 2: if isPath(destpath)==True: usePath=True else: usePath=False else: usePath=False if usePath==True: if (AxelConnections.lower()=='default') or (len(AxelConnections)==0): if AxelUseName==True: axelhelper.playUrl(link,name=destfile,keep_file=AxelKeepFile,dest_folder_path=destpath); else: axelhelper.playUrl(link,keep_file=AxelKeepFile,dest_folder_path=destpath); else: if AxelUseName==True: axelhelper.playUrl(link,name=destfile,connections=AxelConnections,keep_file=AxelKeepFile,dest_folder_path=destpath); else: axelhelper.playUrl(link,connections=AxelConnections,keep_file=AxelKeepFile,dest_folder_path=destpath); else: if (AxelConnections.lower()=='default') or (len(AxelConnections)==0): if AxelUseName==True: axelhelper.playUrl(link,name=destfile,keep_file=AxelKeepFile); else: axelhelper.playUrl(link,keep_file=AxelKeepFile); else: if AxelUseName==True: axelhelper.playUrl(link,name=destfile,connections=AxelConnections,keep_file=AxelKeepFile); else: axelhelper.playUrl(link,connections=AxelConnections,keep_file=AxelKeepFile);
def mode_subcheck(mode='',site='',section='',url=''): deb('mode',mode); if (mode=='SectionMenu') or (mode=='') or (mode=='main') or (mode=='MainMenu'): SectionMenu() elif (mode=='Record'): startStreamRecord() ## XBMC.Container.Update(plugin://plugin.program.streamrecord/?mode=Record) ## XBMC.RunPlugin(plugin://plugin.program.streamrecord/?mode=Record) ## this one seems to work in skins. elif (mode=='Download'): #try: _addon.resolve_url(url); #except: pass #debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]); #DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))); destpath=addpr('destpath','') if len(destpath)==0: destpath=addst('download_folder_default','') debob([url,addpr('destfile',''),destpath,'False']); eod(); DoA("Back"); DownloadThis(url,addpr('destfile',''),destpath,False); elif (mode=='ResolveAndDownload'): destpath=addpr('destpath','') if len(destpath)==0: destpath=addst('download_folder_default','') debob([url,addpr('destfile',''),destpath,'False']); eod(); DoA("Back"); try: import urlresolver except: myNote('Problem','unable to import: urlresolver',15000); debob(['Problem','unable to import: urlresolver']); return try: oUrl=''+url url=urlresolver.HostedMediaFile(url).resolve() except: myNote('Problem','resolving url',15000); debob(['Problem','resolving url',oUrl,url]); return DownloadThis(url,addpr('destfile',''),destpath,False); elif (mode=='toJDownloader'): SendTo_JDownloader(url,tfalse(addpr('useResolver','true'))); eod(); DoA("Back"); elif (mode=='About'): About(); eod(); #DoA("Back"); else: myNote(header='Site: "'+str(site)+'"',msg=str(mode)+' (mode) not found.'); SectionMenu()
def mode_subcheck(mode='', site='', section='', url=''): deb('mode', mode) if (mode == 'SectionMenu') or (mode == '') or (mode == 'main') or ( mode == 'MainMenu'): SectionMenu() elif (mode == 'Record'): startStreamRecord() ## XBMC.Container.Update(plugin://plugin.program.streamrecord/?mode=Record) ## XBMC.RunPlugin(plugin://plugin.program.streamrecord/?mode=Record) ## this one seems to work in skins. elif (mode == 'Download'): #try: _addon.resolve_url(url); #except: pass #debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]); #DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))); destpath = addpr('destpath', '') if len(destpath) == 0: destpath = addst('download_folder_default', '') destfile = fixPathSymbols(addpr('destfile', '')) debob([url, destfile, destpath, 'False']) eod() DoA("Back") DownloadThis(url, destfile, destpath, False) elif (mode == 'ResolveAndDownload'): destpath = addpr('destpath', '') if len(destpath) == 0: destpath = addst('download_folder_default', '') destfile = fixPathSymbols(addpr('destfile', '')) debob([url, destfile, destpath, 'False']) eod() DoA("Back") try: import urlresolver except: myNote('Problem', 'unable to import: urlresolver', 15000) debob(['Problem', 'unable to import: urlresolver']) return try: oUrl = '' + url url = urlresolver.HostedMediaFile(url).resolve() except: myNote('Problem', 'resolving url', 15000) debob(['Problem', 'resolving url', oUrl, url]) return DownloadThis(url, destfile, destpath, False) elif (mode == 'toJDownloader'): SendTo_JDownloader(url, tfalse(addpr('useResolver', 'true'))) eod() DoA("Back") elif (mode == 'About'): About() eod() #DoA("Back"); else: myNote(header='Site: "' + str(site) + '"', msg=str(mode) + ' (mode) not found.') SectionMenu()
def DoDownloader(url,destfile="",destpath="",useResolver=False): destpath=xbmc.translatePath(destpath); debob(str(useResolver)); if useResolver==True: try: import urlresolver; link=urlresolver.HostedMediaFile(url).resolve(); #debob(urlresolver.HostedMediaFile(url)); except: link=url else: link=url deb('downloadable url',link); import axelproxy as proxy; axelhelper=proxy.ProxyHelper(); #axelhelper.playUrl(link); AxelConnections=addst('axel-connections','Default'); AxelUseName=tfalse(addst('axel-usename','false')); AxelKeepFile=tfalse(addst('axel-keepfile','false')); if (AxelConnections.lower()=='default') or (len(AxelConnections)==0): if AxelUseName==True: download_id=axelhelper.download(link,name=destfile,dest_path=destpath); else: download_id=axelhelper.download(link,dest_path=destpath); else: #download(self,url,name='Name here',connections=2) if AxelUseName==True: download_id=axelhelper.download(link,name=destfile,connections=AxelConnections,dest_path=destpath); else: download_id=axelhelper.download(link,connections=AxelConnections,dest_path=destpath); try: addstv('Axel-DownloadID-Last',str(download_id)); except: pass
def startStreamRecord(): vName = '' vPath = '' p = xbmc.Player() if (p.isPlayingVideo() == True): pType = 'Video' debob("isPlayingVideo") vPath = addst('download_folder_default', '') elif (p.isPlayingAudio() == True): pType = 'Audio' debob("isPlayingAudio") vPath = addst('download_folder_audio', '') if len(vPath) == 0: vPath = addst('download_folder_default', '') elif (p.isPlaying() == True): pType = 'Unknown' debob("isPlaying") vPath = addst('download_folder_default', '') else: pType = '' debob("Couldn't find anything playing.") vPath = addst('download_folder_default', '') try: if (p.isInternetStream() == True): iIS = True deb("isInternetStream()", "True") else: iIS = False deb("isInternetStream()", "False") except: iIS = True deb("isInternetStream()", "error") if (len(vPath) > 0) and (len(pType) > 0) and (iIS == True): vPath = fixPath(vPath) deb("vPath", vPath) vUrl = xbmc.Player().getPlayingFile() deb("vUrl", vUrl) vName = setupName(vName, pType, vUrl) ### eod() DoA("Back") DownloadThis(vUrl, vName, vPath, False) else: eod() DoA("Back")
def mode_subcheck(mode='',site='',section='',url=''): deb('mode',mode); if (mode=='SectionMenu') or (mode=='') or (mode=='main') or (mode=='MainMenu'): SectionMenu() elif (mode=='Record'): startStreamRecord() ## XBMC.Container.Update(plugin://plugin.program.streamrecord/?mode=Record) ## XBMC.RunPlugin(plugin://plugin.program.streamrecord/?mode=Record) ## this one seems to work in skins. elif (mode=='Download'): #try: _addon.resolve_url(url); #except: pass #debob([url,addpr('destfile',''),addpr('destpath',''),str(tfalse(addpr('useResolver','true')))]); #DownloadThis(url,addpr('destfile',''),addpr('destpath',''),tfalse(addpr('useResolver','true'))); debob([url,addpr('destfile',''),addpr('destpath',''),'False']); eod(); DoA("Back"); DownloadThis(url,addpr('destfile',''),addpr('destpath',''),False); elif (mode=='toJDownloader'): SendTo_JDownloader(url,tfalse(addpr('useResolver','true'))); eod(); DoA("Back"); elif (mode=='About'): About(); eod(); #DoA("Back"); else: myNote(header='Site: "'+str(site)+'"',msg=str(mode)+' (mode) not found.'); SectionMenu()
def startStreamRecord(): vName=''; vPath=''; p=xbmc.Player(); if (p.isPlayingVideo()==True): pType='Video'; debob("isPlayingVideo"); vPath=addst('download_folder_default',''); elif (p.isPlayingAudio()==True): pType='Audio'; debob("isPlayingAudio"); vPath=addst('download_folder_audio',''); if len(vPath)==0: vPath=addst('download_folder_default',''); elif (p.isPlaying()==True): pType='Unknown'; debob("isPlaying"); vPath=addst('download_folder_default',''); else: pType=''; debob("Couldn't find anything playing."); vPath=addst('download_folder_default',''); try: if (p.isInternetStream()==True): iIS=True; deb("isInternetStream()","True"); else: iIS=False; deb("isInternetStream()","False"); except: iIS=True; deb("isInternetStream()","error"); if (len(vPath) > 0) and (len(pType) > 0) and (iIS==True): vPath=fixPath(vPath); deb("vPath",vPath); vUrl=xbmc.Player().getPlayingFile(); deb("vUrl",vUrl); vName=setupName(vName,pType,vUrl); ### eod(); DoA("Back"); DownloadThis(vUrl,vName,vPath,False); else: eod(); DoA("Back");
def SectionMenu(): vName=''; vPath=''; p=xbmc.Player(); if (p.isPlayingVideo()==True): pType='Video'; debob("isPlayingVideo"); vPath=addst('download_folder_default',''); elif (p.isPlayingAudio()==True): pType='Audio'; debob("isPlayingAudio"); vPath=addst('download_folder_audio',''); if len(vPath)==0: vPath=addst('download_folder_default',''); elif (p.isPlaying()==True): pType='Unknown'; debob("isPlaying"); vPath=addst('download_folder_default',''); else: pType=''; debob("Couldn't find anything playing."); vPath=addst('download_folder_default',''); try: if (p.isInternetStream()==True): iIS=True; deb("isInternetStream()","True"); else: iIS=False; deb("isInternetStream()","False"); except: iIS=True; deb("isInternetStream()","error"); if (len(vPath) > 0) and (len(pType) > 0) and (iIS==True): vPath=fixPath(vPath); deb("vPath",vPath); vUrl=xbmc.Player().getPlayingFile(); deb("vUrl",vUrl); vName=setupName(vName,pType); ### _addon.add_directory({'mode':'Download','url':vUrl,'destfile':vName,'filetype':pType,'destpath':vPath,'site':site,'section':section},{'title':cFL('Download '+str(pType)+': ','firebrick')+cFL(vName,'mediumpurple')+CR+vUrl},is_folder=True,fanart=fanartSite,img=iconSite) ### _addon.add_directory({'mode':'About','site':site,'section':section},{'title':AFColoring('About')},is_folder=True,fanart=fanartSite,img='http://i.imgur.com/0h78x5V.png') # iconSite set_view('list',view_mode=addst('default-view')); eod()