def getPrefferedVideoURL(self, data): sm3u8Parser = sm3u8.parseHandler() playlists = sm3u8Parser.parse(data) for quality in vqw.twitchVQW: for idx in playlists: if (playlists[idx]): if (quality == playlists[idx]['video']): return playlists[idx]['uri'] return None
def getPrefferedVideoURL(self, data): sm3u8Parser = sm3u8.parseHandler() playlists = sm3u8Parser.parse(data) for quality in vqw.skaiVQW: for idx in playlists: if (playlists[idx]): streamUri = playlists[idx]['uri'] if (streamUri.find(quality) >= 0): return "%s/%s" % (self.cambria4Url, streamUri) return None
def getPrefferedVideoURL(self, data): sm3u8Parser = sm3u8.parseHandler() playlists = sm3u8Parser.parse(data) for quality in vqw.wasdVQW: for idx in playlists: if (playlists[idx]): streamQuality = playlists[idx] if (streamQuality['resolution'].find(quality) >= 0): return playlists[idx]['uri'] sys.exit() return None
def getPrefferedVideoURL(self, data): sm3u8Parser = sm3u8.parseHandler() playlists = sm3u8Parser.parse(data) for quality in vqw.dailymotionVQW: for idx in playlists: if (playlists[idx]): streamQuality = playlists[idx]['name'] if (streamQuality.find(quality) >= 0): return playlists[idx]['uri'] return None
def getPreferredVideoURL(self, data): sm3u8Parser = sm3u8.parseHandler() playlists = sm3u8Parser.parse(data) for quality in vqw.vimeoVQW: for idx in playlists: if (playlists[idx]): streamQuality = self.getQualityByUri(playlists[idx]['uri']) if streamQuality: if (streamQuality.find(quality) >= 0): return playlists[idx]['uri'] return None
def getPrefferedVideoURL(self, data, isLive=False, isCiphered=False): if isLive: sm3u8Parser = sm3u8.parseHandler() data = sm3u8Parser.parse(data) for quality in vqw.ytLiveVQW: for idx in data: streamQuality = data[idx]['resolution'] if (streamQuality.find(str(quality)) >= 0): return data[idx]['uri'] for quality in vqw.ytVQW: for idx in data: if (quality == idx['itag']): try: return idx['url'] except KeyError: pass if isCiphered: try: return self.getURLFromCipher(idx['cipher']) except KeyError: print "Cipher does not exist" return None