本文整理汇总了Python中Helper.Helper.downloadString方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.downloadString方法的具体用法?Python Helper.downloadString怎么用?Python Helper.downloadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper.Helper
的用法示例。
在下文中一共展示了Helper.downloadString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_pls
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import downloadString [as 别名]
def parse_pls(url):
urls = []
pls_content = Helper.downloadString(url)
stream = Helper.parsePls(pls_content)
if stream:
urls.append(stream)
return urls
示例2: parse_m3u
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import downloadString [as 别名]
def parse_m3u(url):
urls = []
m3u_content = Helper.downloadString(url)
stream = Helper.parsem3u(m3u_content)
if stream:
urls.append(stream)
return urls
示例3: _call
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import downloadString [as 别名]
def _call(url, param=None):
# print('call radio with path=%s, param=%s', path, param)
if param:
param['key'] = yt_key
url += '?' + urlencode(param)
print("call tunein with url: " + url)
response = Helper.downloadString(url)
json_data = json.loads(response)
return json_data
示例4: _call
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import downloadString [as 别名]
def _call(path, param=None):
#print('call radio with path=%s, param=%s', path, param)
url = '{0}/{1}'.format(RadioUrl, path)
if param:
url += '?' + urlencode(param)
print("call radio with url: " + url)
response = Helper.downloadString(url)
json_data = json.loads(response)
return json_data
示例5: _call
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import downloadString [as 别名]
def _call(path, param=None):
if param is None:
param = {}
param["api_key"] = ApiKey
param["api_version"] = ApiVersion
url = '{0}/{1}'.format(TracksUrl, path)
if param:
url += '?' + urlencode(param)
print('call radio with url=%s', url)
response = Helper.downloadString(url)
# print("Response: " + response)
if response:
json_data = json.loads(response)
return json_data
else:
return None
示例6: parse_asx
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import downloadString [as 别名]
def parse_asx(url):
urls = []
data = Helper.downloadString(url)
m = re.search(r'\<[Rr]ef.*\"(http.*)\"', data, re.I)
url = m.group(1)
print("Found asx url: " + url)
urls.append(url)
return urls
if b'asx' in data.getvalue()[0:50].lower():
url = parse_new_asx(data)
urls.append(url)
else:
url = parse_old_asx(data)
urls.append(url)
return urls