def movies(url): if url =="vod": open = tools.OPEN_URL(vod_url) else: open = tools.OPEN_URL(url) all_cats = tools.regex_get_all(open,'<channel>','</channel>') for a in all_cats: if '<playlist_url>' in open: name = tools.regex_from_to(a,'<title>','</title>') name = base64.b64decode(name) url1 = tools.regex_from_to(a,'<playlist_url>','</playlist_url>').replace('<![CDATA[','').replace(']]>','') if not 'TV shows' in name: tools.addDir(str(name).replace('?',''),url1,1,icon,fanart,'') else: try: name = tools.regex_from_to(a,'<title>','</title>') name = base64.b64decode(name) thumb= tools.regex_from_to(a,'<desc_image>','</desc_image>').replace('<![CDATA[','').replace(']]>','') url = tools.regex_from_to(a,'<stream_url>','</stream_url>').replace('<![CDATA[','').replace(']]>','') desc = tools.regex_from_to(a,'<description>','</description>') desc = base64.b64decode(desc) plot = tools.regex_from_to(desc,'PLOT:','\n') cast = tools.regex_from_to(desc,'CAST:','\n') ratin= tools.regex_from_to(desc,'RATING:','\n') year = tools.regex_from_to(desc,'RELEASEDATE:','\n').replace(' ','-') year = re.compile('-.*?-.*?-(.*?)-',re.DOTALL).findall(year) runt = tools.regex_from_to(desc,'DURATION_SECS:','\n') genre= tools.regex_from_to(desc,'GENRE:','\n') tools.addDirMeta(str(name).replace('[/COLOR].','.[/COLOR]'),url,4,thumb,fanart,plot,str(year).replace("['","").replace("']",""),str(cast).split(),ratin,runt,genre) except:pass xbmcplugin.setContent(int(sys.argv[1]), 'movies')
def vod(url): if url =="vod": open = tools.OPEN_URL(vod_url) else: url = buildcleanurl(url) open = tools.OPEN_URL(url) all_cats = tools.regex_get_all(open,'<channel>','</channel>') for a in all_cats: if '<playlist_url>' in open: name = tools.regex_from_to(a,'<title>','</title>') url1 = tools.regex_from_to(a,'<playlist_url>','</playlist_url>').replace('<![CDATA[','').replace(']]>','') tools.addDir(str(base64.b64decode(name)).replace('?',''),url1,3,icon,background,'') else: if xbmcaddon.Addon().getSetting('meta') == 'true': try: name = tools.regex_from_to(a,'<title>','</title>') name = base64.b64decode(name) thumb= tools.regex_from_to(a,'<desc_image>','</desc_image>').replace('<![CDATA[','').replace(']]>','') url = tools.regex_from_to(a,'<stream_url>','</stream_url>').replace('<![CDATA[','').replace(']]>','') desc = tools.regex_from_to(a,'<description>','</description>') desc = base64.b64decode(desc) plot = tools.regex_from_to(desc,'PLOT:','\n') cast = tools.regex_from_to(desc,'CAST:','\n') ratin= tools.regex_from_to(desc,'RATING:','\n') year = tools.regex_from_to(desc,'RELEASEDATE:','\n').replace(' ','-') year = re.compile('-.*?-.*?-(.*?)-',re.DOTALL).findall(year) runt = tools.regex_from_to(desc,'DURATION_SECS:','\n') genre= tools.regex_from_to(desc,'GENRE:','\n') tools.addDirMeta(str(name).replace('[/COLOR][/B].','.[/COLOR][/B]'),url,4,thumb,background,plot,str(year).replace("['","").replace("']",""),str(cast).split(),ratin,runt,genre) except:pass xbmcplugin.setContent(int(sys.argv[1]), 'vod') else: name = tools.regex_from_to(a,'<title>','</title>') name = base64.b64decode(name) thumb= tools.regex_from_to(a,'<desc_image>','</desc_image>').replace('<![CDATA[','').replace(']]>','') url = tools.regex_from_to(a,'<stream_url>','</stream_url>').replace('<![CDATA[','').replace(']]>','') desc = tools.regex_from_to(a,'<description>','</description>') tools.addDir(name,url,4,thumb,background,base64.b64decode(desc))
def eps(url): open = tools.OPEN_URL(url) #print open all_cats = tools.regex_get_all(open, '<channel>', '</channel>') for a in all_cats: if '<playlist_url>' in open: name = tools.regex_from_to(a, '<title>', '</title>') url1 = tools.regex_from_to(a, '<stream_url>', '</stream_url>').replace( '<![CDATA[', '').replace(']]>', '') tools.addDir( str(base64.b64decode(name)).replace('?', ''), url1, 22, icon, fanart, '') else: if xbmcaddon.Addon().getSetting('meta') == 'true': try: name = tools.regex_from_to(a, '<title>', '</title>') name = base64.b64decode(name) thumb = tools.regex_from_to(a, '<desc_image>', '</desc_image>').replace( '<![CDATA[', '').replace(']]>', '') url = tools.regex_from_to(a, '<stream_url>', '</stream_url>').replace( '<![CDATA[', '').replace(']]>', '') desc = tools.regex_from_to(a, '<description>', '</description>') desc = base64.b64decode(desc) plot = tools.regex_from_to(desc, 'PLOT:', '\n') cast = tools.regex_from_to(desc, 'CAST:', '\n') ratin = tools.regex_from_to(desc, 'RATING:', '\n') year = tools.regex_from_to(desc, 'RELEASEDATE:', '\n').replace(' ', '-') year = re.compile('-.*?-.*?-(.*?)-', re.DOTALL).findall(year) runt = tools.regex_from_to(desc, 'DURATION_SECS:', '\n') genre = tools.regex_from_to(desc, 'GENRE:', '\n') tools.addDirMeta( str(name).replace('[/COLOR].', '.[/COLOR]'), url, 4, thumb, fanart, plot, str(year).replace("['", "").replace("']", ""), str(cast).split(), ratin, runt, genre) except: pass xbmcplugin.setContent(int(sys.argv[1]), 'episodes') else: name = tools.regex_from_to(a, '<title>', '</title>') name = base64.b64decode(name) thumb = tools.regex_from_to(a, '<desc_image>', '</desc_image>').replace( '<![CDATA[', '').replace(']]>', '') url = tools.regex_from_to(a, '<stream_url>', '</stream_url>').replace( '<![CDATA[', '').replace(']]>', '') desc = tools.regex_from_to(a, '<description>', '</description>') tools.addDir(name, url, 4, thumb, fanart, base64.b64decode(desc)) xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_TITLE)