import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
restream = client.streaming.restreams.update(
restream_id=0,
)
print(restream.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
restream, err := client.Streaming.Restreams.Update(
context.TODO(),
0,
streaming.RestreamUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", restream.ID)
}
curl --request PATCH \
--url https://api.gcore.com/streaming/restreams/{restream_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"restream": {
"name": "first restream",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10,
"source": "original",
"no_audio": true,
"no_audio_mode": "silence"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
restream: {
name: 'first restream',
active: true,
uri: 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
stream_id: 20,
client_user_id: 10,
source: 'original',
no_audio: true,
no_audio_mode: 'silence'
}
})
};
fetch('https://api.gcore.com/streaming/restreams/{restream_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/streaming/restreams/{restream_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'restream' => [
'name' => 'first restream',
'active' => true,
'uri' => 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
'stream_id' => 20,
'client_user_id' => 10,
'source' => 'original',
'no_audio' => true,
'no_audio_mode' => 'silence'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/streaming/restreams/{restream_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10,\n \"source\": \"original\",\n \"no_audio\": true,\n \"no_audio_mode\": \"silence\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/restreams/{restream_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10,\n \"source\": \"original\",\n \"no_audio\": true,\n \"no_audio_mode\": \"silence\"\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "Live Stream to Youtube 2024-06-21",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live2/6w4g-9cw7-62dh-c6se-b4hq",
"stream_id": 1439046,
"client_user_id": 1000,
"source": "transcoded",
"no_audio": true,
"no_audio_mode": "silence",
"id": 287834,
"live": false,
"client_id": 102748,
"playlist_id": null,
"quality_id": null
}This response has no body data.Change restream
Updates restream settings, such as the target URI or active status
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
restream = client.streaming.restreams.update(
restream_id=0,
)
print(restream.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
restream, err := client.Streaming.Restreams.Update(
context.TODO(),
0,
streaming.RestreamUpdateParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", restream.ID)
}
curl --request PATCH \
--url https://api.gcore.com/streaming/restreams/{restream_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"restream": {
"name": "first restream",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live/k17a-13s8",
"stream_id": 20,
"client_user_id": 10,
"source": "original",
"no_audio": true,
"no_audio_mode": "silence"
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
restream: {
name: 'first restream',
active: true,
uri: 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
stream_id: 20,
client_user_id: 10,
source: 'original',
no_audio: true,
no_audio_mode: 'silence'
}
})
};
fetch('https://api.gcore.com/streaming/restreams/{restream_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/streaming/restreams/{restream_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'restream' => [
'name' => 'first restream',
'active' => true,
'uri' => 'rtmp://a.rtmp.youtube.com/live/k17a-13s8',
'stream_id' => 20,
'client_user_id' => 10,
'source' => 'original',
'no_audio' => true,
'no_audio_mode' => 'silence'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/streaming/restreams/{restream_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10,\n \"source\": \"original\",\n \"no_audio\": true,\n \"no_audio_mode\": \"silence\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/restreams/{restream_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"restream\": {\n \"name\": \"first restream\",\n \"active\": true,\n \"uri\": \"rtmp://a.rtmp.youtube.com/live/k17a-13s8\",\n \"stream_id\": 20,\n \"client_user_id\": 10,\n \"source\": \"original\",\n \"no_audio\": true,\n \"no_audio_mode\": \"silence\"\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "Live Stream to Youtube 2024-06-21",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live2/6w4g-9cw7-62dh-c6se-b4hq",
"stream_id": 1439046,
"client_user_id": 1000,
"source": "transcoded",
"no_audio": true,
"no_audio_mode": "silence",
"id": 287834,
"live": false,
"client_id": 102748,
"playlist_id": null,
"quality_id": null
}This response has no body data.Authorizations
Body
Response
Successful
Removes the source audio track from the restream. Has two possible values:
- false – the source audio track is forwarded to the target as is (default)
- true – the audio track is removed or replaced, depending on
no_audio_mode
Useful to avoid copyright claims on platforms like YouTube when the source stream contains licensed music or other copyrighted audio.
Only strict boolean values (true/false) are accepted; any other value returns a 422 error.
Defines how the audio track is handled when no_audio is true. Ignored when no_audio is false.
Types:
- "drop" – removes the audio track entirely.
- "silence" – replaces the audio track with a silent track instead of removing it.
Note: YouTube rejects incoming streams with no audio track at all. Use
no_audio_mode=silencewhen restreaming to YouTube.
drop, silence Selects which version of the stream is used as the source for the restream.
Types:
- "original" – uses the original ingested stream without any modifications (default).
- "transcoded" – uses the transcoded output, including overlays. Use it when you want to restream the stream with enabled overlays.
Note: For
transcoded, the highest quality available in the stream's quality ladder is used. For example, if the ladder is 480p/720p/1080p, 1080p is used; if the ladder goes up to 4K, 4K is used.
original, transcoded Was this page helpful?