py-youtube-search 0.2.0__tar.gz → 0.2.1__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.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: py-youtube-search
3
+ Version: 0.2.1
4
+ Summary: A lightweight, regex-based YouTube search library without API keys.
5
+ Home-page: https://github.com/VishvaRam/py-youtube-search
6
+ Author: VishvaRam
7
+ Author-email: murthyvishva@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: classifier
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: requires-python
20
+ Dynamic: summary
21
+
22
+
23
+ # py-youtube-search
24
+
25
+ A lightweight, asynchronous Python library to search YouTube videos programmatically without an API key.
26
+ It scrapes search results using `aiohttp` and `re`, making it fast, robust, and perfect for high-performance applications.
27
+
28
+ ## Features
29
+
30
+ - **Async Support**: Fully asynchronous using `aiohttp` for non-blocking execution.
31
+ - **No API Key Required**: Search YouTube directly without setting up Google Cloud projects.
32
+ - **Advanced Filtering**: Built-in support for duration (Medium 3-20m, Long >20m) and upload date filters.
33
+ - **Rich Data Extraction**: Extracts Video ID, Title, Duration, and View Count using optimized regex.
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ pip install py-youtube-search
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ### 1. Basic Async Search
44
+ Fetch the top results for any keyword asynchronously.
45
+
46
+ ```python
47
+ import asyncio
48
+ from py_youtube_search import YouTubeSearch
49
+
50
+ async def main():
51
+ # 1. Initialize the search (no network call yet)
52
+ yt = YouTubeSearch("Python async tutorials", limit=5)
53
+
54
+ # 2. Await the search results
55
+ videos = await yt.search()
56
+
57
+ for v in videos:
58
+ print(f"Title: {v['title']}")
59
+ print(f"Duration: {v['duration']}")
60
+ print(f"Views: {v['views']}")
61
+ print(f"Link: https://www.youtube.com/watch?v={v['id']}\n")
62
+
63
+ if __name__ == "__main__":
64
+ asyncio.run(main())
65
+ ```
66
+
67
+ ### 2. Advanced Search with Filters
68
+ Search for specific content, like long-form videos (>20m) uploaded this week.
69
+
70
+ ```python
71
+ import asyncio
72
+ from py_youtube_search import YouTubeSearch, Filters
73
+
74
+ async def main():
75
+ # Use the Filters class for readable constants
76
+ yt = YouTubeSearch("LangGraph", sp=Filters.long_this_week, limit=3)
77
+
78
+ videos = await yt.search()
79
+
80
+ for v in videos:
81
+ print(f"🎥 {v['title']} | ⏱ {v['duration']} | 👁 {v['views']}")
82
+
83
+ if __name__ == "__main__":
84
+ asyncio.run(main())
85
+ ```
86
+
87
+ ## Available Filters
88
+
89
+ Pass these constants into the `sp` parameter of `YouTubeSearch`.
90
+
91
+ ### Duration: Medium (3 - 20 Minutes)
92
+ | Filter Attribute | Description |
93
+ | :--- | :--- |
94
+ | `Filters.medium_today` | Uploaded **Today** |
95
+ | `Filters.medium_this_week` | Uploaded **This Week** |
96
+ | `Filters.medium_this_month` | Uploaded **This Month** |
97
+ | `Filters.medium_this_year` | Uploaded **This Year** |
98
+
99
+ ### Duration: Long (Over 20 Minutes)
100
+ | Filter Attribute | Description |
101
+ | :--- | :--- |
102
+ | `Filters.long_today` | Uploaded **Today** |
103
+ | `Filters.long_this_week` | Uploaded **This Week** |
104
+ | `Filters.long_this_month` | Uploaded **This Month** |
105
+ | `Filters.long_this_year` | Uploaded **This Year** |
106
+
107
+ ## Data Structure
108
+
109
+ The `.search()` method returns a list of dictionaries:
110
+
111
+ ```json
112
+ [
113
+ {
114
+ "id": "lDoYisPfcck",
115
+ "title": "Hack the planet! LangGraph AI HackBot Dev & Q/A",
116
+ "duration": "1:05:23",
117
+ "views": "1.2K views",
118
+ "url_suffix": "/watch?v=lDoYisPfcck"
119
+ }
120
+ ]
121
+ ```
122
+
123
+ ## Dependencies
124
+ - `aiohttp` (for async requests)
125
+
126
+ ## License
127
+ MIT License. See LICENSE file for details.
@@ -0,0 +1,106 @@
1
+
2
+ # py-youtube-search
3
+
4
+ A lightweight, asynchronous Python library to search YouTube videos programmatically without an API key.
5
+ It scrapes search results using `aiohttp` and `re`, making it fast, robust, and perfect for high-performance applications.
6
+
7
+ ## Features
8
+
9
+ - **Async Support**: Fully asynchronous using `aiohttp` for non-blocking execution.
10
+ - **No API Key Required**: Search YouTube directly without setting up Google Cloud projects.
11
+ - **Advanced Filtering**: Built-in support for duration (Medium 3-20m, Long >20m) and upload date filters.
12
+ - **Rich Data Extraction**: Extracts Video ID, Title, Duration, and View Count using optimized regex.
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pip install py-youtube-search
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ### 1. Basic Async Search
23
+ Fetch the top results for any keyword asynchronously.
24
+
25
+ ```python
26
+ import asyncio
27
+ from py_youtube_search import YouTubeSearch
28
+
29
+ async def main():
30
+ # 1. Initialize the search (no network call yet)
31
+ yt = YouTubeSearch("Python async tutorials", limit=5)
32
+
33
+ # 2. Await the search results
34
+ videos = await yt.search()
35
+
36
+ for v in videos:
37
+ print(f"Title: {v['title']}")
38
+ print(f"Duration: {v['duration']}")
39
+ print(f"Views: {v['views']}")
40
+ print(f"Link: https://www.youtube.com/watch?v={v['id']}\n")
41
+
42
+ if __name__ == "__main__":
43
+ asyncio.run(main())
44
+ ```
45
+
46
+ ### 2. Advanced Search with Filters
47
+ Search for specific content, like long-form videos (>20m) uploaded this week.
48
+
49
+ ```python
50
+ import asyncio
51
+ from py_youtube_search import YouTubeSearch, Filters
52
+
53
+ async def main():
54
+ # Use the Filters class for readable constants
55
+ yt = YouTubeSearch("LangGraph", sp=Filters.long_this_week, limit=3)
56
+
57
+ videos = await yt.search()
58
+
59
+ for v in videos:
60
+ print(f"🎥 {v['title']} | ⏱ {v['duration']} | 👁 {v['views']}")
61
+
62
+ if __name__ == "__main__":
63
+ asyncio.run(main())
64
+ ```
65
+
66
+ ## Available Filters
67
+
68
+ Pass these constants into the `sp` parameter of `YouTubeSearch`.
69
+
70
+ ### Duration: Medium (3 - 20 Minutes)
71
+ | Filter Attribute | Description |
72
+ | :--- | :--- |
73
+ | `Filters.medium_today` | Uploaded **Today** |
74
+ | `Filters.medium_this_week` | Uploaded **This Week** |
75
+ | `Filters.medium_this_month` | Uploaded **This Month** |
76
+ | `Filters.medium_this_year` | Uploaded **This Year** |
77
+
78
+ ### Duration: Long (Over 20 Minutes)
79
+ | Filter Attribute | Description |
80
+ | :--- | :--- |
81
+ | `Filters.long_today` | Uploaded **Today** |
82
+ | `Filters.long_this_week` | Uploaded **This Week** |
83
+ | `Filters.long_this_month` | Uploaded **This Month** |
84
+ | `Filters.long_this_year` | Uploaded **This Year** |
85
+
86
+ ## Data Structure
87
+
88
+ The `.search()` method returns a list of dictionaries:
89
+
90
+ ```json
91
+ [
92
+ {
93
+ "id": "lDoYisPfcck",
94
+ "title": "Hack the planet! LangGraph AI HackBot Dev & Q/A",
95
+ "duration": "1:05:23",
96
+ "views": "1.2K views",
97
+ "url_suffix": "/watch?v=lDoYisPfcck"
98
+ }
99
+ ]
100
+ ```
101
+
102
+ ## Dependencies
103
+ - `aiohttp` (for async requests)
104
+
105
+ ## License
106
+ MIT License. See LICENSE file for details.
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: py-youtube-search
3
+ Version: 0.2.1
4
+ Summary: A lightweight, regex-based YouTube search library without API keys.
5
+ Home-page: https://github.com/VishvaRam/py-youtube-search
6
+ Author: VishvaRam
7
+ Author-email: murthyvishva@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: classifier
16
+ Dynamic: description
17
+ Dynamic: description-content-type
18
+ Dynamic: home-page
19
+ Dynamic: requires-python
20
+ Dynamic: summary
21
+
22
+
23
+ # py-youtube-search
24
+
25
+ A lightweight, asynchronous Python library to search YouTube videos programmatically without an API key.
26
+ It scrapes search results using `aiohttp` and `re`, making it fast, robust, and perfect for high-performance applications.
27
+
28
+ ## Features
29
+
30
+ - **Async Support**: Fully asynchronous using `aiohttp` for non-blocking execution.
31
+ - **No API Key Required**: Search YouTube directly without setting up Google Cloud projects.
32
+ - **Advanced Filtering**: Built-in support for duration (Medium 3-20m, Long >20m) and upload date filters.
33
+ - **Rich Data Extraction**: Extracts Video ID, Title, Duration, and View Count using optimized regex.
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ pip install py-youtube-search
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ### 1. Basic Async Search
44
+ Fetch the top results for any keyword asynchronously.
45
+
46
+ ```python
47
+ import asyncio
48
+ from py_youtube_search import YouTubeSearch
49
+
50
+ async def main():
51
+ # 1. Initialize the search (no network call yet)
52
+ yt = YouTubeSearch("Python async tutorials", limit=5)
53
+
54
+ # 2. Await the search results
55
+ videos = await yt.search()
56
+
57
+ for v in videos:
58
+ print(f"Title: {v['title']}")
59
+ print(f"Duration: {v['duration']}")
60
+ print(f"Views: {v['views']}")
61
+ print(f"Link: https://www.youtube.com/watch?v={v['id']}\n")
62
+
63
+ if __name__ == "__main__":
64
+ asyncio.run(main())
65
+ ```
66
+
67
+ ### 2. Advanced Search with Filters
68
+ Search for specific content, like long-form videos (>20m) uploaded this week.
69
+
70
+ ```python
71
+ import asyncio
72
+ from py_youtube_search import YouTubeSearch, Filters
73
+
74
+ async def main():
75
+ # Use the Filters class for readable constants
76
+ yt = YouTubeSearch("LangGraph", sp=Filters.long_this_week, limit=3)
77
+
78
+ videos = await yt.search()
79
+
80
+ for v in videos:
81
+ print(f"🎥 {v['title']} | ⏱ {v['duration']} | 👁 {v['views']}")
82
+
83
+ if __name__ == "__main__":
84
+ asyncio.run(main())
85
+ ```
86
+
87
+ ## Available Filters
88
+
89
+ Pass these constants into the `sp` parameter of `YouTubeSearch`.
90
+
91
+ ### Duration: Medium (3 - 20 Minutes)
92
+ | Filter Attribute | Description |
93
+ | :--- | :--- |
94
+ | `Filters.medium_today` | Uploaded **Today** |
95
+ | `Filters.medium_this_week` | Uploaded **This Week** |
96
+ | `Filters.medium_this_month` | Uploaded **This Month** |
97
+ | `Filters.medium_this_year` | Uploaded **This Year** |
98
+
99
+ ### Duration: Long (Over 20 Minutes)
100
+ | Filter Attribute | Description |
101
+ | :--- | :--- |
102
+ | `Filters.long_today` | Uploaded **Today** |
103
+ | `Filters.long_this_week` | Uploaded **This Week** |
104
+ | `Filters.long_this_month` | Uploaded **This Month** |
105
+ | `Filters.long_this_year` | Uploaded **This Year** |
106
+
107
+ ## Data Structure
108
+
109
+ The `.search()` method returns a list of dictionaries:
110
+
111
+ ```json
112
+ [
113
+ {
114
+ "id": "lDoYisPfcck",
115
+ "title": "Hack the planet! LangGraph AI HackBot Dev & Q/A",
116
+ "duration": "1:05:23",
117
+ "views": "1.2K views",
118
+ "url_suffix": "/watch?v=lDoYisPfcck"
119
+ }
120
+ ]
121
+ ```
122
+
123
+ ## Dependencies
124
+ - `aiohttp` (for async requests)
125
+
126
+ ## License
127
+ MIT License. See LICENSE file for details.
@@ -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.0",
8
+ version="0.2.1",
9
9
  author="VishvaRam", # <--- Change this
10
10
  author_email="murthyvishva@gmail.com", # <--- Change this
11
11
  description="A lightweight, regex-based YouTube search library without API keys.",
@@ -1,144 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: py-youtube-search
3
- Version: 0.2.0
4
- Summary: A lightweight, regex-based YouTube search library without API keys.
5
- Home-page: https://github.com/VishvaRam/py-youtube-search
6
- Author: VishvaRam
7
- Author-email: murthyvishva@gmail.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.6
12
- Description-Content-Type: text/markdown
13
- Dynamic: author
14
- Dynamic: author-email
15
- Dynamic: classifier
16
- Dynamic: description
17
- Dynamic: description-content-type
18
- Dynamic: home-page
19
- Dynamic: requires-python
20
- Dynamic: summary
21
-
22
- # py-youtube-search
23
-
24
- A lightweight, zero-dependency Python library to search YouTube videos programmatically without an API key. This library uses standard Python libraries (`urllib` and `re`) to scrape search results, making it fast, robust, and easy to integrate into any project.
25
-
26
- ## Features
27
-
28
- - **No API Key Required**: Search YouTube directly without setting up Google Cloud projects or billing.
29
- - **Zero External Dependencies**: Built entirely using Python's standard library (`urllib`, `re`). No `requests`, `selenium`, or `beautifulsoup` needed.
30
- - **Advanced Filtering**: Built-in support for duration (Medium 3-20m, Long >20m) and upload date filters (Today, Week, Month, Year).
31
- - **Rich Data Extraction**: Robustly extracts Video ID, Title, Duration, and View Count.
32
-
33
- ## Installation
34
-
35
- You can install the package via pip:
36
-
37
- ```bash
38
- pip install py-youtube-search
39
- ```
40
-
41
- ## Quick Start
42
-
43
- ### 1. Basic Search
44
- Fetch the top results for any keyword.
45
-
46
- ```python
47
- from py_youtube_search import YouTubeSearch
48
-
49
- # Search for the top 5 results for "Python tutorials"
50
- search = YouTubeSearch("Python tutorials", limit=5)
51
- videos = search.videos()
52
-
53
- for v in videos:
54
- print(f"Title: {v['title']}")
55
- print(f"Duration: {v['duration']}")
56
- print(f"Views: {v['views']}")
57
- print(f"Link: https://www.youtube.com/watch?v={v['id']}\n")
58
- ```
59
-
60
- ### 2. Advanced Search with Filters
61
- Search for specific types of content, such as long-form tutorials uploaded this week.
62
-
63
- ```python
64
- from py_youtube_search import YouTubeSearch, Filters
65
-
66
- # Search for "LangGraph" videos over 20 minutes long, uploaded this week
67
- # Use the Filters class to access constants
68
- search = YouTubeSearch("LangGraph", sp=Filters.long_this_week, limit=3)
69
- videos = search.videos()
70
-
71
- for v in videos:
72
- print(f"🎥 {v['title']} | ⏱ {v['duration']} | 👁 {v['views']}")
73
- ```
74
-
75
- ## Available Filters
76
-
77
- You can access these filters using the `Filters` class (e.g., `Filters.long_today`).
78
-
79
- ### Duration: Medium (3 - 20 Minutes)
80
- | Filter Attribute | Description |
81
- | :--- | :--- |
82
- | `Filters.medium_today` | Uploaded **Today** |
83
- | `Filters.medium_this_week` | Uploaded **This Week** |
84
- | `Filters.medium_this_month` | Uploaded **This Month** |
85
- | `Filters.medium_this_year` | Uploaded **This Year** |
86
-
87
- ### Duration: Long (Over 20 Minutes)
88
- | Filter Attribute | Description |
89
- | :--- | :--- |
90
- | `Filters.long_today` | Uploaded **Today** |
91
- | `Filters.long_this_week` | Uploaded **This Week** |
92
- | `Filters.long_this_month` | Uploaded **This Month** |
93
- | `Filters.long_this_year` | Uploaded **This Year** |
94
-
95
- ## Data Structure
96
-
97
- The `videos()` method returns a list of dictionaries with the following structure:
98
-
99
- ```json
100
- [
101
- {
102
- "id": "lDoYisPfcck",
103
- "title": "Hack the planet! LangGraph AI HackBot Dev & Q/A",
104
- "duration": "1:05:23",
105
- "views": "1.2K views",
106
- "url_suffix": "/watch?v=lDoYisPfcck"
107
- },
108
- {
109
- "id": "5LXLmUsEM20",
110
- "title": "LangGraph Workflow Patterns - Part 1/10",
111
- "duration": "42 seconds",
112
- "views": "500 views",
113
- "url_suffix": "/watch?v=5LXLmUsEM20"
114
- }
115
- ]
116
- ```
117
-
118
- ## License
119
-
120
- This project is licensed under the MIT License - see below for details.
121
-
122
- ```text
123
- MIT License
124
-
125
- Copyright (c) 2026
126
-
127
- Permission is hereby granted, free of charge, to any person obtaining a copy
128
- of this software and associated documentation files (the "Software"), to deal
129
- in the Software without restriction, including without limitation the rights
130
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
131
- copies of the Software, and to permit persons to whom the Software is
132
- furnished to do so, subject to the following conditions:
133
-
134
- The above copyright notice and this permission notice shall be included in all
135
- copies or substantial portions of the Software.
136
-
137
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
138
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
139
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
140
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
141
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
142
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
143
- SOFTWARE.
144
- ```
@@ -1,123 +0,0 @@
1
- # py-youtube-search
2
-
3
- A lightweight, zero-dependency Python library to search YouTube videos programmatically without an API key. This library uses standard Python libraries (`urllib` and `re`) to scrape search results, making it fast, robust, and easy to integrate into any project.
4
-
5
- ## Features
6
-
7
- - **No API Key Required**: Search YouTube directly without setting up Google Cloud projects or billing.
8
- - **Zero External Dependencies**: Built entirely using Python's standard library (`urllib`, `re`). No `requests`, `selenium`, or `beautifulsoup` needed.
9
- - **Advanced Filtering**: Built-in support for duration (Medium 3-20m, Long >20m) and upload date filters (Today, Week, Month, Year).
10
- - **Rich Data Extraction**: Robustly extracts Video ID, Title, Duration, and View Count.
11
-
12
- ## Installation
13
-
14
- You can install the package via pip:
15
-
16
- ```bash
17
- pip install py-youtube-search
18
- ```
19
-
20
- ## Quick Start
21
-
22
- ### 1. Basic Search
23
- Fetch the top results for any keyword.
24
-
25
- ```python
26
- from py_youtube_search import YouTubeSearch
27
-
28
- # Search for the top 5 results for "Python tutorials"
29
- search = YouTubeSearch("Python tutorials", limit=5)
30
- videos = search.videos()
31
-
32
- for v in videos:
33
- print(f"Title: {v['title']}")
34
- print(f"Duration: {v['duration']}")
35
- print(f"Views: {v['views']}")
36
- print(f"Link: https://www.youtube.com/watch?v={v['id']}\n")
37
- ```
38
-
39
- ### 2. Advanced Search with Filters
40
- Search for specific types of content, such as long-form tutorials uploaded this week.
41
-
42
- ```python
43
- from py_youtube_search import YouTubeSearch, Filters
44
-
45
- # Search for "LangGraph" videos over 20 minutes long, uploaded this week
46
- # Use the Filters class to access constants
47
- search = YouTubeSearch("LangGraph", sp=Filters.long_this_week, limit=3)
48
- videos = search.videos()
49
-
50
- for v in videos:
51
- print(f"🎥 {v['title']} | ⏱ {v['duration']} | 👁 {v['views']}")
52
- ```
53
-
54
- ## Available Filters
55
-
56
- You can access these filters using the `Filters` class (e.g., `Filters.long_today`).
57
-
58
- ### Duration: Medium (3 - 20 Minutes)
59
- | Filter Attribute | Description |
60
- | :--- | :--- |
61
- | `Filters.medium_today` | Uploaded **Today** |
62
- | `Filters.medium_this_week` | Uploaded **This Week** |
63
- | `Filters.medium_this_month` | Uploaded **This Month** |
64
- | `Filters.medium_this_year` | Uploaded **This Year** |
65
-
66
- ### Duration: Long (Over 20 Minutes)
67
- | Filter Attribute | Description |
68
- | :--- | :--- |
69
- | `Filters.long_today` | Uploaded **Today** |
70
- | `Filters.long_this_week` | Uploaded **This Week** |
71
- | `Filters.long_this_month` | Uploaded **This Month** |
72
- | `Filters.long_this_year` | Uploaded **This Year** |
73
-
74
- ## Data Structure
75
-
76
- The `videos()` method returns a list of dictionaries with the following structure:
77
-
78
- ```json
79
- [
80
- {
81
- "id": "lDoYisPfcck",
82
- "title": "Hack the planet! LangGraph AI HackBot Dev & Q/A",
83
- "duration": "1:05:23",
84
- "views": "1.2K views",
85
- "url_suffix": "/watch?v=lDoYisPfcck"
86
- },
87
- {
88
- "id": "5LXLmUsEM20",
89
- "title": "LangGraph Workflow Patterns - Part 1/10",
90
- "duration": "42 seconds",
91
- "views": "500 views",
92
- "url_suffix": "/watch?v=5LXLmUsEM20"
93
- }
94
- ]
95
- ```
96
-
97
- ## License
98
-
99
- This project is licensed under the MIT License - see below for details.
100
-
101
- ```text
102
- MIT License
103
-
104
- Copyright (c) 2026
105
-
106
- Permission is hereby granted, free of charge, to any person obtaining a copy
107
- of this software and associated documentation files (the "Software"), to deal
108
- in the Software without restriction, including without limitation the rights
109
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
110
- copies of the Software, and to permit persons to whom the Software is
111
- furnished to do so, subject to the following conditions:
112
-
113
- The above copyright notice and this permission notice shall be included in all
114
- copies or substantial portions of the Software.
115
-
116
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
117
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
118
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
119
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
120
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
121
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
122
- SOFTWARE.
123
- ```
@@ -1,144 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: py-youtube-search
3
- Version: 0.2.0
4
- Summary: A lightweight, regex-based YouTube search library without API keys.
5
- Home-page: https://github.com/VishvaRam/py-youtube-search
6
- Author: VishvaRam
7
- Author-email: murthyvishva@gmail.com
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.6
12
- Description-Content-Type: text/markdown
13
- Dynamic: author
14
- Dynamic: author-email
15
- Dynamic: classifier
16
- Dynamic: description
17
- Dynamic: description-content-type
18
- Dynamic: home-page
19
- Dynamic: requires-python
20
- Dynamic: summary
21
-
22
- # py-youtube-search
23
-
24
- A lightweight, zero-dependency Python library to search YouTube videos programmatically without an API key. This library uses standard Python libraries (`urllib` and `re`) to scrape search results, making it fast, robust, and easy to integrate into any project.
25
-
26
- ## Features
27
-
28
- - **No API Key Required**: Search YouTube directly without setting up Google Cloud projects or billing.
29
- - **Zero External Dependencies**: Built entirely using Python's standard library (`urllib`, `re`). No `requests`, `selenium`, or `beautifulsoup` needed.
30
- - **Advanced Filtering**: Built-in support for duration (Medium 3-20m, Long >20m) and upload date filters (Today, Week, Month, Year).
31
- - **Rich Data Extraction**: Robustly extracts Video ID, Title, Duration, and View Count.
32
-
33
- ## Installation
34
-
35
- You can install the package via pip:
36
-
37
- ```bash
38
- pip install py-youtube-search
39
- ```
40
-
41
- ## Quick Start
42
-
43
- ### 1. Basic Search
44
- Fetch the top results for any keyword.
45
-
46
- ```python
47
- from py_youtube_search import YouTubeSearch
48
-
49
- # Search for the top 5 results for "Python tutorials"
50
- search = YouTubeSearch("Python tutorials", limit=5)
51
- videos = search.videos()
52
-
53
- for v in videos:
54
- print(f"Title: {v['title']}")
55
- print(f"Duration: {v['duration']}")
56
- print(f"Views: {v['views']}")
57
- print(f"Link: https://www.youtube.com/watch?v={v['id']}\n")
58
- ```
59
-
60
- ### 2. Advanced Search with Filters
61
- Search for specific types of content, such as long-form tutorials uploaded this week.
62
-
63
- ```python
64
- from py_youtube_search import YouTubeSearch, Filters
65
-
66
- # Search for "LangGraph" videos over 20 minutes long, uploaded this week
67
- # Use the Filters class to access constants
68
- search = YouTubeSearch("LangGraph", sp=Filters.long_this_week, limit=3)
69
- videos = search.videos()
70
-
71
- for v in videos:
72
- print(f"🎥 {v['title']} | ⏱ {v['duration']} | 👁 {v['views']}")
73
- ```
74
-
75
- ## Available Filters
76
-
77
- You can access these filters using the `Filters` class (e.g., `Filters.long_today`).
78
-
79
- ### Duration: Medium (3 - 20 Minutes)
80
- | Filter Attribute | Description |
81
- | :--- | :--- |
82
- | `Filters.medium_today` | Uploaded **Today** |
83
- | `Filters.medium_this_week` | Uploaded **This Week** |
84
- | `Filters.medium_this_month` | Uploaded **This Month** |
85
- | `Filters.medium_this_year` | Uploaded **This Year** |
86
-
87
- ### Duration: Long (Over 20 Minutes)
88
- | Filter Attribute | Description |
89
- | :--- | :--- |
90
- | `Filters.long_today` | Uploaded **Today** |
91
- | `Filters.long_this_week` | Uploaded **This Week** |
92
- | `Filters.long_this_month` | Uploaded **This Month** |
93
- | `Filters.long_this_year` | Uploaded **This Year** |
94
-
95
- ## Data Structure
96
-
97
- The `videos()` method returns a list of dictionaries with the following structure:
98
-
99
- ```json
100
- [
101
- {
102
- "id": "lDoYisPfcck",
103
- "title": "Hack the planet! LangGraph AI HackBot Dev & Q/A",
104
- "duration": "1:05:23",
105
- "views": "1.2K views",
106
- "url_suffix": "/watch?v=lDoYisPfcck"
107
- },
108
- {
109
- "id": "5LXLmUsEM20",
110
- "title": "LangGraph Workflow Patterns - Part 1/10",
111
- "duration": "42 seconds",
112
- "views": "500 views",
113
- "url_suffix": "/watch?v=5LXLmUsEM20"
114
- }
115
- ]
116
- ```
117
-
118
- ## License
119
-
120
- This project is licensed under the MIT License - see below for details.
121
-
122
- ```text
123
- MIT License
124
-
125
- Copyright (c) 2026
126
-
127
- Permission is hereby granted, free of charge, to any person obtaining a copy
128
- of this software and associated documentation files (the "Software"), to deal
129
- in the Software without restriction, including without limitation the rights
130
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
131
- copies of the Software, and to permit persons to whom the Software is
132
- furnished to do so, subject to the following conditions:
133
-
134
- The above copyright notice and this permission notice shall be included in all
135
- copies or substantial portions of the Software.
136
-
137
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
138
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
139
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
140
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
141
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
142
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
143
- SOFTWARE.
144
- ```