ginipick commited on
Commit
acfe410
ยท
verified ยท
1 Parent(s): aab4c1c

Update my_functions.py

Browse files
Files changed (1) hide show
  1. my_functions.py +0 -27
my_functions.py CHANGED
@@ -1,6 +1,4 @@
1
  import yfinance as yf
2
- # youtube-search-python ์ถ”๊ฐ€ ์ž„ํฌํŠธ
3
- from youtubesearchpython import VideosSearch
4
 
5
  product_catalog = {
6
  "807ZPKBL9V": "SuperWidget",
@@ -23,28 +21,3 @@ def get_stock_price(ticker: str) -> float:
23
  return data['Close'].iloc[-1]
24
  return float('nan')
25
 
26
- def search_youtube(query: str) -> str:
27
- """
28
- Searches YouTube for the given query and returns top 3 video titles & links.
29
- """
30
- # youtube-search-python ์ด์šฉ
31
- try:
32
- videosSearch = VideosSearch(query, limit=3)
33
- results = videosSearch.result()["result"] # ์‹ค์ œ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ
34
-
35
- if not results:
36
- return "No videos found for your query."
37
-
38
- # ๊ฒฐ๊ณผ์—์„œ ํƒ€์ดํ‹€๊ณผ ๋งํฌ๋ฅผ ์ถ”์ถœ
39
- formatted_list = []
40
- for idx, item in enumerate(results, start=1):
41
- title = item.get("title", "No Title")
42
- link = item.get("link", "#")
43
- formatted_list.append(f"{idx}) [{title}]({link})")
44
-
45
- # ์—ฌ๋Ÿฌ ์ค„๋กœ ๋ฌถ์–ด์„œ ๋ฐ˜ํ™˜
46
- return "\n".join(formatted_list)
47
-
48
- except Exception as e:
49
- # ์–ด๋–ค ์—๋Ÿฌ๋“  ๋ฐœ์ƒ ์‹œ ์•ˆ์ „ํ•˜๊ฒŒ ๋ฉ”์‹œ์ง€ ๋ฐ˜ํ™˜
50
- return f"Error searching YouTube: {str(e)}"
 
1
  import yfinance as yf
 
 
2
 
3
  product_catalog = {
4
  "807ZPKBL9V": "SuperWidget",
 
21
  return data['Close'].iloc[-1]
22
  return float('nan')
23