Skip to main content

yt_lib: Young YouTube library

yt_lib is the unofficial library for YouTube, which supports operations with likes, subscriptions, comments.

>>> from yt_lib import states
>>> from yt_lib import YoutubeClient
>>> client = YoutubeClient(cookies=cookies)
>>> client.init_session()
>>> client.subscribe('UCtinbF-Q-fVthA0qrFQTgXQ', states.SubscribeAction.SUBSCRIBE)
<ActResult.SUCCESS: 1>

Feature Support

The library begins to take its first steps, so the list is small.

  • Rates (like, dislikes and take back)
  • Subscriptions (and unsubscribes)
  • Writing comments

Installation

To install yt_lib, simply run this simple command in your terminal of choice:

$ pip install yt_lib

yt_lib is actively developed on GitHub, where the code is always available.

You can either clone the public repository:

$ git clone https://github.com/hairygeek/yt_lib.git

Quickstart

First make sure thar yt_lib is installed.

Let's get started with some simple examples.

Subscribes

Begin by importing the yt_lib and yt_lib.states modules:

>>> import yt_lib
>>> from yt_lib import states

Now let's create YouTubeClient, this requires youtube cookies. Cookies required to work: apisid, consent, hsid, login_info, pref, sapisid, sid, sidcc, ssid, visitor_info1_live. Imagine that we already have them:

>>> client = YoutubeClient(cookies=cookies)

Now let's initialize the session. Nothing will work without it:

>>> client.init_session()

Now we can subscribe to the channel. for this we need a type of subscription (unsubscribe / subscription), we will take it from the module states:

>>> client.subscribe('UCtinbF-Q-fVthA0qrFQTgXQ', states.SubscribeAction.SUBSCRIBE)
    <ActResult.SUCCESS: 1>

We got an response. In our case, this is SUCCESS, which means that the subscription was successful.

Rates

In the same way we can like:

>>> client.rate('V6Y-ahQFQDA', states.LikeAction.LIKE)
    <ActResult.SUCCESS: 1>

or dislike:

>>> client.rate('V6Y-ahQFQDA', states.LikeAction.DISLIKE)
    <ActResult.SUCCESS: 1>

or take action back:

>>> client.rate('V6Y-ahQFQDA', states.LikeAction.TAKE_BACK)
    <ActResult.SUCCESS: 1>

That's not all, but l'm too lazy to describe the rest. See the description of methods.

Metadata

Release files for yt-lib 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yt-lib 0.0.1
File Size Uploaded Provenance Actions
yt_lib-0.0.1.tar.gz 5.7 kB Without provenance Details for yt_lib-0.0.1.tar.gz

Release files / yt_lib-0.0.1.tar.gz

Download URL yt_lib-0.0.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b651d3e7a2b6c2555560e70a1798baeef6a3b84d38a2b1046fb06c914b398182
BLAKE2b-256 checksum
How to use checksums
92ae297ac23b6ebcf683b22524aeec1050657d8c8014e29502f12ae371246351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.1

Security for yt-lib 0.0.1

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.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page