YouTubeMusic 1.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.
- youtubemusic-1.2.1/LICENSE +27 -0
- youtubemusic-1.2.1/PKG-INFO +27 -0
- youtubemusic-1.2.1/README.md +13 -0
- youtubemusic-1.2.1/YouTubeMusic/Models.py +14 -0
- youtubemusic-1.2.1/YouTubeMusic/YtSearch.py +39 -0
- youtubemusic-1.2.1/YouTubeMusic/__init__.py +2 -0
- youtubemusic-1.2.1/YouTubeMusic.egg-info/PKG-INFO +27 -0
- youtubemusic-1.2.1/YouTubeMusic.egg-info/SOURCES.txt +13 -0
- youtubemusic-1.2.1/YouTubeMusic.egg-info/dependency_links.txt +1 -0
- youtubemusic-1.2.1/YouTubeMusic.egg-info/entry_points.txt +2 -0
- youtubemusic-1.2.1/YouTubeMusic.egg-info/requires.txt +2 -0
- youtubemusic-1.2.1/YouTubeMusic.egg-info/top_level.txt +1 -0
- youtubemusic-1.2.1/pyproject.toml +17 -0
- youtubemusic-1.2.1/setup.cfg +4 -0
- youtubemusic-1.2.1/setup.py +22 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
### 4. **Create `LICENSE` File**
|
|
3
|
+
|
|
4
|
+
Choose a license for your project (e.g., MIT License). Hereβs an example of an MIT License:
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 [ABHISHEK BANSHIWAL]
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: YouTubeMusic
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: Fast YouTube Music Search with DuckDuckGo
|
|
5
|
+
Author: ABHISHEK THAKUR
|
|
6
|
+
Author-email: ABHISHEK THAKUR <abhishekbanshiwal2005@gmail.com>
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: aiohttp
|
|
11
|
+
Requires-Dist: beautifulsoup4
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# YouTubeMusic π₯
|
|
16
|
+
A blazing fast YouTube music search module using DuckDuckGo scraping.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- No YouTube API needed β
|
|
21
|
+
- Fast + lightweight async search engine β‘
|
|
22
|
+
- Perfect for Telegram bots, CLI tools, and more π§
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install YouTubeMusic
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# YouTubeMusic π₯
|
|
2
|
+
A blazing fast YouTube music search module using DuckDuckGo scraping.
|
|
3
|
+
|
|
4
|
+
## Features
|
|
5
|
+
|
|
6
|
+
- No YouTube API needed β
|
|
7
|
+
- Fast + lightweight async search engine β‘
|
|
8
|
+
- Perfect for Telegram bots, CLI tools, and more π§
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install YouTubeMusic
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
class YouTubeResult:
|
|
2
|
+
def __init__(self, title: str, url: str):
|
|
3
|
+
self.title = title
|
|
4
|
+
self.url = url
|
|
5
|
+
|
|
6
|
+
def __repr__(self):
|
|
7
|
+
return f"Title: {self.title} - URL: {self.url}"
|
|
8
|
+
|
|
9
|
+
def to_dict(self):
|
|
10
|
+
return {
|
|
11
|
+
"title": self.title,
|
|
12
|
+
"url": self.url
|
|
13
|
+
}
|
|
14
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import aiohttp
|
|
2
|
+
from bs4 import BeautifulSoup
|
|
3
|
+
from .Models import YouTubeResult
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
async def search_duckduckgo(query: str):
|
|
7
|
+
search_url = f"https://duckduckgo.com/html/?q=site:youtube.com+{query}"
|
|
8
|
+
|
|
9
|
+
headers = {
|
|
10
|
+
"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"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async with aiohttp.ClientSession() as session:
|
|
14
|
+
async with session.get(search_url, headers=headers) as response:
|
|
15
|
+
html = await response.text()
|
|
16
|
+
return html
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def parse_results(html: str, limit: int = 1):
|
|
20
|
+
soup = BeautifulSoup(html, 'html.parser')
|
|
21
|
+
results = []
|
|
22
|
+
|
|
23
|
+
for a_tag in soup.find_all('a', class_='result__a'):
|
|
24
|
+
title = a_tag.get_text()
|
|
25
|
+
url = a_tag.get('href')
|
|
26
|
+
|
|
27
|
+
if "youtube.com/watch" in url:
|
|
28
|
+
full_url = url if url.startswith("http") else f"https://www.youtube.com{url}"
|
|
29
|
+
results.append(YouTubeResult(title=title, url=full_url))
|
|
30
|
+
|
|
31
|
+
if len(results) >= limit:
|
|
32
|
+
break
|
|
33
|
+
|
|
34
|
+
return results
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
async def Search(query: str, limit: int = 1):
|
|
38
|
+
html = await search_duckduckgo(query)
|
|
39
|
+
return parse_results(html, limit=limit)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: YouTubeMusic
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: Fast YouTube Music Search with DuckDuckGo
|
|
5
|
+
Author: ABHISHEK THAKUR
|
|
6
|
+
Author-email: ABHISHEK THAKUR <abhishekbanshiwal2005@gmail.com>
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: aiohttp
|
|
11
|
+
Requires-Dist: beautifulsoup4
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# YouTubeMusic π₯
|
|
16
|
+
A blazing fast YouTube music search module using DuckDuckGo scraping.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- No YouTube API needed β
|
|
21
|
+
- Fast + lightweight async search engine β‘
|
|
22
|
+
- Perfect for Telegram bots, CLI tools, and more π§
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install YouTubeMusic
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
setup.py
|
|
5
|
+
YouTubeMusic/Models.py
|
|
6
|
+
YouTubeMusic/YtSearch.py
|
|
7
|
+
YouTubeMusic/__init__.py
|
|
8
|
+
YouTubeMusic.egg-info/PKG-INFO
|
|
9
|
+
YouTubeMusic.egg-info/SOURCES.txt
|
|
10
|
+
YouTubeMusic.egg-info/dependency_links.txt
|
|
11
|
+
YouTubeMusic.egg-info/entry_points.txt
|
|
12
|
+
YouTubeMusic.egg-info/requires.txt
|
|
13
|
+
YouTubeMusic.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
YouTubeMusic
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "YouTubeMusic"
|
|
7
|
+
version = "1.2.1"
|
|
8
|
+
description = "Fast YouTube Music Search with DuckDuckGo"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name="ABHISHEK THAKUR", email="abhishekbanshiwal2005@gmail.com" }
|
|
11
|
+
]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
|
+
dependencies = ["aiohttp", "beautifulsoup4"]
|
|
15
|
+
|
|
16
|
+
[project.scripts]
|
|
17
|
+
ytmusic = "cli:main"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="YouTubeMusic",
|
|
5
|
+
version="1.2.1",
|
|
6
|
+
description="Fast YouTube Music Search with DuckDuckGo",
|
|
7
|
+
author="ABHISHEK THAKUR",
|
|
8
|
+
author_email="abhishekbanshiwal2005@gmail.com",
|
|
9
|
+
packages=find_packages(),
|
|
10
|
+
install_requires=[
|
|
11
|
+
"aiohttp",
|
|
12
|
+
"beautifulsoup4",
|
|
13
|
+
],
|
|
14
|
+
entry_points={
|
|
15
|
+
"console_scripts": [
|
|
16
|
+
"fastyt=cli:main",
|
|
17
|
+
"youtube=cli:main",
|
|
18
|
+
"ytmusic=cli:main",
|
|
19
|
+
"abhimusic=cli:main"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
)
|