From 619492bdbfd821a3a9698adddbf61679d180e74f Mon Sep 17 00:00:00 2001 From: Adam Eehan Date: Sun, 27 Sep 2026 02:52:08 +0530 Subject: [PATCH] Document AiraLang youtube module features Added documentation for the AiraLang youtube module, including installation instructions, import statements, methods, properties, and an example usage. --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/README.md b/README.md index 02706fc..665fefa 100644 --- a/README.md +++ b/README.md @@ -427,6 +427,52 @@ say "Current Time: " + time.now(); import "utils.aira"; let output = utils.my_custom_function(); ``` +# 🎬 AiraLang `youtube` Module +> **YouTube Video and Audio Downloader Engine (via APM)** + +## Installation +```bash +aira install youtube +# or +airalang install youtube +``` + +## Import +```aira +import "youtube"; +// or alias: +import "yt"; +``` + +## Methods & Properties +- `youtube.get(url)`: Fetches video metadata and returns a `video` object. + - `video.title`: Video title string. + - `video.duration`: Duration in seconds. + - `video.author`: Channel / uploader name. + - `video.views`: Video view count. + - `video.stream(format)`: Returns a `stream` object (format can be `"mp4"` or `"mp3"`). + - `stream.download([save_path])`: Downloads the stream to specified file or default title. +- `os.save(filename)`: Configures and creates the destination file path. + +## Example +```aira +import "youtube"; +import "os"; + +let url = input("Enter Your URL Here : "); + +let video = youtube.get(url); +say "Video Title : " + video.title; + +let stream = video.stream("mp4"); + +let save = os.save("video.mp4"); + +say "Starting Download..."; +stream.download(save); + +say "Download Finished Successfully!"; +``` ---