def get_seasons_for_item(itemPlayable): urlToLoad = VVVVID_BASE_URL+str(itemPlayable.show_id) + '/seasons' response = getJsonDataFromUrl(urlToLoad) data = json.loads(response.read().decode(response.info().getparam('charset') or 'utf-8')) result = data['data'] itemPlayable.seasons = [] for seasonData in result: season = ItemPlayableSeason() season.id = seasonData['show_id'] season.show_id = seasonData ['show_id'] season.season_id = seasonData['season_id'] if(seasonData.has_key('name')): season.title = seasonData['name'] else: season.title = itemPlayable.title urlToLoadSeason = VVVVID_BASE_URL+str(itemPlayable.show_id) + '/season/' + str(season.season_id) responseSeason = getJsonDataFromUrl(urlToLoadSeason) dataSeason = json.loads(responseSeason.read().decode(responseSeason.info().getparam('charset') or 'utf-8')) resultSeason = dataSeason['data'] listEpisode = [] for episodeData in resultSeason: if(episodeData['video_id'] != '-1'): episode = SeasonEpisode() embed_info = dec_ei(episodeData['embed_info']) episode.show_id = season.show_id episode.season_id = season.season_id prefix = '' video_type = episodeData['video_type'] postfix= 'g=DRIEGSYPNOBI&hdcore=3.6.0&plugin=aasp-3.6.0.50.41' #xbmcgui.Dialog().ok('VVVVID.it',video_type) if video_type == ENC_TYPE: episode.stream_type = F4M_TYPE episode.manifest = STREAM_HTTP+embed_info+postfix elif video_type == KENC_TYPE: episode.stream_type = F4M_TYPE response = getJsonDataFromUrl(VVVVID_KENC_SERVER+'&url='+urllib.quote_plus(embed_info)) message = json.loads(response.read().decode(response.info().getparam('charset') or 'utf-8')) embed_info_plus = dec_ei(message['message'])#;xbmcgui.Dialog().ok('VVVVID.it',embed_info_plus) episode.manifest = embed_info+'?'+embed_info_plus+'&'+postfix elif video_type == VVVVID_TYPE: episode.stream_type = F4M_TYPE episode.manifest = STREAM_HTTP+embed_info+'/manifest.f4m' else: episode.stream_type = F4M_TYPE episode.manifest = embed_info+'?'+postfix plugin = Plugin();plugin.log.error('manifest: '+ episode.manifest) #plugin = Plugin();plugin.log.error('manifest: '+ episode.manifest) #episode.manifest = prefix + episodeData['embed_info'] + postfix episode.title = ((episodeData['number'] + ' - ' + episodeData['title'])).encode('utf-8','replace') episode.thumb = episodeData['thumbnail'] listEpisode.append(episode) season.episodes = listEpisode itemPlayable.seasons.append(season) return itemPlayable
def get_seasons_for_item(itemPlayable): urlToLoad = VVVVID_BASE_URL + str(itemPlayable.show_id) + '/seasons' response = getJsonDataFromUrl(urlToLoad) data = json.loads(response.read().decode( response.info().getparam('charset') or 'utf-8')) result = data['data'] itemPlayable.seasons = [] for seasonData in result: season = ItemPlayableSeason() season.id = seasonData['show_id'] season.show_id = seasonData['show_id'] season.season_id = seasonData['season_id'] if (seasonData.has_key('name')): season.title = seasonData['name'] else: season.title = itemPlayable.title urlToLoadSeason = VVVVID_BASE_URL + str( itemPlayable.show_id) + '/season/' + str(season.season_id) responseSeason = getJsonDataFromUrl(urlToLoadSeason) dataSeason = json.loads(responseSeason.read().decode( responseSeason.info().getparam('charset') or 'utf-8')) resultSeason = dataSeason['data'] listEpisode = [] for episodeData in resultSeason: if (episodeData['video_id'] != '-1'): episode = SeasonEpisode() episode.show_id = season.show_id episode.season_id = season.season_id prefix = '' postfix = '?g=DRIEGSYPNOBI&hdcore=3.6.0&plugin=aasp-3.6.0.50.41' if ('http' not in episodeData['embed_info']): episode.stream_type = F4M_TYPE prefix = 'http://wowzaondemand.top-ix.org/videomg/_definst_/mp4:' postfix = '/manifest.f4m' if ('.m3u' in episodeData['embed_info']): episode.stream_type = M3U_TYPE prefix = '' postfix = '' episode.manifest = prefix + episodeData['embed_info'] + postfix episode.title = ((episodeData['number'] + ' - ' + episodeData['title'])).encode( 'utf-8', 'replace') episode.thumb = episodeData['thumbnail'] listEpisode.append(episode) season.episodes = listEpisode itemPlayable.seasons.append(season) return itemPlayable
def get_seasons_for_item(itemPlayable): urlToLoad = urllib.basejoin(VVVVID_BASE_URL, str(itemPlayable.show_id) + '/seasons') data = getJsonDataFromUrl(urlToLoad) result = data['data'] itemPlayable.seasons = [] for seasonData in result: season = ItemPlayableSeason() season.id = seasonData['show_id'] season.show_id = seasonData['show_id'] season.season_id = seasonData['season_id'] if 'name' in seasonData: season.title = seasonData['name'] else: season.title = itemPlayable.title urlToLoadSeason = urllib.basejoin(VVVVID_BASE_URL, str(itemPlayable.show_id) + '/season/' + str(season.season_id)) dataSeason = getJsonDataFromUrl(urlToLoadSeason) resultSeason = dataSeason['data'] listEpisode = [] for episodeData in resultSeason: if episodeData['video_id'] != '-1': episode = SeasonEpisode() episode.show_id = season.show_id episode.season_id = season.season_id episode.stream_type = M3U_TYPE episodeData['embed_info'] = decode_embed_info(episodeData['embed_info']) if 'http' not in episodeData['embed_info']: prefix = 'http://194.116.73.48/videomg/_definst_/mp4:' postfix = '/playlist.m3u8' episodeData['embed_info'] = episodeData['embed_info'].replace(' ', '%20') else: prefix = '' postfix = '' if 'video/kenc' in episodeData['video_type']: episodeData['embed_info'] = episodeData['embed_info'].replace('http', 'https') kenc_data = getJsonDataFromUrl(VVVVID_KENC + urllib.urlencode({'url': episodeData['embed_info']})) episodeData['embed_info'] += '?' + decode_embed_info(kenc_data['message']) episode.manifest = prefix + episodeData['embed_info'] + postfix + '|' + HEADERS_ENCODED episode.title = (episodeData['number'] + ' - ' + episodeData['title']).encode('utf-8', 'replace') episode.thumb = urllib.basejoin(VVVVID_STATIC_URL, episodeData['thumbnail']) + '|' + HEADERS_ENCODED listEpisode.append(episode) season.episodes = listEpisode itemPlayable.seasons.append(season) return itemPlayable
def get_seasons_for_item(itemPlayable): urlToLoad = VVVVID_BASE_URL+str(itemPlayable.show_id) + '/seasons' response = getJsonDataFromUrl(urlToLoad) data = json.loads(response.read().decode(response.info().getparam('charset') or 'utf-8')) result = data['data'] itemPlayable.seasons = [] for seasonData in result: season = ItemPlayableSeason() season.id = seasonData['show_id'] season.show_id = seasonData ['show_id'] season.season_id = seasonData['season_id'] if(seasonData.has_key('name')): season.title = seasonData['name'] else: season.title = itemPlayable.title urlToLoadSeason = VVVVID_BASE_URL+str(itemPlayable.show_id) + '/season/' + str(season.season_id) responseSeason = getJsonDataFromUrl(urlToLoadSeason) dataSeason = json.loads(responseSeason.read().decode(responseSeason.info().getparam('charset') or 'utf-8')) resultSeason = dataSeason['data'] listEpisode = [] for episodeData in resultSeason: if(episodeData['video_id'] != '-1'): episode = SeasonEpisode() episode.show_id = season.show_id episode.season_id = season.season_id prefix = '' postfix= '?g=DRIEGSYPNOBI&hdcore=3.6.0&plugin=aasp-3.6.0.50.41' if('http' not in episodeData['embed_info']): episode.stream_type = F4M_TYPE prefix = 'http://wowzaondemand.top-ix.org/videomg/_definst_/mp4:' postfix = '/manifest.f4m' if('.m3u' in episodeData['embed_info']): episode.stream_type = M3U_TYPE prefix = '' postfix = '' episode.manifest = prefix + episodeData['embed_info'] + postfix episode.title = ((episodeData['number'] + ' - ' + episodeData['title'])).encode('utf-8','replace') episode.thumb = episodeData['thumbnail'] listEpisode.append(episode) season.episodes = listEpisode itemPlayable.seasons.append(season) return itemPlayable
def get_seasons_for_item(itemPlayable): urlToLoad = VVVVID_BASE_URL + str(itemPlayable.show_id) + '/seasons' response = getJsonDataFromUrl(urlToLoad) data = json.loads(response.read().decode( response.info().getparam('charset') or 'utf-8')) result = data['data'] itemPlayable.seasons = [] for seasonData in result: season = ItemPlayableSeason() season.id = seasonData['show_id'] season.show_id = seasonData['show_id'] season.season_id = seasonData['season_id'] if (seasonData.has_key('name')): season.title = seasonData['name'] else: season.title = itemPlayable.title urlToLoadSeason = VVVVID_BASE_URL + str( itemPlayable.show_id) + '/season/' + str(season.season_id) responseSeason = getJsonDataFromUrl(urlToLoadSeason) dataSeason = json.loads(responseSeason.read().decode( responseSeason.info().getparam('charset') or 'utf-8')) resultSeason = dataSeason['data'] listEpisode = [] for episodeData in resultSeason: if (episodeData['video_id'] != '-1'): episode = SeasonEpisode() embed_info = dec_ei(episodeData['embed_info']) episode.show_id = season.show_id episode.season_id = season.season_id prefix = '' video_type = episodeData['video_type'] postfix = 'g=DRIEGSYPNOBI&hdcore=3.6.0&plugin=aasp-3.6.0.50.41' #xbmcgui.Dialog().ok('VVVVID.it',video_type) if video_type == ENC_TYPE: episode.stream_type = F4M_TYPE episode.manifest = STREAM_HTTP + embed_info + postfix elif video_type == KENC_TYPE: episode.stream_type = F4M_TYPE response = getJsonDataFromUrl( VVVVID_KENC_SERVER + '&url=' + urllib.quote_plus(embed_info)) message = json.loads(response.read().decode( response.info().getparam('charset') or 'utf-8')) embed_info_plus = dec_ei( message['message'] ) #;xbmcgui.Dialog().ok('VVVVID.it',embed_info_plus) episode.manifest = embed_info + '?' + embed_info_plus + '&' + postfix elif video_type == VVVVID_TYPE: episode.stream_type = F4M_TYPE episode.manifest = STREAM_HTTP + embed_info + '/manifest.f4m' else: episode.stream_type = F4M_TYPE episode.manifest = embed_info + '?' + postfix #episode.manifest = prefix + episodeData['embed_info'] + postfix episode.title = ((episodeData['number'] + ' - ' + episodeData['title'])).encode( 'utf-8', 'replace') episode.thumb = episodeData['thumbnail'] listEpisode.append(episode) season.episodes = listEpisode itemPlayable.seasons.append(season) return itemPlayable