Giter Club home page Giter Club logo

Comments (3)

Tzahi12345 avatar Tzahi12345 commented on July 24, 2024

Hi!

The API is implemented, you can view examples here, and all available routes at the official docs.

You almost got it right. Basically, the /api/tomp4 route is a POST request, so you have to do 2 things:

  1. Send the request using curl or postman, you can't send it through a browser
  2. Include the video URL as a body parameter, not a query parameter

This might seem confusing, but the API key must be kept as a query parameter (so you did that part right). The reason for this is not all requests have a body (like GET requests), so it rides along with the request URL instead for consistency.

Here's an example of what that would look like:

curl -XPOST -H "Content-type: application/json" -d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}' 'http://192.168.0.201:17442/api/tomp4?apiKey=692-xxx59df57b'

The "url" parameter is moved to the body, while the apiKey stays as a query param. If you have curl installed (most systems do), you can type this into your command line and it should work.

from youtubedl-material.

hernandito avatar hernandito commented on July 24, 2024

Thank you!

I am so used to API web requests, I thought that was how it was meant to work. I am off to learn about how to invoke a curl request in my php/javascript code.

Thanks again.

Love the app!

from youtubedl-material.

Tzahi12345 avatar Tzahi12345 commented on July 24, 2024

Glad you like it! :) Happy to help, don't hesitate to open up any more issues if you come across a problem/suggestion.

Apparently PHP does have a curl library, though JS and PHP can send POST requests natively as well (i.e. w/o a library). Anyways, I'll close out this issue, but if you run into any problems sending the API requests you can comment here and I'll be happy to help.

from youtubedl-material.

Related Issues (20)

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.