Yout.com API o lo'o talimalo ile dvr.yout.com
.
Ina ia maua le Yout.com API, e tatau ona e aofia ai lau ki API tulaga ese. E mafai ona e mauaina se ki API e ala i le sainia i lau tuatusi imeli. Faamolemole ia manatua e le faalauaiteleina lau ki API.
O le faʻamaoniga ma le API e faʻatautaia e ala i ulutala HTTP. O talosaga uma e mana'omia se ulutala Fa'atagaga o lo'o iai lau ki API i le ki fa'atulagaina: YOUR_API_KEY
, lea o YOUR_API_KEY
o le ki lea e maua i lau itulau fa'amatalaga.
Mo le saogalemu, o talosaga uma e tatau ona lafo i luga o se faʻailoga HTTPS fesoʻotaʻiga e puipuia ai au faʻamatalaga i le taimi o faʻasalalauga.
Lafo le URL vitio/leo i le Yout.com API mo le suiga o le MP3. O le API o le a otometi lava ona iloa le leo / vitio ma saunia mo le toe faʻaleleia lelei i masini eseese.
Fa'ata'ita'iga mo le MP3 Fa'asologa-Suiga
Sui YOUR_API_KEY
i lau ki API tulaga ese (maua i lau itulau fa'amatalaga Yout.com) ma sui le AUDIO_URL i le URL o leo/vitio:
import requests
import base64
headers = {"Authorization": "API_KEY"}
audio_url = base64.b64encode("AUDIO_URL")
r = requests.post(
url="http://dvr.yout.com/mp3",
headers=headers,
data={
"video_url": audio_url,
"start_time": False,
"end_time": False,
"title": "Hello world",
"artist": "Hello world",
"audio_quality": '128k',
}
)
with open("audio.mp3" "wb") as fd:
for chunk in r.iter_content(chunk_size=128):
fd.write(chunk)
const axios = require('axios');
const headers = {
Authorization: "API_KEY"
};
const audioUrl = Buffer.from("AUDIO_URL").toString('base64');
const data = {
video_url: audioUrl,
start_time: false,
end_time: false,
title: "Hello world",
artist: "Hello world",
audio_quality: "128k"
};
axios
.post("http://dvr.yout.com/mp3", data, { headers })
.then(response => {
const fs = require('fs');
const fileStream = fs.createWriteStream("audio.mp3");
response.data.pipe(fileStream);
fileStream.on('finish', () => {
console.log("Archivo descargado con éxito como audio.mp3");
});
fileStream.on('error', error => {
console.error("Error al escribir el archivo:", error);
});
})
.catch(error => {
console.error("Error en la solicitud:", error);
});
<?php
$audio_url = base64_encode("AUDIO_URL");
// Datos para enviar en la solicitud POST
$data = [
"video_url" => $audio_url,
"start_time" => false,
"end_time" => false,
"title" => "Hello world",
"artist" => "Hello world",
"audio_quality" => "128k"
];
// Convertir los datos a formato URL-encoded
$postData = http_build_query($data);
// Configurar la solicitud cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://dvr.yout.com/mp3");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: API_KEY",
"Content-Type: application/x-www-form-urlencoded"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Ejecutar la solicitud
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
// Guardar el archivo de audio
$file = fopen("audio.mp3", "wb");
fwrite($file, $response);
fclose($file);
echo "Archivo descargado con éxito como audio.mp3";
} else {
echo "Error en la solicitud. Código HTTP: $httpCode";
}
?>
curl -X POST "http://dvr.yout.com/mp3" \
-H "Authorization: API_KEY" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "video_url=$(echo -n 'AUDIO_URL' | base64)" \
-d "start_time=false" \
-d "end_time=false" \
-d "title=Hello world" \
-d "artist=Hello world" \
-d "audio_quality=128k" \
--output audio.mp3
Lafo le URL vitio/leo i le Yout.com API mo MP4 format-shifting. O le API o le a otometi lava ona iloa le leo / vitio ma saunia mo le toe faʻaleleia lelei i masini eseese.
Fa'ata'ita'iga mo le MP4 Fa'asologa-Suiga
Sui YOUR_API_KEY
i lau ki API tulaga ese (maua i lau itulau fa'amatalaga Yout.com) ma sui le VIDEO_URL i le URL o leo/vitio:
import requests
import base64
headers = {"Authorization": "API_KEY"}
video_url = base64.b64encode("VIDEO_URL")
r = requests.post(
url="http://dvr.yout.com/mp4",
headers=headers,
data={
"video_url": video_url,
"start_time": False,
"end_time": False,
"title": "hello world",
"video_quality": 720
}
)
with open("audio.mp4" "wb") as fd:
for chunk in r.iter_content(chunk_size=128):
fd.write(chunk)
const axios = require('axios');
const headers = {
Authorization: "API_KEY"
};
const audioUrl = Buffer.from("AUDIO_URL").toString('base64');
const data = {
video_url: video_url,
start_time: false,
end_time: false,
title" "hello world",
video_quality: 720
};
axios
.post("http://dvr.yout.com/mp3", data, { headers })
.then(response => {
const fs = require('fs');
const fileStream = fs.createWriteStream("audio.mp3");
response.data.pipe(fileStream);
fileStream.on('finish', () => {
console.log("Archivo descargado con éxito como audio.mp3");
});
fileStream.on('error', error => {
console.error("Error al escribir el archivo:", error);
});
})
.catch(error => {
console.error("Error en la solicitud:", error);
});
<?php
$video_url = base64_encode("VIDEO_URL");
$data = [
"video_url" => $video_url,
"start_time" => false,
"end_time" => false,
"title" => "hello world",
"video_quality" => 720
];
$postData = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://dvr.yout.com/mp4");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: API_KEY",
"Content-Type: application/x-www-form-urlencoded"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$file = fopen("video.mp4", "wb");
fwrite($file, $response);
fclose($file);
echo "Archivo descargado con éxito como video.mp4";
} else {
echo "Error en la solicitud. Código HTTP: $httpCode";
}
?>
curl -X POST "http://dvr.yout.com/mp4" \
-H "Authorization: API_KEY" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "video_url=$(echo -n 'VIDEO_URL' | base64)" \
-d "start_time=false" \
-d "end_time=false" \
-d "title=hello world" \
-d "video_quality=720" \
--output video.mp4
Le leo / vitio URL i base64. Siaki itulau uma matou te lagolagoina. Kiliki iinei
E fa'aoga lea e tipi ai le leo po'o le vitiō ma fa'atusa i le lona lua e te mana'o e amata ai le pu'eina o leo/vitio. E mafai ona e lafo false
e ta'u mai ai e tatau ona amata mai le 0th second.
E fa'aoga lea e tipi ai le leo po'o le vitiō ma fa'atusa i le lona lua e te mana'o e fa'auma le pu'eina o leo/vitio. E mafai ona e lafo <code>false</code> pe a e le mana'o e tipi le leo/vitio.
Le ulutala o le a pueina ai le leo/vitio; e fa'aoga fo'i e ta'u ai le faila na faia.
Le igoa o le tusiata lea o le a faamaumau ai le faila.
Le lelei o le a fa'amauina ai le faila leo. O uiga o lo'o avanoa e 32k
, 64k
, 128k
, 256k
, po'o 320k
.
Le tulaga lelei o le a faamaumauina ai le faila vitio. O uiga lelei o lo'o avanoa e 144
, 240
, 360
, 480
, 720
(Mo HD), 1080
(Mo UHD), 2160
(Mo le 4k), po'o 4320
(Mo le 8k).