def start_chosen_video(): # Perform an additional login-check, in order to properly load the cookie. if os_account.user_is_logged_in(): episode_url = args['episodeurl'][0] episode_nbr = args['episodename'][0] series_name = args['seriesname'][0] # Check if a "mature content"-warning is displayed. response = urllib2.urlopen(episode_url) html = response.read() warnings = re.findall('warning.jpg', html) # If warnings are found: Follow the redirect URL to access the actual video. if len(warnings) > 0: new_url = re.findall('"../..(/watch.+?)">', html) episode_url = "http://otaku-streamers.com/{0}".format(new_url[0]) # Get URL to file. video_path = resolve(episode_url) # Set meta-data. li = xbmcgui.ListItem(thumbnailImage=os_images.get_poster_image(series_name)) if episode_nbr == 'Full Movie': li.setInfo('video', {'title': series_name}) else: li.setInfo('video', {'title': '{0} - {1}'.format(series_name, episode_nbr)}) # Start video playback. xbmc.Player().play(video_path, li) xbmcplugin.endOfDirectory(addon_handle)
def start_chosen_video(): # Perform an additional login-check, in order to properly load the cookie. if os_account.user_is_logged_in(): episode_url = args['episodeurl'][0] episode_nbr = args['episodename'][0] series_name = args['seriesname'][0] # Check if a "mature content"-warning is displayed. response = urllib2.urlopen(episode_url) html = response.read() warnings = re.findall('warning.jpg', html) # If warnings are found: Follow the redirect URL to access the actual video. if len(warnings) > 0: new_url = re.findall('"../..(/watch.+?)">', html) episode_url = "https://otaku-streamers.com/{0}".format(new_url[0]) # Get URL to file. video_path = resolve(episode_url) # Set meta-data. li = xbmcgui.ListItem( thumbnailImage=os_images.get_poster_image(series_name)) if episode_nbr == 'Full Movie': li.setInfo('video', {'title': series_name}) else: li.setInfo('video', {'title': '{0} - {1}'.format(series_name, episode_nbr)}) # Start video playback. xbmc.Player().play(video_path, li) xbmcplugin.endOfDirectory(addon_handle)
__addon__ = xbmcaddon.Addon() __addonname__ = __addon__.getAddonInfo('id') dataroot = xbmc.translatePath('special://profile/addon_data/%s' % __addonname__).decode('utf-8') imagefolder = os.path.join(dataroot, "images") # Create image folder if it doesn't exist. if not os.path.exists(imagefolder): os.makedirs(imagefolder) # Create list of categories if mode is None: # Performs the first attempt to log in. # Categories are only displayed if user is successfully logged in, to avoid confusion. if os_account.user_is_logged_in(): display_list_categories() # Create list of available letters elif mode[0] == 'category': display_list_letters() # Show the selected list of series. elif mode[0] == 'letter': display_list_series() # Show the list of episodes for the selected series. elif mode[0] == 'series': display_list_episodes_movies() # If an episode has been chosen
__addonname__ = __addon__.getAddonInfo('id') dataroot = xbmc.translatePath('special://profile/addon_data/%s' % __addonname__).decode('utf-8') imagefolder = os.path.join(dataroot, "images") # Create image folder if it doesn't exist. if not os.path.exists(imagefolder): os.makedirs(imagefolder) # Create list of categories if mode is None: # Performs the first attempt to log in. # Categories are only displayed if user is successfully logged in, to avoid confusion. if os_account.user_is_logged_in(): display_list_categories() # Create list of available letters elif mode[0] == 'category': display_list_letters() # Show the selected list of series. elif mode[0] == 'letter': display_list_series() # Show the list of episodes for the selected series. elif mode[0] == 'series': display_list_episodes_movies() # If an episode has been chosen