Skip to content

Conversation

@aninhasalesp
Copy link

@aninhasalesp aninhasalesp commented Jun 25, 2024

Add command to extract youtube channel IDs from URLs and generate CSV

Overview

This PR introduces the ChannelId command, which extracts YouTube channel IDs from URLs or from a CSV file containing URLs and generates a CSV file with the channel IDs. Additionally, it refactors the CLI tool to use a command-based structure, with a base Command class to standardize command implementation.

Features

  • Command Implementation: ChannelId command to handle the extraction of youtube channel IDs.
  • Command execution: Enhanced execute method to handle the end-to-end process of fetching channel IDs and generating the output CSV.
  • Command Base Class: Implemented Command as a foundational class for defining CLI commands.
  • Default Execution Method: Introduced parse_arguments method to configure argument parsing and set execute method as the default action for each command.
  • Extendable Execution Logic: Included an abstract execute method, to be overridden by subclasses, for executing command-specific logic.

Usage

To use the new ChannelId command:

  1. From a list of URLs:

    python cli.py --api_key <api_key> channel-id --urls <url1> <url2> --output-file-path <output_path>
  2. These are other ways to run the ChannelId command:

  • The command was designed to extract the YouTube channel ID associated with a provided URL.
   python cli.py --api-key <api_key> channel-id --urls <url1>
  • The command is used to perform automated extraction of YouTube channel IDs from URLs contained in a CSV file.
   python cli.py --api-key <api_key> channel-id --urls-file-path <input_csv_path>

@aninhasalesp aninhasalesp changed the base branch from develop to feature/cli June 25, 2024 15:03
@aninhasalesp aninhasalesp marked this pull request as ready for review July 2, 2024 14:06
@aninhasalesp aninhasalesp changed the base branch from feature/cli to develop September 12, 2024 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants