Format the code with YAPF
This commit is contained in:
parent
d8ea95b05d
commit
b142cf3340
5 changed files with 204 additions and 97 deletions
|
|
@ -6,12 +6,10 @@ import time
|
|||
|
||||
def prepare_browse_endpoint(type, browseId):
|
||||
return {
|
||||
'browseEndpointContextSupportedConfigs':
|
||||
{
|
||||
"browseEndpointContextMusicConfig":
|
||||
{
|
||||
"pageType": "MUSIC_PAGE_TYPE_" + type
|
||||
}
|
||||
'browseEndpointContextSupportedConfigs': {
|
||||
"browseEndpointContextMusicConfig": {
|
||||
"pageType": "MUSIC_PAGE_TYPE_" + type
|
||||
}
|
||||
},
|
||||
'browseId': browseId
|
||||
}
|
||||
|
|
@ -29,9 +27,9 @@ def prepare_like_endpoint(rating):
|
|||
|
||||
|
||||
def html_to_txt(html_text):
|
||||
tags = re.findall("<[^>]+>",html_text)
|
||||
tags = re.findall("<[^>]+>", html_text)
|
||||
for tag in tags:
|
||||
html_text = html_text.replace(tag,'')
|
||||
html_text = html_text.replace(tag, '')
|
||||
return html_text
|
||||
|
||||
|
||||
|
|
@ -47,4 +45,4 @@ def get_authorization(auth):
|
|||
sha_1 = sha1()
|
||||
unix_timestamp = str(int(time.time()))
|
||||
sha_1.update((unix_timestamp + ' ' + auth).encode('utf-8'))
|
||||
return "SAPISIDHASH " + unix_timestamp + "_" + sha_1.hexdigest()
|
||||
return "SAPISIDHASH " + unix_timestamp + "_" + sha_1.hexdigest()
|
||||
|
|
|
|||
Loading…
Reference in a new issue