webscout 6.5__py3-none-any.whl → 6.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of webscout might be problematic. Click here for more details.

Files changed (70) hide show
  1. webscout/Extra/autocoder/autocoder_utiles.py +119 -101
  2. webscout/Extra/weather.py +5 -5
  3. webscout/Provider/AISEARCH/__init__.py +2 -0
  4. webscout/Provider/AISEARCH/ooai.py +155 -0
  5. webscout/Provider/Amigo.py +70 -85
  6. webscout/Provider/{prefind.py → Jadve.py} +72 -70
  7. webscout/Provider/Netwrck.py +239 -0
  8. webscout/Provider/Openai.py +4 -3
  9. webscout/Provider/PI.py +2 -2
  10. webscout/Provider/PizzaGPT.py +3 -3
  11. webscout/Provider/TeachAnything.py +15 -2
  12. webscout/Provider/Youchat.py +42 -8
  13. webscout/Provider/__init__.py +134 -147
  14. webscout/Provider/meta.py +1 -1
  15. webscout/Provider/multichat.py +230 -0
  16. webscout/Provider/promptrefine.py +2 -2
  17. webscout/Provider/talkai.py +10 -13
  18. webscout/Provider/turboseek.py +5 -4
  19. webscout/Provider/tutorai.py +8 -112
  20. webscout/Provider/typegpt.py +4 -5
  21. webscout/Provider/x0gpt.py +81 -9
  22. webscout/Provider/yep.py +123 -361
  23. webscout/__init__.py +10 -1
  24. webscout/cli.py +31 -39
  25. webscout/conversation.py +24 -9
  26. webscout/exceptions.py +188 -20
  27. webscout/litprinter/__init__.py +19 -123
  28. webscout/litprinter/colors.py +54 -0
  29. webscout/optimizers.py +335 -185
  30. webscout/scout/__init__.py +2 -5
  31. webscout/scout/core/__init__.py +7 -0
  32. webscout/scout/core/crawler.py +140 -0
  33. webscout/scout/core/scout.py +571 -0
  34. webscout/scout/core/search_result.py +96 -0
  35. webscout/scout/core/text_analyzer.py +63 -0
  36. webscout/scout/core/text_utils.py +277 -0
  37. webscout/scout/core/web_analyzer.py +52 -0
  38. webscout/scout/element.py +6 -5
  39. webscout/update_checker.py +117 -58
  40. webscout/version.py +1 -1
  41. webscout/webscout_search.py +1 -1
  42. webscout/zeroart/base.py +15 -16
  43. webscout/zeroart/effects.py +1 -1
  44. webscout/zeroart/fonts.py +1 -1
  45. {webscout-6.5.dist-info → webscout-6.7.dist-info}/METADATA +9 -172
  46. {webscout-6.5.dist-info → webscout-6.7.dist-info}/RECORD +63 -45
  47. {webscout-6.5.dist-info → webscout-6.7.dist-info}/entry_points.txt +1 -1
  48. webscout-6.7.dist-info/top_level.txt +2 -0
  49. webstoken/__init__.py +30 -0
  50. webstoken/classifier.py +189 -0
  51. webstoken/keywords.py +216 -0
  52. webstoken/language.py +128 -0
  53. webstoken/ner.py +164 -0
  54. webstoken/normalizer.py +35 -0
  55. webstoken/processor.py +77 -0
  56. webstoken/sentiment.py +206 -0
  57. webstoken/stemmer.py +73 -0
  58. webstoken/t.py +75 -0
  59. webstoken/tagger.py +60 -0
  60. webstoken/tokenizer.py +158 -0
  61. webscout/Provider/Perplexity.py +0 -591
  62. webscout/Provider/RoboCoders.py +0 -206
  63. webscout/Provider/genspark.py +0 -225
  64. webscout/Provider/perplexitylabs.py +0 -265
  65. webscout/Provider/twitterclone.py +0 -251
  66. webscout/Provider/upstage.py +0 -230
  67. webscout-6.5.dist-info/top_level.txt +0 -1
  68. /webscout/Provider/{felo_search.py → AISEARCH/felo_search.py} +0 -0
  69. {webscout-6.5.dist-info → webscout-6.7.dist-info}/LICENSE.md +0 -0
  70. {webscout-6.5.dist-info → webscout-6.7.dist-info}/WHEEL +0 -0
webscout/cli.py CHANGED
@@ -54,7 +54,7 @@ def _print_data(data):
54
54
  console = Console()
55
55
  if data:
56
56
  for i, e in enumerate(data, start=1):
57
- table = Table(show_header=False, show_lines=True, expand=True, box=None) # Removed duplicate title
57
+ table = Table(show_header=False, show_lines=True, expand=True, box=None)
58
58
  table.add_column("Key", style="cyan", no_wrap=True, width=15)
59
59
  table.add_column("Value", style="white")
60
60
 
@@ -62,15 +62,14 @@ def _print_data(data):
62
62
  if v:
63
63
  width = 300 if k in ("content", "href", "image", "source", "thumbnail", "url") else 78
64
64
  k = "language" if k == "detected_language" else k
65
- text = Text(f"{v}", style="white")
66
- text = text.wrap(width=width, initial_indent="", subsequent_indent=" " * 18, preserve_paragraphs=True)
65
+ text = Text(str(v), style="white")
66
+ text = text.wrap(width=width, console=console)
67
67
  else:
68
- text = Text(v, style="white")
68
+ text = Text(str(v), style="white")
69
69
  table.add_row(k, text)
70
70
 
71
- # Only the Panel has the title now
72
71
  console.print(Panel(table, title=f"Result {i}", expand=False, style="green on black"))
73
- console.print("\n")
72
+ console.print("\n")
74
73
 
75
74
  # Initialize CLI app
76
75
  app = CLI(name="webscout", help="Search the web with a rich UI", version=__version__)
@@ -117,7 +116,7 @@ def chat(proxy: str = None, model: str = "gpt-4o-mini"):
117
116
  console.print("\n[cyan]Chat session ended. Goodbye![/]")
118
117
 
119
118
  @app.command()
120
- @option("--keywords", "-k", help="Search keywords")
119
+ @option("--keywords", "-k", help="Search keywords", required=True)
121
120
  @option("--region", "-r", help="Region for search results", default="wt-wt")
122
121
  @option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
123
122
  @option("--timelimit", "-t", help="Time limit for results", default=None)
@@ -128,29 +127,27 @@ def text(keywords: str, region: str, safesearch: str, timelimit: str, backend: s
128
127
  """Perform a text search using DuckDuckGo API."""
129
128
  webs = WEBS(proxy=proxy)
130
129
  try:
131
- webs.text(keywords, region, safesearch, timelimit, backend, max_results)
130
+ results = webs.text(keywords, region, safesearch, timelimit, backend, max_results)
131
+ _print_data(results)
132
132
  except Exception as e:
133
133
  logger.error(f"Error in text search: {e}")
134
134
  raise e
135
135
 
136
136
  @app.command()
137
- @option("--keywords", "-k", help="Search keywords")
138
- @option("--region", "-r", help="Region for search results", default="wt-wt")
139
- @option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
140
- @option("--timelimit", "-t", help="Time limit for results", default=None)
141
- @option("--max-results", "-m", help="Maximum number of results", type=int, default=25)
137
+ @option("--keywords", "-k", help="Search keywords", required=True)
142
138
  @option("--proxy", "-p", help="Proxy URL to use for requests")
143
- def answers(keywords: str, region: str, safesearch: str, timelimit: str, max_results: int, proxy: str = None):
139
+ def answers(keywords: str, proxy: str = None):
144
140
  """Perform an answers search using DuckDuckGo API."""
145
141
  webs = WEBS(proxy=proxy)
146
142
  try:
147
- webs.answers(keywords, region, safesearch, timelimit, max_results)
143
+ results = webs.answers(keywords)
144
+ _print_data(results)
148
145
  except Exception as e:
149
146
  logger.error(f"Error in answers search: {e}")
150
147
  raise e
151
148
 
152
149
  @app.command()
153
- @option("--keywords", "-k", help="Search keywords")
150
+ @option("--keywords", "-k", help="Search keywords", required=True)
154
151
  @option("--region", "-r", help="Region for search results", default="wt-wt")
155
152
  @option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
156
153
  @option("--timelimit", "-t", help="Time limit for results", default=None)
@@ -177,13 +174,14 @@ def images(
177
174
  """Perform an images search using DuckDuckGo API."""
178
175
  webs = WEBS(proxy=proxy)
179
176
  try:
180
- webs.images(keywords, region, safesearch, timelimit, size, color, type, layout, license, max_results)
177
+ results = webs.images(keywords, region, safesearch, timelimit, size, color, type, layout, license, max_results)
178
+ _print_data(results)
181
179
  except Exception as e:
182
180
  logger.error(f"Error in images search: {e}")
183
181
  raise e
184
182
 
185
183
  @app.command()
186
- @option("--keywords", "-k", help="Search keywords")
184
+ @option("--keywords", "-k", help="Search keywords", required=True)
187
185
  @option("--region", "-r", help="Region for search results", default="wt-wt")
188
186
  @option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
189
187
  @option("--timelimit", "-t", help="Time limit for results", default=None)
@@ -206,13 +204,14 @@ def videos(
206
204
  """Perform a videos search using DuckDuckGo API."""
207
205
  webs = WEBS(proxy=proxy)
208
206
  try:
209
- webs.videos(keywords, region, safesearch, timelimit, resolution, duration, license, max_results)
207
+ results = webs.videos(keywords, region, safesearch, timelimit, resolution, duration, license, max_results)
208
+ _print_data(results)
210
209
  except Exception as e:
211
210
  logger.error(f"Error in videos search: {e}")
212
211
  raise e
213
212
 
214
213
  @app.command()
215
- @option("--keywords", "-k", help="Search keywords")
214
+ @option("--keywords", "-k", help="Search keywords", required=True)
216
215
  @option("--region", "-r", help="Region for search results", default="wt-wt")
217
216
  @option("--safesearch", "-s", help="SafeSearch setting", default="moderate")
218
217
  @option("--timelimit", "-t", help="Time limit for results", default=None)
@@ -222,13 +221,14 @@ def news(keywords: str, region: str, safesearch: str, timelimit: str, max_result
222
221
  """Perform a news search using DuckDuckGo API."""
223
222
  webs = WEBS(proxy=proxy)
224
223
  try:
225
- webs.news(keywords, region, safesearch, timelimit, max_results)
224
+ results = webs.news(keywords, region, safesearch, timelimit, max_results)
225
+ _print_data(results)
226
226
  except Exception as e:
227
227
  logger.error(f"Error in news search: {e}")
228
228
  raise e
229
229
 
230
230
  @app.command()
231
- @option("--keywords", "-k", help="Search keywords")
231
+ @option("--keywords", "-k", help="Search keywords", required=True)
232
232
  @option("--place", "-p", help="Simplified search - if set, the other parameters are not used")
233
233
  @option("--street", "-s", help="House number/street")
234
234
  @option("--city", "-c", help="City of search")
@@ -259,7 +259,7 @@ def maps(
259
259
  """Perform a maps search using DuckDuckGo API."""
260
260
  webs = WEBS(proxy=proxy)
261
261
  try:
262
- webs.maps(
262
+ results = webs.maps(
263
263
  keywords,
264
264
  place,
265
265
  street,
@@ -273,12 +273,13 @@ def maps(
273
273
  radius,
274
274
  max_results,
275
275
  )
276
+ _print_data(results)
276
277
  except Exception as e:
277
278
  logger.error(f"Error in maps search: {e}")
278
279
  raise e
279
280
 
280
281
  @app.command()
281
- @option("--keywords", "-k", help="Text for translation")
282
+ @option("--keywords", "-k", help="Text for translation", required=True)
282
283
  @option("--from", "-f", help="Language to translate from (defaults automatically)")
283
284
  @option("--to", "-t", help="Language to translate to (default: 'en')", default="en")
284
285
  @option("--proxy", "-p", help="Proxy URL to use for requests")
@@ -286,35 +287,26 @@ def translate(keywords: str, from_: str, to: str, proxy: str = None):
286
287
  """Perform translation using DuckDuckGo API."""
287
288
  webs = WEBS(proxy=proxy)
288
289
  try:
289
- webs.translate(keywords, from_, to)
290
+ results = webs.translate(keywords, from_, to)
291
+ _print_data(results)
290
292
  except Exception as e:
291
293
  logger.error(f"Error in translation: {e}")
292
294
  raise e
293
295
 
294
296
  @app.command()
295
- @option("--keywords", "-k", help="Search keywords")
297
+ @option("--keywords", "-k", help="Search keywords", required=True)
296
298
  @option("--region", "-r", help="Region for search results", default="wt-wt")
297
299
  @option("--proxy", "-p", help="Proxy URL to use for requests")
298
300
  def suggestions(keywords: str, region: str, proxy: str = None):
299
301
  """Perform a suggestions search using DuckDuckGo API."""
300
302
  webs = WEBS(proxy=proxy)
301
303
  try:
302
- webs.suggestions(keywords, region)
304
+ results = webs.suggestions(keywords, region)
305
+ _print_data(results)
303
306
  except Exception as e:
304
307
  logger.error(f"Error in suggestions search: {e}")
305
308
  raise e
306
309
 
307
- @app.command()
308
- @option("--proxy", help="Proxy URL to use for requests")
309
- def interactive(proxy: str = None):
310
- """Start an interactive search session with AI-powered responses."""
311
- webs = WEBS(proxy=proxy)
312
- try:
313
- webs.interactive()
314
- except Exception as e:
315
- logger.error(f"Error in interactive mode: {e}")
316
- raise e
317
-
318
310
  def main():
319
311
  """Main entry point for the CLI."""
320
312
  try:
@@ -324,4 +316,4 @@ def main():
324
316
  sys.exit(1)
325
317
 
326
318
  if __name__ == "__main__":
327
- main()
319
+ main()
webscout/conversation.py CHANGED
@@ -1,11 +1,3 @@
1
- """
2
- >>> from conversation import Conversation
3
- >>> chat = Conversation(max_tokens=500)
4
- >>> chat.add_message("user", "Hello!")
5
- >>> chat.add_message("llm", "Hi there!")
6
- >>> prompt = chat.gen_complete_prompt("What's up?")
7
- """
8
-
9
1
  import os
10
2
  import logging
11
3
  from typing import Optional
@@ -159,7 +151,9 @@ class Conversation:
159
151
  "user": prompt,
160
152
  "llm": ""
161
153
  }
162
- return intro + self.__trim_chat_history(incomplete_chat_history, intro)
154
+ complete_prompt = intro + self.__trim_chat_history(incomplete_chat_history, intro)
155
+ # logger.info(f"Generated prompt: {complete_prompt}")
156
+ return complete_prompt
163
157
 
164
158
  def update_chat_history(
165
159
  self, prompt: str, response: str, force: bool = False
@@ -196,6 +190,7 @@ class Conversation:
196
190
  fh.write(new_history)
197
191
 
198
192
  self.chat_history += new_history
193
+ # logger.info(f"Chat history updated with prompt: {prompt}")
199
194
 
200
195
  def add_message(self, role: str, content: str) -> None:
201
196
  """Add a new message to the chat - simple and clean!
@@ -214,6 +209,9 @@ class Conversation:
214
209
  >>> chat.add_message("user", "Hey there!")
215
210
  >>> chat.add_message("llm", "Hi! How can I help?")
216
211
  """
212
+ if not self.validate_message(role, content):
213
+ raise ValueError("Invalid message role or content")
214
+
217
215
  role_formats = {
218
216
  "user": "User",
219
217
  "llm": "LLM",
@@ -225,3 +223,20 @@ class Conversation:
225
223
  self.chat_history += f"\n{role_formats[role]} : {content}"
226
224
  else:
227
225
  logger.warning(f"Unknown role '{role}' for message: {content}")
226
+
227
+ # # Enhanced logging for message addition
228
+ # logger.info(f"Added message from {role}: {content}")
229
+ # logging.info(f"Message added: {role}: {content}")
230
+
231
+ # def validate_message(self, role: str, content: str) -> bool:
232
+ # """Validate the message role and content."""
233
+ # valid_roles = {'user', 'llm', 'tool', 'reasoning'}
234
+ # if role not in valid_roles:
235
+ # logger.error(f"Invalid role: {role}")
236
+ # return False
237
+ # if not content:
238
+ # logger.error("Content cannot be empty.")
239
+ # return False
240
+ # return True
241
+
242
+
webscout/exceptions.py CHANGED
@@ -1,48 +1,117 @@
1
+ WATCH_URL = 'https://www.youtube.com/watch?v={video_id}'
2
+
3
+
1
4
  class WebscoutE(Exception):
2
- """Base exception class for search."""
5
+ """
6
+ Base exception class for all Webscout related errors.
7
+
8
+ This class serves as the root for all custom exceptions raised by the Webscout library.
9
+ It provides a common base for catching and handling errors specific to Webscout.
10
+ """
11
+ pass
3
12
 
4
13
 
5
14
  class APIConnectionError(Exception):
6
- """Raised when there are connection issues with an API."""
15
+ """
16
+ Exception raised when there are issues connecting to an API.
17
+
18
+ This exception is raised when a network connection to an external API fails.
19
+ It indicates a problem with the network or the API server itself.
20
+ """
7
21
  pass
8
22
 
9
23
 
10
24
  class RatelimitE(Exception):
11
- """Raised for rate limit exceeded errors during API requests."""
25
+ """
26
+ Exception raised when an API rate limit is exceeded.
27
+
28
+ This exception is raised when the number of requests to an API exceeds the allowed limit within a given time frame.
29
+ It indicates that the application is making too many requests and needs to slow down.
30
+ """
31
+ pass
12
32
 
13
33
 
14
34
  class ConversationLimitException(Exception):
15
- """Raised for conversation limit exceeded errors during API requests."""
35
+ """
36
+ Exception raised when a conversation limit is exceeded.
37
+
38
+ This exception is raised when a limit on the number of turns or messages in a conversation is exceeded.
39
+ It indicates that the conversation has reached its maximum allowed length.
40
+ """
16
41
  pass
17
42
 
18
43
 
19
44
  class TimeoutE(Exception):
20
- """Raised for timeout errors during API requests."""
45
+ """
46
+ Exception raised when a request to an API times out.
47
+
48
+ This exception is raised when a request to an API takes longer than the allowed time to complete.
49
+ It indicates a problem with the network or the API server being slow to respond.
50
+ """
51
+ pass
21
52
 
22
53
 
23
54
  class FailedToGenerateResponseError(Exception):
24
- """Provider failed to fetch response"""
55
+ """
56
+ Exception raised when a provider fails to generate a response.
57
+
58
+ This exception is raised when a provider is unable to generate a response for a given request.
59
+ It indicates an issue with the provider's logic or data.
60
+ """
61
+ pass
25
62
 
26
63
 
27
64
  class AllProvidersFailure(Exception):
28
- """None of the providers generated response successfully"""
65
+ """
66
+ Exception raised when all providers fail to generate a response.
67
+
68
+ This exception is raised when none of the available providers are able to generate a response for a given request.
69
+ It indicates a widespread issue with all providers.
70
+ """
29
71
  pass
30
72
 
31
73
 
32
74
  class FacebookInvalidCredentialsException(Exception):
75
+ """
76
+ Exception raised when Facebook credentials are invalid.
77
+
78
+ This exception is raised when the provided Facebook credentials (e.g., username, password, cookies) are invalid.
79
+ It indicates that the application is unable to authenticate with Facebook.
80
+ """
33
81
  pass
34
82
 
35
83
 
36
84
  class FacebookRegionBlocked(Exception):
85
+ """
86
+ Exception raised when Facebook access is blocked due to region restrictions.
87
+
88
+ This exception is raised when access to Facebook is blocked due to geographical restrictions.
89
+ It indicates that the application is unable to access Facebook from the current location.
90
+ """
37
91
  pass
38
92
 
39
93
 
40
94
  class ModelUnloadedException(Exception):
95
+ """
96
+ Exception raised when a model is unloaded.
97
+
98
+ This exception is raised when a required model is not loaded or has been unloaded.
99
+ It indicates that the application is unable to perform operations that require the model.
100
+ """
41
101
  pass
42
102
 
43
103
 
44
104
  class TranscriptRetrievalError(WebscoutE):
45
- """Base class for transcript retrieval errors."""
105
+ """
106
+ Base class for transcript retrieval errors.
107
+
108
+ This class serves as the root for all custom exceptions related to transcript retrieval.
109
+ It provides a common base for catching and handling errors specific to transcript retrieval.
110
+
111
+ Args:
112
+ video_id (str): The ID of the video for which the transcript retrieval failed.
113
+ message (str): A message describing the error.
114
+ """
46
115
 
47
116
  def __init__(self, video_id, message):
48
117
  super().__init__(message.format(video_url=WATCH_URL.format(video_id=video_id)))
@@ -50,7 +119,16 @@ class TranscriptRetrievalError(WebscoutE):
50
119
 
51
120
 
52
121
  class YouTubeRequestFailedError(TranscriptRetrievalError):
53
- """Raised when a request to YouTube fails."""
122
+ """
123
+ Exception raised when a request to YouTube fails.
124
+
125
+ This exception is raised when a network request to YouTube fails.
126
+ It indicates a problem with the network or the YouTube server itself.
127
+
128
+ Args:
129
+ video_id (str): The ID of the video for which the request failed.
130
+ http_error (str): The HTTP error that occurred.
131
+ """
54
132
 
55
133
  def __init__(self, video_id, http_error):
56
134
  message = 'Request to YouTube failed: {reason}'
@@ -58,7 +136,15 @@ class YouTubeRequestFailedError(TranscriptRetrievalError):
58
136
 
59
137
 
60
138
  class VideoUnavailableError(TranscriptRetrievalError):
61
- """Raised when the video is unavailable."""
139
+ """
140
+ Exception raised when the video is unavailable.
141
+
142
+ This exception is raised when the requested video is no longer available on YouTube.
143
+ It indicates that the video has been removed or made private.
144
+
145
+ Args:
146
+ video_id (str): The ID of the unavailable video.
147
+ """
62
148
 
63
149
  def __init__(self, video_id):
64
150
  message = 'The video is no longer available'
@@ -66,7 +152,15 @@ class VideoUnavailableError(TranscriptRetrievalError):
66
152
 
67
153
 
68
154
  class InvalidVideoIdError(TranscriptRetrievalError):
69
- """Raised when an invalid video ID is provided."""
155
+ """
156
+ Exception raised when an invalid video ID is provided.
157
+
158
+ This exception is raised when the provided video ID is not in the correct format.
159
+ It indicates that the application is using a URL instead of the video ID.
160
+
161
+ Args:
162
+ video_id (str): The invalid video ID.
163
+ """
70
164
 
71
165
  def __init__(self, video_id):
72
166
  message = (
@@ -78,7 +172,15 @@ class InvalidVideoIdError(TranscriptRetrievalError):
78
172
 
79
173
 
80
174
  class TooManyRequestsError(TranscriptRetrievalError):
81
- """Raised when YouTube rate limits the requests."""
175
+ """
176
+ Exception raised when YouTube rate limits the requests.
177
+
178
+ This exception is raised when YouTube rate limits the requests from the current IP address.
179
+ It indicates that the application is making too many requests and needs to slow down or use a different IP.
180
+
181
+ Args:
182
+ video_id (str): The ID of the video for which the request was rate-limited.
183
+ """
82
184
 
83
185
  def __init__(self, video_id):
84
186
  message = (
@@ -92,7 +194,15 @@ class TooManyRequestsError(TranscriptRetrievalError):
92
194
 
93
195
 
94
196
  class TranscriptsDisabledError(TranscriptRetrievalError):
95
- """Raised when transcripts are disabled for the video."""
197
+ """
198
+ Exception raised when transcripts are disabled for the video.
199
+
200
+ This exception is raised when the video has subtitles disabled.
201
+ It indicates that the application cannot retrieve transcripts for this video.
202
+
203
+ Args:
204
+ video_id (str): The ID of the video with disabled transcripts.
205
+ """
96
206
 
97
207
  def __init__(self, video_id):
98
208
  message = 'Subtitles are disabled for this video'
@@ -100,7 +210,15 @@ class TranscriptsDisabledError(TranscriptRetrievalError):
100
210
 
101
211
 
102
212
  class NoTranscriptAvailableError(TranscriptRetrievalError):
103
- """Raised when no transcripts are available for the video."""
213
+ """
214
+ Exception raised when no transcripts are available for the video.
215
+
216
+ This exception is raised when the video has no transcripts available.
217
+ It indicates that the application cannot retrieve transcripts for this video.
218
+
219
+ Args:
220
+ video_id (str): The ID of the video with no available transcripts.
221
+ """
104
222
 
105
223
  def __init__(self, video_id):
106
224
  message = 'No transcripts are available for this video'
@@ -108,7 +226,15 @@ class NoTranscriptAvailableError(TranscriptRetrievalError):
108
226
 
109
227
 
110
228
  class NotTranslatableError(TranscriptRetrievalError):
111
- """Raised when the transcript is not translatable."""
229
+ """
230
+ Exception raised when the transcript is not translatable.
231
+
232
+ This exception is raised when the requested language is not translatable.
233
+ It indicates that the application cannot translate the transcript to the requested language.
234
+
235
+ Args:
236
+ video_id (str): The ID of the video with a non-translatable transcript.
237
+ """
112
238
 
113
239
  def __init__(self, video_id):
114
240
  message = 'The requested language is not translatable'
@@ -116,7 +242,15 @@ class NotTranslatableError(TranscriptRetrievalError):
116
242
 
117
243
 
118
244
  class TranslationLanguageNotAvailableError(TranscriptRetrievalError):
119
- """Raised when the requested translation language is not available."""
245
+ """
246
+ Exception raised when the requested translation language is not available.
247
+
248
+ This exception is raised when the requested translation language is not supported for the transcript.
249
+ It indicates that the application cannot translate the transcript to the requested language.
250
+
251
+ Args:
252
+ video_id (str): The ID of the video for which the translation language is not available.
253
+ """
120
254
 
121
255
  def __init__(self, video_id):
122
256
  message = 'The requested translation language is not available'
@@ -124,7 +258,15 @@ class TranslationLanguageNotAvailableError(TranscriptRetrievalError):
124
258
 
125
259
 
126
260
  class CookiePathInvalidError(TranscriptRetrievalError):
127
- """Raised when the cookie path is invalid."""
261
+ """
262
+ Exception raised when the cookie path is invalid.
263
+
264
+ This exception is raised when the provided cookie path is invalid.
265
+ It indicates that the application cannot access the cookie file.
266
+
267
+ Args:
268
+ video_id (str): The ID of the video for which the cookie path is invalid.
269
+ """
128
270
 
129
271
  def __init__(self, video_id):
130
272
  message = 'The provided cookie path is invalid'
@@ -132,7 +274,15 @@ class CookiePathInvalidError(TranscriptRetrievalError):
132
274
 
133
275
 
134
276
  class CookiesInvalidError(TranscriptRetrievalError):
135
- """Raised when the provided cookies are invalid."""
277
+ """
278
+ Exception raised when the provided cookies are invalid.
279
+
280
+ This exception is raised when the provided cookies are not valid or have expired.
281
+ It indicates that the application cannot authenticate with YouTube using the provided cookies.
282
+
283
+ Args:
284
+ video_id (str): The ID of the video for which the cookies are invalid.
285
+ """
136
286
 
137
287
  def __init__(self, video_id):
138
288
  message = 'The cookies provided are not valid (may have expired)'
@@ -140,7 +290,15 @@ class CookiesInvalidError(TranscriptRetrievalError):
140
290
 
141
291
 
142
292
  class FailedToCreateConsentCookieError(TranscriptRetrievalError):
143
- """Raised when consent cookie creation fails."""
293
+ """
294
+ Exception raised when consent cookie creation fails.
295
+
296
+ This exception is raised when the application fails to automatically give consent to saving cookies.
297
+ It indicates that the application cannot proceed without the consent cookie.
298
+
299
+ Args:
300
+ video_id (str): The ID of the video for which the consent cookie creation failed.
301
+ """
144
302
 
145
303
  def __init__(self, video_id):
146
304
  message = 'Failed to automatically give consent to saving cookies'
@@ -148,7 +306,17 @@ class FailedToCreateConsentCookieError(TranscriptRetrievalError):
148
306
 
149
307
 
150
308
  class NoTranscriptFoundError(TranscriptRetrievalError):
151
- """Raised when no transcript is found for the requested language codes."""
309
+ """
310
+ Exception raised when no transcript is found for the requested language codes.
311
+
312
+ This exception is raised when no transcripts are found for any of the requested language codes.
313
+ It indicates that the application cannot retrieve transcripts for the requested languages.
314
+
315
+ Args:
316
+ video_id (str): The ID of the video for which no transcript was found.
317
+ requested_language_codes (list): The list of requested language codes.
318
+ transcript_data (dict): The transcript data that was found.
319
+ """
152
320
 
153
321
  def __init__(self, video_id, requested_language_codes, transcript_data):
154
322
  message = (