Strip HTML from playlist descriptions

This commit is contained in:
sigma67 2020-02-26 21:22:48 +01:00
commit fefd96c53a
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0
3 changed files with 20 additions and 5 deletions

View file

@ -1,4 +1,7 @@
## Static helper methods
import re
# Static helper methods
def parse_songs(results):
songs = []
@ -76,4 +79,11 @@ def parse_search_result(data, resultType = None):
def get_item_text(item, index):
return item['flexColumns'][index]['musicResponsiveListItemFlexColumnRenderer']['text']['runs'][0]['text']
return item['flexColumns'][index]['musicResponsiveListItemFlexColumnRenderer']['text']['runs'][0]['text']
def html_to_txt(html_text):
tags = re.findall("<[^>]+>",html_text)
for tag in tags:
html_text = html_text.replace(tag,'')
return html_text