Giter Site home page Giter Site logo

cobalt's Introduction

cobalt-cli

GitHub Release Static Badge Static Badge GitHub License

Unofficial cobalt command line client made in go. cobalt-cli uses gobalt library for communication between your machine <-> cobalt servers.

Features

  • Get directly link from the service cdn (if possible);
  • More than 15 services supported;
  • JSON output using the flag -j or --json;
  • Option to check status of cobalt servers;
  • Use custom cobalt instances (see https://instances.hyper.lol);
  • Get dubbed youtube audio.

Download

Platform/OS Download link
Windows x64 / x86 / arm
Linux x64 / x86 / arm64
Mac Intel / M1, M2, M3

You can also check the releases page to download the latest version according to your platform.

Alternatively, if you have Go installed, you can use go install github.com/lostdusty/cobalt@latest to install to your machine.

Roadmap

Planned features for cobalt-cli:

  • Json output;
    • Time expiration for the returned url.
  • Option to save file to the current/custom folder, likely -s flag;
    • Display progress bar to track download progress (when supported by cobalt).
    • Hability to use custom downloader program (wget, curl, got, etc);
  • Translations.

Usage

cobalt-cli has two subcommands:

  • download: downloads something using cobalt
  • instances: lists all known cobalt instances
Usage: cobalt <command>
Commands:
  download  - Use this command to download something.
  instances - Use this command to view stats about other cobalt instances.
Error: No command was provided. Please specify a command.

Download

usage: cobalt download [-h|--help] [-u|--url "<value>"] [-c|--video-codec
              (av1|vp9|h264)] [-q|--video-quality
              (144|240|360|480|720|1080|1440|2160)] [-f|--audio-format
              (opus|ogg|wav|mp3|best)] [-p|--filename-pattern
              (basic|pretty|nerdy|classic)] [-a|--no-video] [-T|--tiktok-h265]
              [-t|--full-tiktok-audio] [-v|--no-audio] [-d|--dubbed-audio]
              [-m|--metadata] [-g|--gif] [-j|--json] [-s|--status] [-i|--api
              "<value>"] [-l|--language "<value>"] [-b|--browser]

              download something using cobalt

Arguments:

  -h  --help               Print help information
  -u  --url                The url to download using cobalt
  -c  --video-codec        Video codec to be used. Applies only to youtube
                           downloads. AV1: 8K/HDR, lower support | VP9: 4K/HDR,
                           best quality | H264: 1080p, works everywhere.
                           Default: h264
  -q  --video-quality      Quality of the video, also applies only to youtube
                           downloads. Default: 1080
  -f  --audio-format       Audio format/codec to be used. "best" doesn't
                           re-encodes the audio. Default: best
  -p  --filename-pattern   File name pattern. Classic:
                           youtube_yPYZpwSpKmA_1920x1080_h264.mp4 | audio:
                           youtube_yPYZpwSpKmA_audio.mp3 // Basic: Video Title
                           (1080p, h264).mp4 | audio: Audio Title - Audio
                           Author.mp3 // Pretty: Video Title (1080p, h264,
                           youtube).mp4 | audio: Audio Title - Audio Author
                           (soundcloud).mp3 // Nerdy: Video Title (1080p, h264,
                           youtube, yPYZpwSpKmA).mp4 | audio: Audio Title -
                           Audio Author (soundcloud, 1242868615).mp3. Default:
                           pretty
  -a  --no-video           Downloads only the audio, and removes the video.
                           Default: false
  -T  --tiktok-h265        Downloads TikTok videos using h265 codec. Default:
                           false
  -t  --full-tiktok-audio  Download the original sound used in a tiktok video.
                           Default: false
  -v  --no-audio           Downloads only the video, without audio, when
                           possible. Default: false
  -d  --dubbed-audio       Downloads youtube audio dubbed, if present. Change
                           the language using -l <ISO 639-1 format>. Default:
                           false
  -m  --metadata           Disables file metadata. Default: false
  -g  --gif                Convert twitter gifs to .gif. Default: true
  -j  --json               Output to stdout as json
  -s  --status             Check status of the selected cobalt server, prints
                           and exits. All other options will be ignored, except
                           -j | --json. Default: false
  -i  --api                Change the cobalt api url used. See others instances
                           in https://instances.hyper.lol. Default:
                           https://api.cobalt.tools
  -l  --language           Downloads dubbed youtube audio according to the
                           language set following the ISO 639-1 format. Only
                           takes effect if -d was passed as an argument.
                           Default: en
  -b  --browser            Downloads the requested media in your browser.
                           Default: false

Instances

usage: cobalt instances [-h|--help] [-j|--json]

              get the list of cobalt instances

Arguments:

  -h  --help  Print help information
  -j  --json  Output to stdout as json

JSON Output

Documentation for the json output of cobalt-cli.

Download

All json output from the download subcommands follows this format:

{
  "error": bool,
  "message": "string",
  "urls": ["string1", "string2", ...]
}

Where:

name type info example
error bool true if something went wrong "error":true
message string return error messages, otherwise "ok" "message":"cobalt error: i couldn't connect to the service api. maybe it's down, or cobalt got blocked"
urls []string array of urls returned by the service, query scaped "urls":["https%3A%2F%2Fus3-co.wuk.sh%2Fapi%2Fstream%3Ft%3D6kS3Xr97CAoqvPlBYX0r8%26e%3D1713849463113%26h%3DNHPfrLZ-BJejEnH2orowNy0zzTlVXSYw77RBhzIf0MU%26s%3DxvmTt9DTNl4wLslkfYfCUv6UDIPOTv9iZutl7ENM_dc%26i%3DuX7INLhsbzzofNxZaw6o7g"]

Instances

Returns almost the original json from https://instances.hyper.lol/, except we add two extra keys: error and message, just like above.

Example JSON:

[{"error":false,"message":"success!"},[{"version":"7.12.6","commit":"50a98c8","branch":"current","name":"us3","url":"co.wuk.sh","cors":1,"startTime":"1713626380117","FrontendUrl":"cobalt.tools","ApiOnline":true,"FrontEndOnline":true},{"version":"7.12.6","commit":"50a98c8","branch":"current","name":"us-east","url":"cobalt.canine.tools","cors":1,"startTime":"1713837765475","FrontendUrl":"cobalt.canine.tools","ApiOnline":true,"FrontEndOnline":true},{"version":"7.12.6","commit":"50a98c8","branch":"current","name":"us-mw","url":"coapi.selfstacked.com","cors":1,"startTime":"1713626820678","FrontendUrl":"co.selfstacked.com","ApiOnline":true,"FrontEndOnline":true}]]

Error example:

{"error":true,"message":"Get \"https://instances.hyper.lol/instances.json\": dial tcp: lookup instances.hyper.lol: no such host"}

Compiling

Make sure you have the lastest go compiler. Download it here.

Easy as:

  1. Clone this repository.
  2. On the root of this repository, run go mod tidy. This will download this project dependencies.
  3. To run the application, use go run .. To compile, run go build.

To add additional Windows metadata, you'll need:

  • go-winres, follow the install instructions there

Then run go-winres make on the root of this repository, it will create two .syso files.

After that, building with go build will automatically embed these files on the Windows executable.

Other projects

Check out too:

About & Thanks

  • cobalt made by wukko && jj, cool people;
  • argparse, for handling args;
  • Icon made by me;
  • You, for using my application!

cobalt's People

Contributors

lostdusty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.