Skip to content

How To Use

Adrian Zaręba edited this page Jan 19, 2025 · 2 revisions

Contents

  1. Setting up virtual environment
  2. CLI Usage Guide
  3. GUI Usage Guide
  4. Adapting View

Setting up virtual environment

To create a virtual Python environment for this application, you can use the provided setup script. While in the project directory, open a terminal and run the following command:

python setup_venv.py

Depending on your terminal, Python version, and operating system, you may need to adjust the command accordingly.
Once the script completes, the virtual environment will be created and ready to use.

CLI Usage Guide

  1. Open a terminal and navigate to the project directory.
  2. Ensure all dependencies are installed or venv is created.
  3. Run the CLI tool using the following command format:
    python main_cli.py --mode <1, 2, or 3> --single --url <Playlist or Channel URL> --path <Input file or Output directory>
    For instance:
    python main_cli.py --mode 1 --single --url https://www.youtube.com/playlist?list=PLbpi6ZahtOH4e5qqR_-Fz0fx64qxYPI5W --path C:\Users\user\Desktop\

Flags:

  • --mode: Accepts 1, 2, or 3:
    • 1: "Create New Archive" mode
    • 2: "Update Archive" mode
    • 3: "Export to Spotify" mode
  • --single (optional): Used in mode 1. When provided, the --url flag must include a playlist URL. If absent, the program expects a channel ID instead.
  • --url (required in mode 1): Must specify a valid playlist URL (public or non-public) or channel ID.
  • --path: In mode 1, this should point to a writable output directory. In modes 2 and 3, this should reference a JSON archive file created in mode 1.
  • --help: Displays all available flags and usage details.

GUI Usage Guide

  1. Ensure your operating system is compatible with the application. The app supports the following:
    • Windows: Version 10 or higher,
    • Linux: Distribution Ubuntu, Mint with Python installed,
    • Program should work on different OS, but it was not tested
  2. Verify that all dependencies are installed or venv is created.

Steps to Launch the GUI:

  1. Open a terminal and navigate to the directory containing the project files. You can use the following command:
cd /path/to/project
  1. Run the GUI application by executing:
python main.py
  • If you encounter issues with this command, ensure that you are using the correct Python version (Python 3.x is required). To explicitly specify the Python 3 interpreter, you can use:
python3 main.py
  1. Once the application launches, follow the on-screen instructions to interact with the GUI:
    • Navigation: Use buttons as prompted to access different features.
    • Modes: Select the desired operation mode ("Create Archive", "Update Archive", or "Export to Spotify").
    • Options: Use radio buttons and checkboxes to select preferred application behaviour and outputs.
    • Inputs: Provide necessary details such as playlist URLs, channel IDs, or files when prompted.
    • Outputs: Specify where to save generated files or archives.
    • Dialog Windows: Mind all messages that will pop up on your screen, that show information about successful operations or they may inform you about errors in program or input data Generally speaking, navigate through the app by following the instructions and buttons from top to bottom.

Adapting View

If you're interested in creating custom front view for this application, Class Playlist Manager has all public methods that are needed to use all present functionalities, code from both CLI and GUI may serve as an example of usage.

Clone this wiki locally