py-youtube-search 0.2.2__tar.gz → 0.2.3__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-youtube-search
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A lightweight, regex-based YouTube search library without API keys.
5
5
  Home-page: https://github.com/VishvaRam/py-youtube-search
6
6
  Author: VishvaRam
@@ -28,8 +28,8 @@ class YouTubeSearch:
28
28
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
29
29
  }
30
30
 
31
- async def _fetch_source(self, keywords: str, sp: str = None):
32
- params = {"search_query": keywords.replace(" ", "+")}
31
+ async def _fetch_source(self, query: str, sp: str = None):
32
+ params = {"search_query": query.replace(" ", "+")}
33
33
  if sp:
34
34
  params["sp"] = sp
35
35
 
@@ -37,19 +37,19 @@ class YouTubeSearch:
37
37
  async with session.get(self.base_url, params=params, headers=self.headers) as response:
38
38
  return await response.text()
39
39
 
40
- async def search(self, keywords: str, sp: str = None, limit: int = 15):
40
+ async def search(self, query: str, sp: str = None, limit: int = 15):
41
41
  """
42
- Asynchronously fetches and parses search results for the given keywords.
42
+ Asynchronously fetches and parses search results for the given query.
43
43
 
44
44
  Args:
45
- keywords (str): The search query.
45
+ query (str): The search query.
46
46
  sp (str, optional): The filter string (use Filters class). Defaults to None.
47
47
  limit (int, optional): Max number of results. Defaults to 15.
48
48
 
49
49
  Returns:
50
50
  list: A list of dictionaries containing video details.
51
51
  """
52
- source = await self._fetch_source(keywords, sp)
52
+ source = await self._fetch_source(query, sp)
53
53
 
54
54
  # Regex to capture distinct JSON fields for ID, Title, Duration, and Views.
55
55
  pattern = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py-youtube-search
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A lightweight, regex-based YouTube search library without API keys.
5
5
  Home-page: https://github.com/VishvaRam/py-youtube-search
6
6
  Author: VishvaRam
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="py-youtube-search",
8
- version="0.2.2",
8
+ version="0.2.3",
9
9
  author="VishvaRam",
10
10
  install_requires=[
11
11
  "aiohttp>=3.8.0",