Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xnykram/youtube_search2
a youtube_search fork with additional features and patches
https://github.com/xnykram/youtube_search2
Last synced: 27 days ago
JSON representation
a youtube_search fork with additional features and patches
- Host: GitHub
- URL: https://github.com/xnykram/youtube_search2
- Owner: xNykram
- License: unlicense
- Created: 2024-02-25T08:32:15.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-07-22T17:00:38.000Z (4 months ago)
- Last Synced: 2024-10-11T20:03:22.869Z (27 days ago)
- Language: Python
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
![GitHub Release](https://img.shields.io/github/v/release/xnykram/youtube_search2?&style=flat-square)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/xnykram/youtube_search2/pytest.yml?label=tests&style=flat-square)## Example usage
### Using URL
``` Python
from youtube_search2 import YoutubeSearchsearch_engine = YTSearch()
video_info = search_engine.search_by_url("https://www.youtube.com/watch?v=jNQXAC9IVRw")output: {'id': 'jNQXAC9IVRw', 'title': 'Me at the zoo', 'thumbnail': 'https://i.ytimg.com/vi/jNQXAC9IVRw/maxresdefault.jpg', 'duration': '19063'}
```
### Using keyword
``` Python
from youtube_search2 import YoutubeSearchsearch_engine = YTSearch()
video_info = search_engine.search_by_term("Me at the zoo", max_results=1)output: [{'id': 'jNQXAC9IVRw', 'thumbnails': ['https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg?sqp=-oaymwE9COADEI4CSFryq4qpAy8IARUAAAAAGAElAADIQj0AgKJDeAHwAQH4Ab4CgALwAYoCDAgAEAEYVCBYKGUwDw==&rs=AOn4CLC4lp5lwDTP5b30m6scq6a7lKyA8Q'], 'title': 'Me at the zoo', 'long_desc': None, 'channel': 'jawed', 'duration': '0:19', 'views': '310\xa0243\xa0516 views', 'publish_time': '18 years ago', 'url_suffix': '/watch?v=jNQXAC9IVRw&pp=ygUNTWUgYXQgdGhlIHpvbw%3D%3D'}]
```
### Plans
- scrap more data like sub count for method `search_by_url`.
Please report any suggestions and issues [here](https://github.com/xNykram/youtube_search2/issues).