RYD Client
Python client library for the Return YouTube Dislike API:
Functionality
- Get votes from a single or a list of YouTube video IDs.
- Register your user ID by solving the challenge.
- Cast your vote for a single or a list of YouTube video IDs.
Install
Download and install the library from https://pypi.org/project/ryd-client/:
pip install ryd-client
Usage
Take a look at the command examples below.
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:
from ryd_client import ryd_client
# Examle for a list of IDs
result = ryd_client.get(["kxOuG8jMIgI", "CaaJyRvvaq8"])
[{'id': 'kxOuG8jMIgI',
'likes': 27863,
'dislikes': 509751,
'rating': 1.2113002641063706,
'viewCount': 3211800,
'deleted': False,
'status': 200},
{'id': 'CaaJyRvvaq8',
'likes': 505944,
'dislikes': 13401,
'rating': 4.900014260551845,
'viewCount': 3610078,
'deleted': False,
'status': 200}]
# Example for a single ID
result = ryd_client.get("kxOuG8jMIgI")
{'id': 'kxOuG8jMIgI',
'likes': 27863,
'dislikes': 509751,
'rating': 1.2113002641063706,
'viewCount': 3211800,
'deleted': False,
'status': 200}
Register
To cast a vote, you need to be registered in the API with your user id. Generate a random user id, one per user, store it in your application and reuse for all future votes from this user.
import ryd_client
user_id = ryd_client.generate_user_id()
# Returns a random 36 char string of ascii_letters and digits
'5v3X3mxQOm3fkez8aWsGsEgjpFe0pJNPWIJi'
Register your user_id in the api:
from ryd_client import ryd_client
success = ryd_client.register(user_id)
# Returns True on success, False on fail
True
Post
Once your user_id is registered, you are allowed to vote. Vote on a list or on a single video ID. Pass a list or a single tuple where the first value of the tuple is the video ID and second value is the vote either as string or int:
- like: 1
- dislike: -1
- neutral: 0 (aka undo your previous vote)
Strings automatically get converted to the matching number, both are valid:
from ryd_client import ryd_client
# Examle for a list of votes
votes = [
("kxOuG8jMIgI", "dislike"),
("CaaJyRvvaq8", 1),
("CEp5SLT-DJg", 0),
]
response = ryd_client.post(votes, user_id=user_id)
[{'id': 'kxOuG8jMIgI', 'status': True, 'vote': -1},
{'id': 'CaaJyRvvaq8', 'status': True, 'vote': 1},
{'id': 'CEp5SLT-DJg', 'status': True, 'vote': 0}]
# Examle for a single vote
vote = ("kxOuG8jMIgI", -1)
response = ryd_client.post(vote, user_id=user_id)
{'id': 'kxOuG8jMIgI', 'status': True, 'vote': -1}
Acknowledgement
If you find this API useful, please consider donating to the project.
Metadata
Release files for ryd-client 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ryd-client-0.0.6.tar.gz | 5.5 kB | Without provenance | Details for ryd-client-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ryd_client-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for ryd_client-0.0.6-py3-none-any.whl |
Total release size: 11.2 kB
Release files / ryd-client-0.0.6.tar.gz
| Download URL | ryd-client-0.0.6.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f1ad5755c3e740905f165b3632836fc1e4216eacd3c0e5744db47f6ebbf4a26
|
|
BLAKE2b-256 checksum How to use checksums |
8134181b9bfa69cefce059cc1283b4c5328d8e0919c16b8ecf1276b31b1518c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
|
Release files / ryd_client-0.0.6-py3-none-any.whl
| Download URL | ryd_client-0.0.6-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd2391aac6d4514dbd6696a043a364988de6ffa176affa65f51a49aa4d6f674e
|
|
BLAKE2b-256 checksum How to use checksums |
06609eefce422e68a303778fc4bf69233a719c6a8fe4129a99c906dd1a767867
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
|
Security for ryd-client 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.