def getVideoResolutionList(self, video_id): info = self._get('videos/' + str(video_id) + '/streamurl') if self.errmsg != "": return None, None content = netHelper.downloadString(info['url'], None) resolutionList, urlList = self.__parseVideoMasterAll(str(content)) return resolutionList, urlList
def __parseVideoMediaPlaylist(self, url): content = netHelper.downloadString(url, None) pattern = re.compile(r"(?<=http).+?(?=\\n)") plist = pattern.findall(str(content)) urllist = [] for item in plist: urllist.append("http" + item) return urllist
def paresUrl(url): '''Get ts-urls from m3u8-url''' content = netHelper.downloadString(url, None) pattern = re.compile(r"(?<=http).+?(?=\\n)") plist = pattern.findall(str(content)) urllist = [] for item in plist: urllist.append("http" + item) return urllist
def parseUrl(url: str) -> list: """Get ts-urls from m3u8-url""" content = netHelper.downloadString(url, None) return parseTsUrls(content)