bpHigh commited on
Commit
4966db5
1 Parent(s): 864502a

Update search_recommend.py

Browse files
Files changed (1) hide show
  1. search_recommend.py +3 -3
search_recommend.py CHANGED
@@ -8,7 +8,7 @@ api_key = os.environ['LISTENNOTES']
8
  def search(query):
9
  client = podcast_api.Client(api_key=api_key)
10
  response = client.search(
11
- q=query, sort_by_date=0, only_in='title,description', offset=5, type='episode')
12
 
13
  results = response.json()
14
  results_final = results['results']
@@ -17,7 +17,7 @@ def search(query):
17
  for item in results_final:
18
  final_string += f"{number}. "
19
  final_string += f"Podcast ID:-{item['id']}\n"
20
- final_string += f"Link:-{item['link']}\n"
21
  final_string += f"Title:-{item['title_original']}\n"
22
  final_string += f"![{item['title_highlighted']}]({item['thumbnail']} '{item['title_original']}')\n\n"
23
  final_string += "\n\n"
@@ -45,7 +45,7 @@ def get_podcast_title(podcast_id):
45
  client = podcast_api.Client(api_key=api_key)
46
  response = client.fetch_podcast_by_id(id=podcast_id)
47
  result = response.json()
48
- results_final = results["title"]
49
  return results_final
50
 
51
 
 
8
  def search(query):
9
  client = podcast_api.Client(api_key=api_key)
10
  response = client.search(
11
+ q=query, sort_by_date=0, only_in='title,description', offset=5, type='podcast')
12
 
13
  results = response.json()
14
  results_final = results['results']
 
17
  for item in results_final:
18
  final_string += f"{number}. "
19
  final_string += f"Podcast ID:-{item['id']}\n"
20
+ final_string += f"Link:-{item['listennotes_url']}\n"
21
  final_string += f"Title:-{item['title_original']}\n"
22
  final_string += f"![{item['title_highlighted']}]({item['thumbnail']} '{item['title_original']}')\n\n"
23
  final_string += "\n\n"
 
45
  client = podcast_api.Client(api_key=api_key)
46
  response = client.fetch_podcast_by_id(id=podcast_id)
47
  result = response.json()
48
+ results_final = result["title"]
49
  return results_final
50
 
51