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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file aytch-0.1.1.tar.gz.

File metadata

  • Download URL: aytch-0.1.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.2 Linux/5.15.0-1037-azure

File hashes

Hashes for aytch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 704b10b9fdf987a5ec70549c34f1e638d2e566d9903623b653b221b17ed92d78
MD5 f981d03e6a8b7af212937e6bb8f38d8e
BLAKE2b-256 7c5eeb27255eeec0e2c54147722152d52136f4950499aef2576ff6e01c697b31

See more details on using hashes here.

File details

Details for the file aytch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aytch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.2 Linux/5.15.0-1037-azure

File hashes

Hashes for aytch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13fa672ce1e0fb8ff57c460cdb74cb48cd853737698e749fdd0a342f5c2fb299
MD5 e3aa57a93bf5a576d519c7e0006cbdc7
BLAKE2b-256 35361d9e07beb443a60128b074a68ea67fd85c296e709d92b03f6ae117c9d111

See more details on using hashes here.

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