GithubHelp home page GithubHelp logo

dynamusic's Introduction

DynamusicAPI Documentation

DynamusicAPI is a simple and efficient API to search music on YouTube Music and extract audio from YouTube videos. The API is built using FastAPI and leverages youtube_dlp for extracting audio. This documentation provides details on how to use the API endpoints btw if your in a country unsuported by youtube music the output will be bad so host it on a supported country.

Table of Contents

Installation

To install and run DynamusicAPI, follow these steps:

  1. Clone the repository:

    git clone https://github.com/hiruy32/dynamusicapi.git
    cd dynamusicapi
  2. Install dependencies:

    pip install fastapi uvicorn requests youtube_dlp
  3. Run the application:

    uvicorn main:app --reload

Usage

Once the server is running, you can access the API at http://127.0.0.1:8000. You can use tools like curl, Postman, or your web browser to interact with the API endpoints.

Endpoints

Root

GET /

Returns a welcome message.

Response:

{
    "message": "Welcome to DynamusicAPI!"
}

Search YouTube Music

GET /search-youtube-music

Searches for music on YouTube Music based on the query provided.

Parameters:

  • query (str): The search query.

Response:

  • JSON response from YouTube Music API.

Example:

curl -X 'GET' \
  'http://127.0.0.1:8000/search-youtube-music?query=your_search_query' \
  -H 'accept: application/json'

Response Example:

{
    "contents": [...]
}

Extract Audio

GET /extract-audio

Extracts audio from a YouTube video URL and provides the direct URL to the audio stream.

Parameters:

  • url (str): The YouTube video URL.

Response:

  • audio_url (str): The direct URL to the audio stream.
  • response_time (float): The time taken to process the request.

Example:

curl -X 'GET' \
  'http://127.0.0.1:8000/extract-audio?url=your_youtube_video_url' \
  -H 'accept: application/json'

Response Example:

{
    "audio_url": "http://audio.url",
    "response_time": 2.34
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

dynamusic's People

Contributors

hiruy56 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.