jarif commited on
Commit
48c4ffc
·
verified ·
1 Parent(s): f8b6c23

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -46,7 +46,13 @@ def get_youtube_content(url):
46
  'format': 'worst',
47
  'extract_flat': True,
48
  'quiet': True,
49
- 'no_warnings': True
 
 
 
 
 
 
50
  }
51
 
52
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
@@ -72,7 +78,7 @@ Description:
72
  except Exception as e:
73
  st.error(f"Error getting YouTube content: {str(e)}")
74
  return None
75
-
76
  def get_website_content(url):
77
  """Get content from website using requests and BeautifulSoup"""
78
  try:
 
46
  'format': 'worst',
47
  'extract_flat': True,
48
  'quiet': True,
49
+ 'no_warnings': True,
50
+ 'extractor_args': {
51
+ 'youtube': {
52
+ 'skip': ['dash', 'hls'],
53
+ }
54
+ },
55
+ 'cookiesfrombrowser': ('chrome', ), # Get cookies from Chrome
56
  }
57
 
58
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
 
78
  except Exception as e:
79
  st.error(f"Error getting YouTube content: {str(e)}")
80
  return None
81
+
82
  def get_website_content(url):
83
  """Get content from website using requests and BeautifulSoup"""
84
  try: