vikramvasudevan commited on
Commit
4332a60
·
verified ·
1 Parent(s): 360354c

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -79,6 +79,12 @@ def index_channels(channel_urls: str):
79
  list_channels_radio(),
80
  )
81
 
 
 
 
 
 
 
82
 
83
  def refresh_all_channels():
84
  yt_api_key = os.environ["YOUTUBE_API_KEY"]
@@ -275,7 +281,8 @@ with gr.Blocks() as demo:
275
  "Aptitude Guru": "https://www.youtube.com/@AptitudeGuruHem",
276
  "Universe Genius": "https://www.youtube.com/@UniverseGenius",
277
  "Praveen Mohan": "https://www.youtube.com/@RealPraveenMohan",
278
- "Yathiraja Mutt" : "https://www.youtube.com/@SriYadugiriYathirajaMutt"
 
279
  }
280
 
281
  def set_example(label):
@@ -518,7 +525,10 @@ with gr.Blocks() as demo:
518
 
519
  def get_channel_choices(channel_list):
520
  return gr.update(choices=[("All Channels", None)] + channel_list)
521
- channel_list_state.change(get_channel_choices, inputs=[channel_list_state],outputs=[search_channel])
 
 
 
522
 
523
  prev_btn.click(
524
  prev_page,
@@ -532,14 +542,7 @@ with gr.Blocks() as demo:
532
  [modal_html, page_info, current_page],
533
  )
534
 
535
-
536
- def init():
537
- channels = "https://www.youtube.com/@onedayonepasuram6126,https://www.youtube.com/@srisookthi,https://www.youtube.com/@learn-aksharam"
538
- for resp in index_channels(channels):
539
- # print(resp)
540
- pass
541
-
542
-
543
  if __name__ == "__main__":
544
- # init()
 
545
  demo.launch()
 
79
  list_channels_radio(),
80
  )
81
 
82
+ def init(progress: gr.Progress = None):
83
+ channels = "https://www.youtube.com/@onedayonepasuram6126,https://www.youtube.com/@srisookthi,https://www.youtube.com/@learn-aksharam,https://www.youtube.com/@SriYadugiriYathirajaMutt,https://www.youtube.com/@akivasudev"
84
+ for (msg,upd,upd) in index_channels(channels):
85
+ # print(resp)
86
+ yield msg
87
+
88
 
89
  def refresh_all_channels():
90
  yt_api_key = os.environ["YOUTUBE_API_KEY"]
 
281
  "Aptitude Guru": "https://www.youtube.com/@AptitudeGuruHem",
282
  "Universe Genius": "https://www.youtube.com/@UniverseGenius",
283
  "Praveen Mohan": "https://www.youtube.com/@RealPraveenMohan",
284
+ "Yathiraja Mutt": "https://www.youtube.com/@SriYadugiriYathirajaMutt",
285
+ "Vasudevan Srinivasachariar": "https://www.youtube.com/@akivasudev",
286
  }
287
 
288
  def set_example(label):
 
525
 
526
  def get_channel_choices(channel_list):
527
  return gr.update(choices=[("All Channels", None)] + channel_list)
528
+
529
+ channel_list_state.change(
530
+ get_channel_choices, inputs=[channel_list_state], outputs=[search_channel]
531
+ )
532
 
533
  prev_btn.click(
534
  prev_page,
 
542
  [modal_html, page_info, current_page],
543
  )
544
 
 
 
 
 
 
 
 
 
545
  if __name__ == "__main__":
546
+ for msg in init():
547
+ print(msg)
548
  demo.launch()