Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

533
Views
Devolver respuesta de archivo/transmisión de googlevideo en API rápida

Estoy usando Fast API para devolver una respuesta en video de googlevideo.com. Este es el código que estoy usando:

 @app.get(params.api_video_route) async def get_api_video(url=None): def iter(): req = urllib.request.Request(url) with urllib.request.urlopen(req) as resp: yield from io.BytesIO(resp.read()) return StreamingResponse(iter(), media_type="video/mp4")

Pero esto no está funcionando

Quiero que este Nodejs se convierta en python FAST API:

 app.get("/download-video", function(req, res) { http.get(decodeURIComponent(req.query.url), function(response) { res.setHeader("Content-Length", response.headers["content-length"]); if (response.statusCode >= 400) res.status(500).send("Error"); response.on("data", function(chunk) { res.write(chunk); }); response.on("end", function() { res.end(); }); }); });
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Utilice lo siguiente en su lugar, como se describe en la documentación aquí .

 #yield from io.BytesIO(resp.read()) yield from resp
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!