I saved the show data from the epguide API in a txt file, which looks like this:
[{'epguide_name': 'gooddoctor', 'title': 'The Good Doctor', 'imdb_id': 'tt6470478', 'episodes': 'http://epguides.frecar.no/show/gooddoctor/', 'first_episode': 'http://epguides.frecar.no/show/gooddoctor/first/', 'next_episode': 'http://epguides.frecar.no/show/gooddoctor/next/', 'last_episode': 'http://epguides.frecar.no/show/gooddoctor/last/', 'epguides_url': 'http://www.epguides.com/gooddoctor'}]
When I now try to read it as a list in python it doesn't recognise it as such but only as a string despite the square brackets:
with open(file_shows, 'r', encoding='utf-8') as fs:
fs = fs.read()
print(type(fs))
print(next((item for item in list if item['title'] == show), None)['episodes'])
Type remains a str and thus the search is also not working. How can I convert the data "back" to a list?