improved wording and examples

This commit is contained in:
simon 2021-12-29 20:24:19 +07:00
parent 6f858f7579
commit f7bc0c0ef1
Signed by: simon
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 8 additions and 12 deletions

View File

@ -6,19 +6,19 @@ Python client library for the **Return YouTube Dislike API**:
## Functionality ## Functionality
- Get votes from a list of YouTube video IDs. - Get votes from a single or a list of YouTube video IDs.
- Register your user ID by solving the challenge. - Register your user ID by solving the challenge.
- Cast your vote for a list of YouTube video IDs. - Cast your vote for a single or a list of YouTube video IDs.
## Install ## Install
Download and install library from [https://pypi.org/project/ryd-client/](https://pypi.org/project/ryd-client/): Download and install the library from [https://pypi.org/project/ryd-client/](https://pypi.org/project/ryd-client/):
```shell ```shell
pip install ryd-client pip install ryd-client
``` ```
## Usage ## Usage
Some command example Take a look at the command examples below.
### Get ### Get
Pass a list of YouTube video IDs and get a list of votes or pass a string of a single YouTube video ID to get a single votes dictionary: Pass a list of YouTube video IDs and get a list of votes or pass a string of a single YouTube video ID to get a single votes dictionary:
@ -26,8 +26,7 @@ Pass a list of YouTube video IDs and get a list of votes or pass a string of a s
```python ```python
import ryd_client import ryd_client
# Passing a list returns a list of dictionaries # Examle for a list of IDs
# with ratings for every video ID returns a list
result = ryd_client.get(["kxOuG8jMIgI", "CaaJyRvvaq8"]) result = ryd_client.get(["kxOuG8jMIgI", "CaaJyRvvaq8"])
@ -47,8 +46,7 @@ result = ryd_client.get(["kxOuG8jMIgI", "CaaJyRvvaq8"])
'status': 200}] 'status': 200}]
# passing a single ID returns a dictionary # Example for a single ID
# with ratings from a single video
result = ryd_client.get("kxOuG8jMIgI") result = ryd_client.get("kxOuG8jMIgI")
@ -97,8 +95,7 @@ Strings automatically get converted to the matching number, both are valid:
```python ```python
import ryd_client import ryd_client
# voting on a list of videos # Examle for a list of votes
# returns a list of results
votes = [ votes = [
("kxOuG8jMIgI", "dislike"), ("kxOuG8jMIgI", "dislike"),
("CaaJyRvvaq8", 1), ("CaaJyRvvaq8", 1),
@ -111,8 +108,7 @@ response = ryd_client.post(votes, user_id=user_id)
{'id': 'CaaJyRvvaq8', 'status': True, 'vote': 1}, {'id': 'CaaJyRvvaq8', 'status': True, 'vote': 1},
{'id': 'CEp5SLT-DJg', 'status': True, 'vote': 0}] {'id': 'CEp5SLT-DJg', 'status': True, 'vote': 0}]
# voting on a single video # Examle for a single vote
# returns a single result
vote = ("kxOuG8jMIgI", -1) vote = ("kxOuG8jMIgI", -1)
response = ryd_client.post(vote, user_id=user_id) response = ryd_client.post(vote, user_id=user_id)