Skip to main content

Async YouTube Channels Info

Project description

:small_red_triangle: AYTCH - Async YouTube Channels Scrapper :small_red_triangle:

Logo

AYTCH is a Python library for extracting information about YouTube channels. It uses AIOHTTP library for best performance and concurrent fetching support. Library very lightweight (11KB) and return only extra nessesary information about any youtube channel.

:pencil2: Installation

You can install AYTCH using pip:

pip install aytch

:bookmark_tabs: Usage

Here's an example of how to use AYTCH to get information about a YouTube channel:

import asyncio
from aytch import get_channel_info

async def main():
    channel_url = 'https://www.youtube.com/channel/UCdX9ulb8u0oUf8pUzg9Z5Jw'
    channel_info = await get_channel_info(channel_url)
    print(channel_info)

asyncio.run(main())

:link: API

get_channel_info(
    channel_url: str, 
    lang: 'en' | 'ru' = 'en'
) -> dict

Retrieves information about a YouTube channel.

Parameters:

  • channel_url (str): The URL of the YouTube channel to get information about.
  • lang (str): The language of the YouTube page. Can be either 'en' or 'ru'. Defaults to 'en'.

Returns:

A dictionary containing the following information about the channel:

  • author (str): The name of the channel's author.
  • author_id (str): The external ID of the channel's author.
  • author_url (str): The URL of the channel's author.
  • author_thumbnail (str): The URL of the channel's author's thumbnail image.
  • subscriber_count (int): The number of subscribers to the channel.
  • description (str): The description of the channel.
  • view_count (str): The total number of views on the channel.

Example:

{
    'author': 'The Slow Mo Guys',
    'author_id': 'UCUK0HBIBWgM2c4vsPhkYY4w',
    'author_url': 'https://www.youtube.com/channel/UCUK0HBIBWgM2c4vsPhkYY4w',
    'author_thumbnail': 'https://yt3.ggpht.com/ytc/AAUvwnhRnI8Lr...',
    'subscriber_count': 14500000,
    'description': 'The best slow motion on Youtube.  \n\nWe shoot all of our...',
    'view_count': '265308911'
}

:recycle: Contributing

Contributions to aytch are welcome! If you'd like to contribute, please fork the repository and make a pull request.

:warning: License

aytch is licensed under the MIT License. See LICENSE for more information.

Inspired by yt-channel-info

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aytch-0.1.1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

aytch-0.1.1-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page