Compare commits

...

9 Commits

Author SHA1 Message Date
cere 78a14c9f2c update README 2024-01-16 04:58:07 -05:00
cere a58c71bb25 make search results filter configurable 2024-01-16 04:56:39 -05:00
cere 524170d97a add search support (not just suggestions) 2024-01-16 03:14:52 -05:00
Kevin Svitač e87f804f98
Update README.md 2022-10-28 17:59:22 +02:00
Kevo ab951a4fb6
Update README.md 2022-06-19 09:57:38 +02:00
Kevo dc61c70222 Bump version 2022-03-26 19:25:06 +01:00
Kevo e1734185c9 Do not test 2022-03-26 19:24:06 +01:00
Kevo 8f27cf672e Fix `models` not included in release 2022-03-26 19:21:49 +01:00
Kevo 63f08c7ec7 Test again when publishing package 2022-03-26 18:51:16 +01:00
4 changed files with 19 additions and 33 deletions

View File

@ -24,10 +24,6 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
#- name: Test with pyTest
# run: |
# python -m pytest -v
- name: Build package
run: |

View File

@ -1,13 +1,11 @@
# Piped API client (Python)
[![Test with pyTest](https://github.com/CWKevo/python-piped-api-client/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/CWKevo/python-piped-api-client/actions/workflows/pytest.yml)
A Python API wrapper for [Piped](https://piped-docs.kavin.rocks/). This can essentially be used as an alternative way to access YouTube's API, without needing to use an API key.
A Python API wrapper for [Piped](https://piped-docs.kavin.rocks/). This can essentially be used as an alternative way to access YouTube's API, without needing to use an API key. Forked to allow for search queries to be made.
## Installation
```bash
pip install piped-api
pip install git+https://gitdab.com/cere/python-piped-api-client
```
## Quickstart
@ -46,26 +44,4 @@ It is not meant to be a replacement for the official YouTube API, but it can hel
## Useful links
- [Piped's official API documentation](https://piped-docs.kavin.rocks/docs/api-documentation/)
- [Documentation for this package](https://cwkevo.github.io/python-piped-api-client/)
## 🎁 Support me
I create free software to benefit people.
If this project helps you and you like it, consider supporting me by donating via cryptocurrency:
| Crypto | Address |
| ----------------- | ------------------------------------------------------------------------------------------------- |
| Bitcoin | [E-mail me](mailto:me@kevo.link) |
| Ethereum | `0x12C598b3bC084710507c9d6d19C9434fD26864Cc` |
| Litecoin | `LgHQK1NQrRQ56AKvVtSxMubqbjSWh7DTD2` |
| Dash | `Xe7TYoRCYPdZyiQYDjgzCGxR5juPWV8PgZ` |
| Zcash: | `t1Pesobv3SShMHGfrZWe926nsnBo2pyqN3f` |
| Dogecoin: | `DALxrKSbcCXz619QqLj9qKXFnTp8u2cS12` |
| Ripple: | `rNQsgQvMbbBAd957XyDeNudA4jLH1ANERL` |
| Monero: | `48TfTddnpgnKBn13MdJNJwHfxDwwGngPgL3v6bNSTwGaXveeaUWzJcMUVrbWUyDSyPDwEJVoup2gmDuskkcFuNG99zatYFS` |
| Bitcoin Cash: | `qzx6pqzcltm7ely24wnhpzp65r8ltrqgeuevtrsj9n` |
| Ethereum Classic: | `0x383Dc3B83afBD66b4a5e64511525FbFeb2C023Db` |
More cryptocurrencies are supported. If you are interested in donating with a different one, please [E-mail me](mailto:me@kevo.link).
No other forms of donation are currently supported.
- [Piped's official API documentation](https://piped-docs.kavin.rocks/docs/api-documentation/)

View File

@ -155,3 +155,16 @@ class PipedClient:
kwargs.update({'params': {'query': search_query}})
return self._get_json(f"/suggestions", **kwargs)
def get_search_results(self, search_query: str, filter: str="all", **kwargs) -> t.List[str]:
"""
Obtains search results for a query.
### Parameters:
- `search_query` - The query to get search results for
- `**kwargs` - Additional keyword arguments to pass to `requests.Session.get`
"""
kwargs.update({'params': {'q': search_query, 'filter': filter}})
return self._get_json(f"/search", **kwargs)

View File

@ -11,7 +11,7 @@ __author__ = "SKevo"
__copyright__ = "Copyright (c) 2021, SKevo"
__credits__ = ["SKevo"]
__license__ = "MIT"
__version__ = "v1.0.0-beta"
__version__ = "v1.0.1-beta"
__maintainer__ = "SKevo"
__email__ = "me@kevo.link"
__status__ = "4 - Beta"
@ -32,7 +32,7 @@ __doc__ = __readme__
setuptools.setup(
name = 'piped-api',
packages = setuptools.find_packages(exclude=('tests',), include=('piped_api',)),
packages = setuptools.find_packages(exclude=('tests',)),
long_description=__readme__,
long_description_content_type='text/markdown',
@ -57,5 +57,6 @@ setuptools.setup(
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
)