Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
📖 Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmercerind authored Feb 3, 2021
1 parent 31e51f5 commit 0ab6176
Showing 1 changed file with 27 additions and 38 deletions.
65 changes: 27 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,29 @@
[![PyPI - Version](https://img.shields.io/pypi/v/youtube-search-python?style=for-the-badge)](https://pypi.org/project/youtube-search-python)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/youtube-search-python?label=DOWNLOADS&style=for-the-badge)](https://pypi.org/project/youtube-search-python)

## Wanna try out new async version? Checkout [here](https://github.com/alexmercerind/youtube-search-python/tree/main/youtubesearchpython/__future__).

## Install
## 💾 Install

```bash
pip3 install youtube-search-python
```

## Usage
## ⚡ Async Usage

#### 🔎 Search for only videos

```python
from youtubesearchpython.__future__ import VideosSearch

videosSearch = VideosSearch('NoCopyrightSounds', limit = 2)
videosResult = await videosSearch.next()
print(videosResult)
```

Read more about usage & examples of newer asynchronous version of this library [here](https://github.com/alexmercerind/youtube-search-python/tree/main/youtubesearchpython/__future__).

## 📐 Sync Usage

#### Search for only videos
#### 🔎 Search for only videos

```python
from youtubesearchpython import VideosSearch
Expand Down Expand Up @@ -119,7 +131,7 @@ print(videosSearch.result())

</details>

#### Search for only channels
#### 🔎 Search for only channels

```python
from youtubesearchpython import ChannelsSearch
Expand Down Expand Up @@ -405,7 +417,7 @@ print(channelsSearch.result())

</details>

#### Search for only playlists
#### 🔎 Search for only playlists

```python
from youtubesearchpython import PlaylistsSearch
Expand Down Expand Up @@ -461,7 +473,7 @@ print(playlistsSearch.result())

</details>

#### Search with a filter or sort
#### 🔎 Search with a filter or sort

```python
from youtubesearchpython import *
Expand Down Expand Up @@ -529,7 +541,7 @@ print(customSearch.result())

</details>

#### Search for everything
#### 🔎 Search for everything

```python
from youtubesearchpython import Search
Expand Down Expand Up @@ -583,9 +595,9 @@ print(allSearch.result())
You may see the [example](https://github.com/alexmercerind/youtube-search-python/blob/main/syncExample.py) for more information.


## Advanced
## 🔧 Advanced

#### Getting next page search results
#### 📑 Getting next page search results

You may call ```next``` method as follows, to get the results on the next pages.

Expand All @@ -611,7 +623,7 @@ search.next()
print(search.result()['result'])
```

#### Getting video information using video link or video ID
#### 🎞 Getting video information using video link or video ID

```python
'''
Expand Down Expand Up @@ -837,7 +849,7 @@ print(videoFormats)

</details>

#### Getting search suggestions
#### 🔖 Getting search suggestions

```python
from youtubesearchpython import Suggestions
Expand Down Expand Up @@ -873,7 +885,7 @@ print(suggestions.get('NoCopyrightSounds', mode = ResultMode.json))

</details>

#### Getting direct stream URL of a video
#### 🎬 Getting direct stream URL of a video

This class is able fetch video URLs without any additional web requests (that's fast), as one might already have same response at the time of showing it to the user.

Expand Down Expand Up @@ -901,29 +913,6 @@ print(url)

</details>

## Configuration

While instantiating any of the classes, you may provide optional parameters as follows to get the results accordingly.

```py
search = Search('NoCopyrightSounds', limit = 20, language = 'en', region = 'US')
```

You may switch between the types of result, by changing the value of ```mode``` optional parameter while calling the ```result``` method.

##### Getting JSON

```py
result = search.result(mode = ResultMode.json)
```

##### Getting dictionary


```py
result = search.result(mode = ResultMode.dict)
```

## License
## 📄 License

MIT

0 comments on commit 0ab6176

Please sign in to comment.