gcore 0.13.0__py3-none-any.whl → 0.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/__init__.py +3 -1
- gcore/_base_client.py +9 -9
- gcore/_client.py +25 -10
- gcore/_models.py +10 -4
- gcore/_qs.py +7 -7
- gcore/_types.py +18 -11
- gcore/_utils/_transform.py +2 -2
- gcore/_utils/_utils.py +4 -4
- gcore/_version.py +1 -1
- gcore/pagination.py +137 -0
- gcore/resources/__init__.py +14 -0
- gcore/resources/cdn/__init__.py +201 -0
- gcore/resources/cdn/audit_log.py +406 -0
- gcore/resources/cdn/cdn.py +957 -0
- gcore/resources/cdn/certificates.py +1062 -0
- gcore/resources/cdn/ip_ranges.py +224 -0
- gcore/resources/cdn/logs/__init__.py +33 -0
- gcore/resources/cdn/logs/logs.py +1424 -0
- gcore/resources/cdn/logs/settings.py +1081 -0
- gcore/resources/cdn/logs_uploader/__init__.py +61 -0
- gcore/resources/cdn/logs_uploader/configs.py +868 -0
- gcore/resources/cdn/logs_uploader/logs_uploader.py +166 -0
- gcore/resources/cdn/logs_uploader/policies.py +1060 -0
- gcore/resources/cdn/logs_uploader/targets.py +811 -0
- gcore/resources/cdn/metrics.py +419 -0
- gcore/resources/cdn/network_capacity.py +139 -0
- gcore/resources/cdn/origin_groups.py +1496 -0
- gcore/resources/cdn/resources/__init__.py +47 -0
- gcore/resources/cdn/resources/resources.py +2060 -0
- gcore/resources/cdn/resources/rules.py +1027 -0
- gcore/resources/cdn/resources/shield.py +259 -0
- gcore/resources/cdn/rule_templates.py +883 -0
- gcore/resources/cdn/shields.py +139 -0
- gcore/resources/cdn/statistics.py +1408 -0
- gcore/resources/cdn/trusted_ca_certificates.py +592 -0
- gcore/resources/cloud/audit_logs.py +33 -29
- gcore/resources/cloud/baremetal/flavors.py +21 -17
- gcore/resources/cloud/baremetal/images.py +19 -15
- gcore/resources/cloud/baremetal/servers.py +141 -119
- gcore/resources/cloud/billing_reservations.py +41 -33
- gcore/resources/cloud/cloud.py +24 -0
- gcore/resources/cloud/cost_reports.py +149 -119
- gcore/resources/cloud/file_shares/access_rules.py +25 -13
- gcore/resources/cloud/file_shares/file_shares.py +107 -71
- gcore/resources/cloud/floating_ips.py +101 -59
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +13 -9
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +275 -65
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +69 -53
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +9 -5
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +151 -127
- gcore/resources/cloud/inference/api_keys.py +51 -31
- gcore/resources/cloud/inference/applications/deployments.py +49 -31
- gcore/resources/cloud/inference/applications/templates.py +17 -9
- gcore/resources/cloud/inference/deployments/deployments.py +171 -139
- gcore/resources/cloud/inference/deployments/logs.py +17 -13
- gcore/resources/cloud/inference/flavors.py +21 -13
- gcore/resources/cloud/inference/inference.py +9 -5
- gcore/resources/cloud/inference/registry_credentials.py +45 -25
- gcore/resources/cloud/inference/secrets.py +45 -25
- gcore/resources/cloud/instances/flavors.py +17 -13
- gcore/resources/cloud/instances/images.py +153 -129
- gcore/resources/cloud/instances/instances.py +287 -213
- gcore/resources/cloud/instances/interfaces.py +165 -161
- gcore/resources/cloud/instances/metrics.py +9 -5
- gcore/resources/cloud/ip_ranges.py +25 -15
- gcore/resources/cloud/k8s/clusters/clusters.py +151 -87
- gcore/resources/cloud/k8s/clusters/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/pools.py +83 -59
- gcore/resources/cloud/k8s/flavors.py +13 -9
- gcore/resources/cloud/k8s/k8s.py +9 -5
- gcore/resources/cloud/load_balancers/flavors.py +11 -7
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +103 -83
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +77 -57
- gcore/resources/cloud/load_balancers/listeners.py +125 -105
- gcore/resources/cloud/load_balancers/load_balancers.py +155 -123
- gcore/resources/cloud/load_balancers/metrics.py +9 -5
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +25 -17
- gcore/resources/cloud/load_balancers/pools/members.py +31 -23
- gcore/resources/cloud/load_balancers/pools/pools.py +155 -129
- gcore/resources/cloud/load_balancers/statuses.py +17 -9
- gcore/resources/cloud/networks/networks.py +79 -55
- gcore/resources/cloud/networks/routers.py +75 -47
- gcore/resources/cloud/networks/subnets.py +105 -81
- gcore/resources/cloud/placement_groups.py +33 -17
- gcore/resources/cloud/projects.py +53 -41
- gcore/resources/cloud/quotas/quotas.py +25 -13
- gcore/resources/cloud/quotas/requests.py +41 -25
- gcore/resources/cloud/regions.py +25 -23
- gcore/resources/cloud/registries/artifacts.py +17 -9
- gcore/resources/cloud/registries/registries.py +55 -29
- gcore/resources/cloud/registries/repositories.py +17 -9
- gcore/resources/cloud/registries/tags.py +9 -5
- gcore/resources/cloud/registries/users.py +65 -35
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +123 -107
- gcore/resources/cloud/reserved_fixed_ips/vip.py +45 -25
- gcore/resources/cloud/secrets.py +43 -27
- gcore/resources/cloud/security_groups/rules.py +55 -43
- gcore/resources/cloud/security_groups/security_groups.py +79 -47
- gcore/resources/cloud/ssh_keys.py +51 -31
- gcore/resources/cloud/tasks.py +57 -45
- gcore/resources/cloud/usage_reports.py +27 -23
- gcore/resources/cloud/users/role_assignments.py +49 -33
- gcore/resources/cloud/volumes.py +237 -201
- gcore/resources/dns/dns.py +17 -13
- gcore/resources/dns/locations.py +29 -17
- gcore/resources/dns/metrics.py +13 -9
- gcore/resources/dns/pickers/pickers.py +5 -5
- gcore/resources/dns/pickers/presets.py +9 -5
- gcore/resources/dns/zones/dnssec.py +19 -11
- gcore/resources/dns/zones/rrsets.py +149 -91
- gcore/resources/dns/zones/zones.py +245 -187
- gcore/resources/fastedge/apps/apps.py +105 -89
- gcore/resources/fastedge/apps/logs.py +25 -21
- gcore/resources/fastedge/binaries.py +33 -17
- gcore/resources/fastedge/fastedge.py +5 -5
- gcore/resources/fastedge/kv_stores.py +43 -31
- gcore/resources/fastedge/secrets.py +69 -45
- gcore/resources/fastedge/statistics.py +25 -17
- gcore/resources/fastedge/templates.py +59 -39
- gcore/resources/iam/api_tokens.py +43 -27
- gcore/resources/iam/iam.py +5 -5
- gcore/resources/iam/users.py +97 -65
- gcore/resources/security/bgp_announces.py +27 -19
- gcore/resources/security/events.py +23 -19
- gcore/resources/security/profile_templates.py +9 -5
- gcore/resources/security/profiles.py +69 -45
- gcore/resources/storage/buckets/buckets.py +37 -25
- gcore/resources/storage/buckets/cors.py +19 -11
- gcore/resources/storage/buckets/lifecycle.py +19 -11
- gcore/resources/storage/buckets/policy.py +25 -13
- gcore/resources/storage/credentials.py +19 -15
- gcore/resources/storage/locations.py +13 -9
- gcore/resources/storage/statistics.py +39 -31
- gcore/resources/storage/storage.py +105 -69
- gcore/resources/streaming/ai_tasks.py +307 -197
- gcore/resources/streaming/broadcasts.py +63 -35
- gcore/resources/streaming/directories.py +65 -39
- gcore/resources/streaming/players.py +47 -31
- gcore/resources/streaming/playlists.py +189 -123
- gcore/resources/streaming/quality_sets.py +69 -39
- gcore/resources/streaming/restreams.py +47 -27
- gcore/resources/streaming/statistics.py +613 -407
- gcore/resources/streaming/streams/overlays.py +107 -67
- gcore/resources/streaming/streams/streams.py +403 -263
- gcore/resources/streaming/videos/subtitles.py +131 -75
- gcore/resources/streaming/videos/videos.py +429 -279
- gcore/resources/waap/advanced_rules.py +9 -5
- gcore/resources/waap/custom_page_sets.py +99 -75
- gcore/resources/waap/domains/advanced_rules.py +157 -99
- gcore/resources/waap/domains/api_discovery.py +71 -47
- gcore/resources/waap/domains/api_path_groups.py +9 -5
- gcore/resources/waap/domains/api_paths.py +79 -83
- gcore/resources/waap/domains/custom_rules.py +89 -59
- gcore/resources/waap/domains/domains.py +59 -41
- gcore/resources/waap/domains/firewall_rules.py +83 -55
- gcore/resources/waap/domains/insight_silences.py +59 -39
- gcore/resources/waap/domains/insights.py +39 -27
- gcore/resources/waap/domains/settings.py +21 -13
- gcore/resources/waap/domains/statistics.py +99 -75
- gcore/resources/waap/insights.py +23 -21
- gcore/resources/waap/ip_info/ip_info.py +65 -33
- gcore/resources/waap/ip_info/metrics.py +11 -7
- gcore/resources/waap/organizations.py +17 -13
- gcore/resources/waap/statistics.py +9 -5
- gcore/resources/waap/tags.py +17 -17
- gcore/resources/waap/waap.py +5 -5
- gcore/types/cdn/__init__.py +80 -0
- gcore/types/cdn/audit_log_list_params.py +73 -0
- gcore/types/cdn/ca_certificate.py +53 -0
- gcore/types/cdn/ca_certificate_list.py +10 -0
- gcore/types/cdn/cdn_account.py +86 -0
- gcore/types/cdn/cdn_account_limits.py +27 -0
- gcore/types/cdn/cdn_audit_log_entry.py +66 -0
- gcore/types/cdn/cdn_available_features.py +46 -0
- gcore/types/cdn/cdn_list_purge_statuses_params.py +67 -0
- gcore/types/cdn/cdn_log_entry.py +70 -0
- gcore/types/cdn/cdn_metrics.py +22 -0
- gcore/types/cdn/cdn_metrics_groups.py +13 -0
- gcore/types/cdn/cdn_metrics_values.py +19 -0
- gcore/types/cdn/cdn_resource.py +1977 -0
- gcore/types/cdn/cdn_resource_list.py +10 -0
- gcore/types/cdn/cdn_update_account_params.py +15 -0
- gcore/types/cdn/certificate_create_params.py +51 -0
- gcore/types/cdn/certificate_get_status_params.py +14 -0
- gcore/types/cdn/certificate_list_params.py +29 -0
- gcore/types/cdn/certificate_replace_params.py +39 -0
- gcore/types/cdn/log_download_params.py +279 -0
- gcore/types/cdn/log_list_params.py +273 -0
- gcore/types/cdn/logs/__init__.py +7 -0
- gcore/types/cdn/logs/log_settings.py +172 -0
- gcore/types/cdn/logs/setting_create_params.py +200 -0
- gcore/types/cdn/logs/setting_update_params.py +200 -0
- gcore/types/cdn/logs_aggregated_stats.py +23 -0
- gcore/types/cdn/logs_uploader/__init__.py +23 -0
- gcore/types/cdn/logs_uploader/config_create_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/config_replace_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_update_params.py +32 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config.py +51 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy.py +73 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target.py +236 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target_list.py +10 -0
- gcore/types/cdn/logs_uploader/policy_create_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_list_fields_response.py +8 -0
- gcore/types/cdn/logs_uploader/policy_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/policy_replace_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_update_params.py +61 -0
- gcore/types/cdn/logs_uploader/target_create_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/target_replace_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_update_params.py +249 -0
- gcore/types/cdn/logs_uploader_validation.py +23 -0
- gcore/types/cdn/metric_list_params.py +168 -0
- gcore/types/cdn/network_capacity.py +22 -0
- gcore/types/cdn/origin_group_create_params.py +184 -0
- gcore/types/cdn/origin_group_list_params.py +24 -0
- gcore/types/cdn/origin_group_replace_params.py +190 -0
- gcore/types/cdn/origin_group_update_params.py +190 -0
- gcore/types/cdn/origin_groups.py +212 -0
- gcore/types/cdn/origin_groups_list.py +10 -0
- gcore/types/cdn/public_ip_list.py +15 -0
- gcore/types/cdn/public_network_list.py +15 -0
- gcore/types/cdn/purge_status.py +55 -0
- gcore/types/cdn/resource_aggregated_stats.py +80 -0
- gcore/types/cdn/resource_create_params.py +1825 -0
- gcore/types/cdn/resource_list_params.py +107 -0
- gcore/types/cdn/resource_prefetch_params.py +17 -0
- gcore/types/cdn/resource_purge_params.py +71 -0
- gcore/types/cdn/resource_replace_params.py +1803 -0
- gcore/types/cdn/resource_update_params.py +1794 -0
- gcore/types/cdn/resource_usage_stats.py +111 -0
- gcore/types/cdn/resources/__init__.py +11 -0
- gcore/types/cdn/resources/cdn_resource_rule.py +1695 -0
- gcore/types/cdn/resources/origin_shielding.py +15 -0
- gcore/types/cdn/resources/rule_create_params.py +1652 -0
- gcore/types/cdn/resources/rule_list_response.py +10 -0
- gcore/types/cdn/resources/rule_replace_params.py +1654 -0
- gcore/types/cdn/resources/rule_update_params.py +1654 -0
- gcore/types/cdn/resources/shield_replace_params.py +16 -0
- gcore/types/cdn/rule_template.py +1666 -0
- gcore/types/cdn/rule_template_create_params.py +1636 -0
- gcore/types/cdn/rule_template_list.py +10 -0
- gcore/types/cdn/rule_template_replace_params.py +1636 -0
- gcore/types/cdn/rule_template_update_params.py +1636 -0
- gcore/types/cdn/shield_aggregated_stats.py +23 -0
- gcore/types/cdn/shield_list_response.py +25 -0
- gcore/types/cdn/ssl_detail.py +62 -0
- gcore/types/cdn/ssl_detail_list.py +10 -0
- gcore/types/cdn/ssl_request_status.py +135 -0
- gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_logs_usage_series_params.py +35 -0
- gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +151 -0
- gcore/types/cdn/statistic_get_resource_usage_series_params.py +131 -0
- gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_shield_usage_series_params.py +25 -0
- gcore/types/cdn/trusted_ca_certificate_create_params.py +23 -0
- gcore/types/cdn/trusted_ca_certificate_list_params.py +29 -0
- gcore/types/cdn/trusted_ca_certificate_replace_params.py +15 -0
- gcore/types/cdn/usage_series_stats.py +31 -0
- gcore/types/cloud/__init__.py +1 -0
- gcore/types/cloud/file_share.py +4 -0
- gcore/types/cloud/file_share_create_params.py +20 -0
- gcore/types/cloud/file_share_update_params.py +40 -3
- gcore/types/cloud/floating_ip_update_params.py +3 -1
- gcore/types/cloud/gpu_baremetal_cluster_action_params.py +46 -0
- gcore/types/cloud/inference/inference_deployment.py +3 -1
- gcore/types/cloud/instance_create_params.py +3 -1
- gcore/types/cloud/k8s/cluster_create_params.py +46 -4
- gcore/types/cloud/k8s/cluster_update_params.py +60 -6
- gcore/types/cloud/k8s/clusters/pool_update_params.py +1 -1
- gcore/types/cloud/k8s/k8s_cluster.py +40 -3
- gcore/types/cloud/load_balancer_update_params.py +3 -1
- gcore/types/cloud/network_update_params.py +3 -1
- gcore/types/cloud/networks/subnet_update_params.py +3 -1
- gcore/types/cloud/registries/user_create_multiple_params.py +5 -3
- gcore/types/cloud/registries/user_create_params.py +5 -3
- gcore/types/cloud/registry_create_params.py +5 -3
- gcore/types/cloud/security_group_update_params.py +3 -1
- gcore/types/cloud/ssh_key_created.py +6 -3
- gcore/types/cloud/volume_update_params.py +3 -1
- gcore/types/dns/zone_get_statistics_params.py +12 -9
- gcore/types/dns/zone_get_statistics_response.py +3 -1
- gcore/types/dns/zone_import_params.py +21 -15
- gcore/types/dns/zones/dns_output_rrset.py +7 -3
- gcore/types/iam/account_overview.py +7 -2
- gcore/types/iam/user.py +7 -2
- gcore/types/iam/user_detailed.py +7 -2
- gcore/types/iam/user_invite_params.py +4 -1
- gcore/types/iam/user_update.py +7 -2
- gcore/types/iam/user_update_params.py +7 -2
- gcore/types/streaming/ai_contentmoderation_hardnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_nsfw.py +6 -4
- gcore/types/streaming/ai_contentmoderation_softnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_sport.py +6 -4
- gcore/types/streaming/ai_task.py +20 -11
- gcore/types/streaming/ai_task_create_params.py +20 -11
- gcore/types/streaming/ai_task_get_response.py +5 -4
- gcore/types/streaming/ai_task_list_params.py +11 -5
- gcore/types/streaming/clip.py +33 -22
- gcore/types/streaming/create_video_param.py +75 -43
- gcore/types/streaming/playlist.py +7 -5
- gcore/types/streaming/playlist_create_params.py +7 -5
- gcore/types/streaming/playlist_update_params.py +7 -5
- gcore/types/streaming/playlist_video.py +75 -43
- gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +7 -4
- gcore/types/streaming/stream.py +207 -136
- gcore/types/streaming/stream_create_clip_params.py +33 -22
- gcore/types/streaming/stream_create_params.py +41 -24
- gcore/types/streaming/stream_update_params.py +41 -24
- gcore/types/streaming/video.py +138 -76
- gcore/types/streaming/video_list_params.py +4 -2
- gcore/types/streaming/video_update_params.py +75 -43
- gcore/types/waap/domain_update_params.py +2 -2
- gcore/types/waap/domains/advanced_rule_create_params.py +26 -18
- gcore/types/waap/domains/advanced_rule_list_params.py +10 -7
- gcore/types/waap/domains/advanced_rule_update_params.py +22 -17
- gcore/types/waap/domains/api_path_create_params.py +0 -3
- gcore/types/waap/domains/api_path_update_params.py +1 -3
- gcore/types/waap/domains/custom_rule_create_params.py +36 -35
- gcore/types/waap/domains/custom_rule_update_params.py +31 -33
- gcore/types/waap/domains/firewall_rule_create_params.py +6 -6
- gcore/types/waap/domains/firewall_rule_update_params.py +5 -5
- gcore/types/waap/domains/waap_advanced_rule.py +17 -9
- gcore/types/waap/domains/waap_custom_rule.py +5 -2
- gcore/types/waap/domains/waap_firewall_rule.py +1 -1
- gcore/types/waap/domains/waap_insight.py +1 -1
- gcore/types/waap/insight_list_types_params.py +1 -1
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/METADATA +1 -1
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/RECORD +334 -214
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/WHEEL +0 -0
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -15,7 +15,7 @@ from .overlays import (
|
|
|
15
15
|
OverlaysResourceWithStreamingResponse,
|
|
16
16
|
AsyncOverlaysResourceWithStreamingResponse,
|
|
17
17
|
)
|
|
18
|
-
from ...._types import
|
|
18
|
+
from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
19
19
|
from ...._utils import maybe_transform, async_maybe_transform
|
|
20
20
|
from ...._compat import cached_property
|
|
21
21
|
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -70,49 +70,53 @@ class StreamsResource(SyncAPIResource):
|
|
|
70
70
|
self,
|
|
71
71
|
*,
|
|
72
72
|
name: str,
|
|
73
|
-
active: bool |
|
|
74
|
-
auto_record: bool |
|
|
75
|
-
broadcast_ids: Iterable[int] |
|
|
76
|
-
cdn_id: int |
|
|
77
|
-
client_entity_data: str |
|
|
78
|
-
client_user_id: int |
|
|
79
|
-
dvr_duration: int |
|
|
80
|
-
dvr_enabled: bool |
|
|
81
|
-
hls_mpegts_endlist_tag: bool |
|
|
82
|
-
html_overlay: bool |
|
|
83
|
-
projection: Literal["regular", "vr360", "vr180", "vr360tb"] |
|
|
84
|
-
pull: bool |
|
|
85
|
-
quality_set_id: int |
|
|
86
|
-
record_type: Literal["origin", "transcoded"] |
|
|
87
|
-
uri: str |
|
|
73
|
+
active: bool | Omit = omit,
|
|
74
|
+
auto_record: bool | Omit = omit,
|
|
75
|
+
broadcast_ids: Iterable[int] | Omit = omit,
|
|
76
|
+
cdn_id: int | Omit = omit,
|
|
77
|
+
client_entity_data: str | Omit = omit,
|
|
78
|
+
client_user_id: int | Omit = omit,
|
|
79
|
+
dvr_duration: int | Omit = omit,
|
|
80
|
+
dvr_enabled: bool | Omit = omit,
|
|
81
|
+
hls_mpegts_endlist_tag: bool | Omit = omit,
|
|
82
|
+
html_overlay: bool | Omit = omit,
|
|
83
|
+
projection: Literal["regular", "vr360", "vr180", "vr360tb"] | Omit = omit,
|
|
84
|
+
pull: bool | Omit = omit,
|
|
85
|
+
quality_set_id: int | Omit = omit,
|
|
86
|
+
record_type: Literal["origin", "transcoded"] | Omit = omit,
|
|
87
|
+
uri: str | Omit = omit,
|
|
88
88
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
89
89
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
90
90
|
extra_headers: Headers | None = None,
|
|
91
91
|
extra_query: Query | None = None,
|
|
92
92
|
extra_body: Body | None = None,
|
|
93
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
93
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
94
94
|
) -> Stream:
|
|
95
95
|
"""
|
|
96
96
|
Use this method to create a new live stream entity for broadcasting.
|
|
97
97
|
|
|
98
98
|
The input in API may contain streams of different formats, including the most
|
|
99
99
|
common ones RTMP, RTMPS, SRT, HLS. Note that multicast MPEG-TS over UDP and
|
|
100
|
-
others are supported too, ask the Support Team please.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
others are supported too, ask the Support Team please.
|
|
101
|
+
|
|
102
|
+
For ingestion, you can use both PUSH and PULL methods.
|
|
103
|
+
|
|
104
|
+
Also you can use the main and backup servers, which are geographically located
|
|
105
|
+
in different locations. By default, any free ingest points in the world are
|
|
106
|
+
used. Settings have been applied that deliver low-latency streams in the optimal
|
|
107
|
+
way. If for some reason you need to set a fixed ingest point, or if you need to
|
|
108
|
+
set the main and backup ingest points in the same region (for example, do not
|
|
109
|
+
send streams outside the EU or US), then contact our Support Team.
|
|
108
110
|
|
|
109
111
|
The output is HLS and MPEG-DASH with ABR. We transcode video for you by our
|
|
110
112
|
cloud-based infrastructure. ABR ladder supports all qualities from SD to 8K HDR
|
|
111
|
-
60fps.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
60fps.
|
|
114
|
+
|
|
115
|
+
All our streams are Low Latency enabled. We support a delay of ±4 seconds for
|
|
116
|
+
video streams by utilizing Common Media Application Format (CMAF) technology. So
|
|
117
|
+
you obtain latency from the traditional 30-50 seconds to ±4 seconds only by
|
|
118
|
+
default. If you need legacy non-low-latency HLS, then look at HLS MPEG-TS
|
|
119
|
+
delivery below.
|
|
116
120
|
|
|
117
121
|
You have access to additional functions such as:
|
|
118
122
|
|
|
@@ -125,11 +129,16 @@ class StreamsResource(SyncAPIResource):
|
|
|
125
129
|
For more information see specific API methods, and the Knowledge Base. To
|
|
126
130
|
organize streaming with ultra-low latency, look for WebRTC delivery in different
|
|
127
131
|
section in the Knowledge Base.
|
|
132
|
+
|
|
128
133
|

|
|
129
134
|
|
|
130
135
|
Args:
|
|
131
|
-
name: Stream name.
|
|
132
|
-
|
|
136
|
+
name: Stream name.
|
|
137
|
+
|
|
138
|
+
Often used as a human-readable name for the stream, but can contain any text you
|
|
139
|
+
wish. The values are not unique and may be repeated.
|
|
140
|
+
|
|
141
|
+
Examples:
|
|
133
142
|
|
|
134
143
|
- Conference in July
|
|
135
144
|
- Stream #10003
|
|
@@ -137,17 +146,21 @@ class StreamsResource(SyncAPIResource):
|
|
|
137
146
|
- 480fd499-2de2-4988-bc1a-a4eebe9818ee
|
|
138
147
|
|
|
139
148
|
active: Stream switch between on and off. This is not an indicator of the status "stream
|
|
140
|
-
is receiving and it is LIVE", but rather an on/off switch.
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
is receiving and it is LIVE", but rather an on/off switch.
|
|
150
|
+
|
|
151
|
+
When stream is switched off, there is no way to process it: PULL is deactivated
|
|
152
|
+
and PUSH will return an error.
|
|
143
153
|
|
|
144
154
|
- true – stream can be processed
|
|
145
155
|
- false – stream is off, and cannot be processed
|
|
146
156
|
|
|
147
157
|
auto_record: Enables autotomatic recording of the stream when it started. So you don't need
|
|
148
|
-
to call recording manually.
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
to call recording manually.
|
|
159
|
+
|
|
160
|
+
Result of recording is automatically added to video hosting. For details see the
|
|
161
|
+
/streams/`start_recording` method and in knowledge base
|
|
162
|
+
|
|
163
|
+
Values:
|
|
151
164
|
|
|
152
165
|
- true – auto recording is enabled
|
|
153
166
|
- false – auto recording is disabled
|
|
@@ -167,9 +180,12 @@ class StreamsResource(SyncAPIResource):
|
|
|
167
180
|
field in any way when processing the stream. Example: `client_user_id = 1001`
|
|
168
181
|
|
|
169
182
|
dvr_duration: DVR duration in seconds if DVR feature is enabled for the stream. So this is
|
|
170
|
-
duration of how far the user can rewind the live stream.
|
|
171
|
-
|
|
172
|
-
|
|
183
|
+
duration of how far the user can rewind the live stream.
|
|
184
|
+
|
|
185
|
+
`dvr_duration` range is [30...14400].
|
|
186
|
+
|
|
187
|
+
Maximum value is 4 hours = 14400 seconds. If you need more, ask the Support Team
|
|
188
|
+
please.
|
|
173
189
|
|
|
174
190
|
dvr_enabled:
|
|
175
191
|
Enables DVR for the stream:
|
|
@@ -185,7 +201,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
185
201
|
|
|
186
202
|
projection: Visualization mode for 360° streams, how the stream is rendered in our web
|
|
187
203
|
player ONLY. If you would like to show video 360° in an external video player,
|
|
188
|
-
then use parameters of that video player.
|
|
204
|
+
then use parameters of that video player.
|
|
205
|
+
|
|
206
|
+
Modes:
|
|
189
207
|
|
|
190
208
|
- regular – regular “flat” stream
|
|
191
209
|
- vr360 – display stream in 360° mode
|
|
@@ -205,23 +223,28 @@ class StreamsResource(SyncAPIResource):
|
|
|
205
223
|
your conditions. Look at GET /`quality_sets` method
|
|
206
224
|
|
|
207
225
|
record_type: Method of recording a stream. Specifies the source from which the stream will be
|
|
208
|
-
recorded: original or transcoded.
|
|
226
|
+
recorded: original or transcoded.
|
|
227
|
+
|
|
228
|
+
Types:
|
|
209
229
|
|
|
210
230
|
- "origin" – To record RMTP/SRT/etc original clean media source.
|
|
211
231
|
- "transcoded" – To record the output transcoded version of the stream,
|
|
212
232
|
including overlays, texts, logos, etc. additional media layers.
|
|
213
233
|
|
|
214
|
-
uri: When using PULL method, this is the URL to pull a stream from.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
234
|
+
uri: When using PULL method, this is the URL to pull a stream from.
|
|
235
|
+
|
|
236
|
+
You can specify multiple addresses separated by a space (" "), so you can
|
|
237
|
+
organize a backup plan. In this case, the specified addresses will be selected
|
|
238
|
+
one by one using round robin scheduling. If the first address does not respond,
|
|
239
|
+
then the next one in the list will be automatically requested, returning to the
|
|
240
|
+
first and so on in a circle. Also, if the sucessfully working stream stops
|
|
241
|
+
sending data, then the next one will be selected according to the same scheme.
|
|
242
|
+
|
|
243
|
+
After 2 hours of inactivity of your original stream, the system stops PULL
|
|
244
|
+
requests and the stream is deactivated (the "active" field switches to "false").
|
|
245
|
+
|
|
246
|
+
Please, note that this field is for PULL only, so is not suitable for PUSH. Look
|
|
247
|
+
at fields "`push_url`" and "`push_url_srt`" from GET method.
|
|
225
248
|
|
|
226
249
|
extra_headers: Send extra headers
|
|
227
250
|
|
|
@@ -232,7 +255,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
232
255
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
233
256
|
"""
|
|
234
257
|
return self._post(
|
|
235
|
-
"/streaming/streams",
|
|
258
|
+
"/streaming/streams" if self._client._base_url_overridden else "https://api.gcore.com//streaming/streams",
|
|
236
259
|
body=maybe_transform(
|
|
237
260
|
{
|
|
238
261
|
"name": name,
|
|
@@ -264,13 +287,13 @@ class StreamsResource(SyncAPIResource):
|
|
|
264
287
|
self,
|
|
265
288
|
stream_id: int,
|
|
266
289
|
*,
|
|
267
|
-
stream: stream_update_params.Stream |
|
|
290
|
+
stream: stream_update_params.Stream | Omit = omit,
|
|
268
291
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
269
292
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
270
293
|
extra_headers: Headers | None = None,
|
|
271
294
|
extra_query: Query | None = None,
|
|
272
295
|
extra_body: Body | None = None,
|
|
273
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
296
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
274
297
|
) -> Stream:
|
|
275
298
|
"""
|
|
276
299
|
Updates stream settings
|
|
@@ -285,7 +308,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
285
308
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
286
309
|
"""
|
|
287
310
|
return self._patch(
|
|
288
|
-
f"/streaming/streams/{stream_id}"
|
|
311
|
+
f"/streaming/streams/{stream_id}"
|
|
312
|
+
if self._client._base_url_overridden
|
|
313
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}",
|
|
289
314
|
body=maybe_transform({"stream": stream}, stream_update_params.StreamUpdateParams),
|
|
290
315
|
options=make_request_options(
|
|
291
316
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -296,14 +321,14 @@ class StreamsResource(SyncAPIResource):
|
|
|
296
321
|
def list(
|
|
297
322
|
self,
|
|
298
323
|
*,
|
|
299
|
-
page: int |
|
|
300
|
-
with_broadcasts: int |
|
|
324
|
+
page: int | Omit = omit,
|
|
325
|
+
with_broadcasts: int | Omit = omit,
|
|
301
326
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
302
327
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
303
328
|
extra_headers: Headers | None = None,
|
|
304
329
|
extra_query: Query | None = None,
|
|
305
330
|
extra_body: Body | None = None,
|
|
306
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
331
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
307
332
|
) -> SyncPageStreaming[Stream]:
|
|
308
333
|
"""Returns a list of streams
|
|
309
334
|
|
|
@@ -324,7 +349,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
324
349
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
325
350
|
"""
|
|
326
351
|
return self._get_api_list(
|
|
327
|
-
"/streaming/streams",
|
|
352
|
+
"/streaming/streams" if self._client._base_url_overridden else "https://api.gcore.com//streaming/streams",
|
|
328
353
|
page=SyncPageStreaming[Stream],
|
|
329
354
|
options=make_request_options(
|
|
330
355
|
extra_headers=extra_headers,
|
|
@@ -351,17 +376,20 @@ class StreamsResource(SyncAPIResource):
|
|
|
351
376
|
extra_headers: Headers | None = None,
|
|
352
377
|
extra_query: Query | None = None,
|
|
353
378
|
extra_body: Body | None = None,
|
|
354
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
379
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
355
380
|
) -> None:
|
|
356
381
|
"""
|
|
357
382
|
Delete a live stream.
|
|
358
383
|
|
|
359
384
|
After deleting the live stream, all associated data is deleted: settings, PUSH
|
|
360
|
-
and PULL links, video playback links, etc.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
385
|
+
and PULL links, video playback links, etc.
|
|
386
|
+
|
|
387
|
+
Live stream information is deleted permanently and irreversibly. Therefore, it
|
|
388
|
+
is impossible to restore data and files after this.
|
|
389
|
+
|
|
390
|
+
But if the live had recordings, they continue to remain independent Video
|
|
391
|
+
entities. The "`stream_id`" parameter will simply point to a stream that no
|
|
392
|
+
longer exists.
|
|
365
393
|
|
|
366
394
|
Perhaps, instead of deleting, you may use the stream deactivation:
|
|
367
395
|
|
|
@@ -383,7 +411,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
383
411
|
"""
|
|
384
412
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
385
413
|
return self._delete(
|
|
386
|
-
f"/streaming/streams/{stream_id}"
|
|
414
|
+
f"/streaming/streams/{stream_id}"
|
|
415
|
+
if self._client._base_url_overridden
|
|
416
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}",
|
|
387
417
|
options=make_request_options(
|
|
388
418
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
389
419
|
),
|
|
@@ -399,7 +429,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
399
429
|
extra_headers: Headers | None = None,
|
|
400
430
|
extra_query: Query | None = None,
|
|
401
431
|
extra_body: Body | None = None,
|
|
402
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
432
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
403
433
|
) -> None:
|
|
404
434
|
"""
|
|
405
435
|
Clear live stream DVR
|
|
@@ -415,7 +445,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
415
445
|
"""
|
|
416
446
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
417
447
|
return self._put(
|
|
418
|
-
f"/streaming/streams/{stream_id}/dvr_cleanup"
|
|
448
|
+
f"/streaming/streams/{stream_id}/dvr_cleanup"
|
|
449
|
+
if self._client._base_url_overridden
|
|
450
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/dvr_cleanup",
|
|
419
451
|
options=make_request_options(
|
|
420
452
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
421
453
|
),
|
|
@@ -427,34 +459,39 @@ class StreamsResource(SyncAPIResource):
|
|
|
427
459
|
stream_id: int,
|
|
428
460
|
*,
|
|
429
461
|
duration: int,
|
|
430
|
-
expiration: int |
|
|
431
|
-
start: int |
|
|
432
|
-
vod_required: bool |
|
|
462
|
+
expiration: int | Omit = omit,
|
|
463
|
+
start: int | Omit = omit,
|
|
464
|
+
vod_required: bool | Omit = omit,
|
|
433
465
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
434
466
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
435
467
|
extra_headers: Headers | None = None,
|
|
436
468
|
extra_query: Query | None = None,
|
|
437
469
|
extra_body: Body | None = None,
|
|
438
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
470
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
439
471
|
) -> Clip:
|
|
440
|
-
"""
|
|
472
|
+
"""
|
|
473
|
+
Create an instant clip from on-going live stream.
|
|
441
474
|
|
|
442
|
-
Instant clips are applicable
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
475
|
+
Instant clips are applicable in cases where there is no time to wait for the
|
|
476
|
+
broadcast to be completed and recorded. For example, for quickly cutting
|
|
477
|
+
highlights in sport events, or cutting an important moment in the news or live
|
|
478
|
+
performance.
|
|
446
479
|
|
|
447
480
|
Instant clip becomes available for viewing in the following formats:
|
|
448
481
|
|
|
449
482
|
- HLS .m3u8,
|
|
450
483
|
- MP4,
|
|
451
484
|
- VOD in video hosting with a permanent link to watch video.
|
|
452
|
-

|
|
453
485
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
486
|
+

|
|
487
|
+
|
|
488
|
+
**Clip lifetime:**
|
|
489
|
+
|
|
490
|
+
Instant clips are a copy of the stream, created from a live stream. They are
|
|
491
|
+
stored in memory for a limited time, after which the clip ceases to exist and
|
|
492
|
+
you will receive a 404 on the link.
|
|
493
|
+
|
|
494
|
+
Limits that you should keep in mind:
|
|
458
495
|
|
|
459
496
|
- The clip's lifespan is controlled by `expiration` parameter.
|
|
460
497
|
- The default expiration value is 1 hour. The value can be set from 1 minute to
|
|
@@ -468,9 +505,10 @@ class StreamsResource(SyncAPIResource):
|
|
|
468
505
|
you try to request it before this time, the response will be error code 425
|
|
469
506
|
"Too Early".
|
|
470
507
|
|
|
471
|
-
**Cutting a clip from a source:**
|
|
472
|
-
|
|
473
|
-
for
|
|
508
|
+
**Cutting a clip from a source:**
|
|
509
|
+
|
|
510
|
+
In order to use clips recording feature, DVR must be enabled for a stream:
|
|
511
|
+
"`dvr_enabled`: true". The DVR serves as a source for creating clips:
|
|
474
512
|
|
|
475
513
|
- By default live stream DVR is set to 1 hour (3600 seconds). You can create an
|
|
476
514
|
instant clip using any segment of this time period by specifying the desired
|
|
@@ -478,39 +516,56 @@ class StreamsResource(SyncAPIResource):
|
|
|
478
516
|
- If you create a clip, but the DVR expires, the clip will still exist for the
|
|
479
517
|
specified time as a copy of the stream.
|
|
480
518
|
|
|
481
|
-
**Getting permanent VOD:**
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
519
|
+
**Getting permanent VOD:**
|
|
520
|
+
|
|
521
|
+
To get permanent VOD version of a live clip use this parameter when making a
|
|
522
|
+
request to create a clip: `vod_required: true`.
|
|
523
|
+
|
|
524
|
+
Later, when the clip is ready, grab `video_id` value from the response and query
|
|
525
|
+
the video by regular GET /video/{id} method.
|
|
485
526
|
|
|
486
527
|
Args:
|
|
487
|
-
duration: Requested segment duration in seconds to be cut.
|
|
488
|
-
|
|
489
|
-
|
|
528
|
+
duration: Requested segment duration in seconds to be cut.
|
|
529
|
+
|
|
530
|
+
Please, note that cutting is based on the idea of instantly creating a clip,
|
|
531
|
+
instead of precise timing. So final segment may be:
|
|
490
532
|
|
|
491
533
|
- Less than the specified value if there is less data in the DVR than the
|
|
492
534
|
requested segment.
|
|
493
535
|
- Greater than the specified value, because segment is aligned to the first and
|
|
494
536
|
last key frames of already stored fragment in DVR, this way -1 and +1 chunks
|
|
495
|
-
can be added to left and right.
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
537
|
+
can be added to left and right.
|
|
538
|
+
|
|
539
|
+
Duration of cutted segment cannot be greater than DVR duration for this stream.
|
|
540
|
+
Therefore, to change the maximum, use "`dvr_duration`" parameter of this stream.
|
|
541
|
+
|
|
542
|
+
expiration: Expire time of the clip via a public link.
|
|
543
|
+
|
|
544
|
+
Unix timestamp in seconds, absolute value.
|
|
545
|
+
|
|
546
|
+
This is the time how long the instant clip will be stored in the server memory
|
|
547
|
+
and can be accessed via public HLS/MP4 links. Download and/or use the instant
|
|
548
|
+
clip before this time expires.
|
|
549
|
+
|
|
550
|
+
After the time has expired, the clip is deleted from memory and is no longer
|
|
551
|
+
available via the link. You need to create a new segment, or use
|
|
552
|
+
`vod_required: true` attribute.
|
|
553
|
+
|
|
554
|
+
If value is omitted, then expiration is counted as +3600 seconds (1 hour) to the
|
|
555
|
+
end of the clip (i.e. `unix timestamp = <start> + <duration> + 3600`).
|
|
556
|
+
|
|
557
|
+
Allowed range: 1m <= expiration <= 4h.
|
|
558
|
+
|
|
559
|
+
Example:
|
|
508
560
|
`24.05.2024 14:00:00 (GMT) + 60 seconds of duration + 3600 seconds of expiration = 24.05.2024 15:01:00 (GMT) is Unix timestamp = 1716562860`
|
|
509
561
|
|
|
510
|
-
start: Starting point of the segment to cut.
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
562
|
+
start: Starting point of the segment to cut.
|
|
563
|
+
|
|
564
|
+
Unix timestamp in seconds, absolute value. Example:
|
|
565
|
+
`24.05.2024 14:00:00 (GMT) is Unix timestamp = 1716559200`
|
|
566
|
+
|
|
567
|
+
If a value from the past is specified, it is used as the starting point for the
|
|
568
|
+
segment to cut. If the value is omitted, then clip will start from now.
|
|
514
569
|
|
|
515
570
|
vod_required: Indicates if video needs to be stored also as permanent VOD
|
|
516
571
|
|
|
@@ -523,7 +578,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
523
578
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
524
579
|
"""
|
|
525
580
|
return self._put(
|
|
526
|
-
f"/streaming/streams/{stream_id}/clip_recording"
|
|
581
|
+
f"/streaming/streams/{stream_id}/clip_recording"
|
|
582
|
+
if self._client._base_url_overridden
|
|
583
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/clip_recording",
|
|
527
584
|
body=maybe_transform(
|
|
528
585
|
{
|
|
529
586
|
"duration": duration,
|
|
@@ -548,7 +605,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
548
605
|
extra_headers: Headers | None = None,
|
|
549
606
|
extra_query: Query | None = None,
|
|
550
607
|
extra_body: Body | None = None,
|
|
551
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
608
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
552
609
|
) -> Stream:
|
|
553
610
|
"""
|
|
554
611
|
Returns stream details
|
|
@@ -563,7 +620,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
563
620
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
564
621
|
"""
|
|
565
622
|
return self._get(
|
|
566
|
-
f"/streaming/streams/{stream_id}"
|
|
623
|
+
f"/streaming/streams/{stream_id}"
|
|
624
|
+
if self._client._base_url_overridden
|
|
625
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}",
|
|
567
626
|
options=make_request_options(
|
|
568
627
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
569
628
|
),
|
|
@@ -579,7 +638,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
579
638
|
extra_headers: Headers | None = None,
|
|
580
639
|
extra_query: Query | None = None,
|
|
581
640
|
extra_body: Body | None = None,
|
|
582
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
641
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
583
642
|
) -> StreamListClipsResponse:
|
|
584
643
|
"""
|
|
585
644
|
Get list of non expired instant clips for a stream.
|
|
@@ -587,11 +646,13 @@ class StreamsResource(SyncAPIResource):
|
|
|
587
646
|
You can now use both MP4 just-in-time packager and HLS for all clips. Get URLs
|
|
588
647
|
from "`hls_master`" and "`mp4_master`".
|
|
589
648
|
|
|
590
|
-
**How to download renditions of clips:**
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
649
|
+
**How to download renditions of clips:**
|
|
650
|
+
|
|
651
|
+
URLs contain "master" alias by default, which means maximum available quality
|
|
652
|
+
from ABR set (based on height metadata). There is also possibility to access
|
|
653
|
+
individual bitrates from ABR ladder. That works for both HLS and MP4. You can
|
|
654
|
+
replace manually "master" to a value from renditions list in order to get exact
|
|
655
|
+
bitrate/quality from the set. Example:
|
|
595
656
|
|
|
596
657
|
- HLS 720p:
|
|
597
658
|
`https://CID.domain.com/rec/111_1000/rec_d7bsli54p8n4_qsid42_master.m3u8`
|
|
@@ -612,7 +673,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
612
673
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
613
674
|
"""
|
|
614
675
|
return self._get(
|
|
615
|
-
f"/streaming/streams/{stream_id}/clip_recording"
|
|
676
|
+
f"/streaming/streams/{stream_id}/clip_recording"
|
|
677
|
+
if self._client._base_url_overridden
|
|
678
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/clip_recording",
|
|
616
679
|
options=make_request_options(
|
|
617
680
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
618
681
|
),
|
|
@@ -628,7 +691,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
628
691
|
extra_headers: Headers | None = None,
|
|
629
692
|
extra_query: Query | None = None,
|
|
630
693
|
extra_body: Body | None = None,
|
|
631
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
694
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
632
695
|
) -> StreamStartRecordingResponse:
|
|
633
696
|
"""
|
|
634
697
|
Start recording a stream.
|
|
@@ -648,12 +711,14 @@ class StreamsResource(SyncAPIResource):
|
|
|
648
711
|
- If you have access to the premium feature of saving the original stream (so
|
|
649
712
|
not just transcoded renditions), then the link to the original file will be in
|
|
650
713
|
the "`origin_url`" field. Look at the description of the field how to use it.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
714
|
+
|
|
715
|
+
Stream must be live for the recording to start, please check fields "live"
|
|
716
|
+
and/or "`backup_live`". After the recording starts, field "recording" will
|
|
717
|
+
switch to "true", and the recording duration in seconds will appear in the
|
|
718
|
+
"`recording_duration`" field.
|
|
719
|
+
|
|
720
|
+
Please, keep in mind that recording doesn't start instantly, it takes ±3-7
|
|
721
|
+
seconds to initialize the process after executing this method.
|
|
657
722
|
|
|
658
723
|
Stream recording stops when:
|
|
659
724
|
|
|
@@ -662,6 +727,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
662
727
|
method again, the recording will be made to a new video file.
|
|
663
728
|
- When sending the stream stops on the client side, or stops accidentally. In
|
|
664
729
|
this case, recording process is waiting for 10 seconds to resume recording:
|
|
730
|
+
|
|
665
731
|
- If the stream resumes within that period, recording will continue to the same
|
|
666
732
|
file.
|
|
667
733
|
- After that period, the file will be completely saved and closed.
|
|
@@ -680,7 +746,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
680
746
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
681
747
|
"""
|
|
682
748
|
return self._put(
|
|
683
|
-
f"/streaming/streams/{stream_id}/start_recording"
|
|
749
|
+
f"/streaming/streams/{stream_id}/start_recording"
|
|
750
|
+
if self._client._base_url_overridden
|
|
751
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/start_recording",
|
|
684
752
|
options=make_request_options(
|
|
685
753
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
686
754
|
),
|
|
@@ -696,7 +764,7 @@ class StreamsResource(SyncAPIResource):
|
|
|
696
764
|
extra_headers: Headers | None = None,
|
|
697
765
|
extra_query: Query | None = None,
|
|
698
766
|
extra_body: Body | None = None,
|
|
699
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
767
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
700
768
|
) -> Video:
|
|
701
769
|
"""
|
|
702
770
|
Stop recording a stream.
|
|
@@ -717,7 +785,9 @@ class StreamsResource(SyncAPIResource):
|
|
|
717
785
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
718
786
|
"""
|
|
719
787
|
return self._put(
|
|
720
|
-
f"/streaming/streams/{stream_id}/stop_recording"
|
|
788
|
+
f"/streaming/streams/{stream_id}/stop_recording"
|
|
789
|
+
if self._client._base_url_overridden
|
|
790
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/stop_recording",
|
|
721
791
|
options=make_request_options(
|
|
722
792
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
723
793
|
),
|
|
@@ -753,49 +823,53 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
753
823
|
self,
|
|
754
824
|
*,
|
|
755
825
|
name: str,
|
|
756
|
-
active: bool |
|
|
757
|
-
auto_record: bool |
|
|
758
|
-
broadcast_ids: Iterable[int] |
|
|
759
|
-
cdn_id: int |
|
|
760
|
-
client_entity_data: str |
|
|
761
|
-
client_user_id: int |
|
|
762
|
-
dvr_duration: int |
|
|
763
|
-
dvr_enabled: bool |
|
|
764
|
-
hls_mpegts_endlist_tag: bool |
|
|
765
|
-
html_overlay: bool |
|
|
766
|
-
projection: Literal["regular", "vr360", "vr180", "vr360tb"] |
|
|
767
|
-
pull: bool |
|
|
768
|
-
quality_set_id: int |
|
|
769
|
-
record_type: Literal["origin", "transcoded"] |
|
|
770
|
-
uri: str |
|
|
826
|
+
active: bool | Omit = omit,
|
|
827
|
+
auto_record: bool | Omit = omit,
|
|
828
|
+
broadcast_ids: Iterable[int] | Omit = omit,
|
|
829
|
+
cdn_id: int | Omit = omit,
|
|
830
|
+
client_entity_data: str | Omit = omit,
|
|
831
|
+
client_user_id: int | Omit = omit,
|
|
832
|
+
dvr_duration: int | Omit = omit,
|
|
833
|
+
dvr_enabled: bool | Omit = omit,
|
|
834
|
+
hls_mpegts_endlist_tag: bool | Omit = omit,
|
|
835
|
+
html_overlay: bool | Omit = omit,
|
|
836
|
+
projection: Literal["regular", "vr360", "vr180", "vr360tb"] | Omit = omit,
|
|
837
|
+
pull: bool | Omit = omit,
|
|
838
|
+
quality_set_id: int | Omit = omit,
|
|
839
|
+
record_type: Literal["origin", "transcoded"] | Omit = omit,
|
|
840
|
+
uri: str | Omit = omit,
|
|
771
841
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
772
842
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
773
843
|
extra_headers: Headers | None = None,
|
|
774
844
|
extra_query: Query | None = None,
|
|
775
845
|
extra_body: Body | None = None,
|
|
776
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
846
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
777
847
|
) -> Stream:
|
|
778
848
|
"""
|
|
779
849
|
Use this method to create a new live stream entity for broadcasting.
|
|
780
850
|
|
|
781
851
|
The input in API may contain streams of different formats, including the most
|
|
782
852
|
common ones RTMP, RTMPS, SRT, HLS. Note that multicast MPEG-TS over UDP and
|
|
783
|
-
others are supported too, ask the Support Team please.
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
853
|
+
others are supported too, ask the Support Team please.
|
|
854
|
+
|
|
855
|
+
For ingestion, you can use both PUSH and PULL methods.
|
|
856
|
+
|
|
857
|
+
Also you can use the main and backup servers, which are geographically located
|
|
858
|
+
in different locations. By default, any free ingest points in the world are
|
|
859
|
+
used. Settings have been applied that deliver low-latency streams in the optimal
|
|
860
|
+
way. If for some reason you need to set a fixed ingest point, or if you need to
|
|
861
|
+
set the main and backup ingest points in the same region (for example, do not
|
|
862
|
+
send streams outside the EU or US), then contact our Support Team.
|
|
791
863
|
|
|
792
864
|
The output is HLS and MPEG-DASH with ABR. We transcode video for you by our
|
|
793
865
|
cloud-based infrastructure. ABR ladder supports all qualities from SD to 8K HDR
|
|
794
|
-
60fps.
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
866
|
+
60fps.
|
|
867
|
+
|
|
868
|
+
All our streams are Low Latency enabled. We support a delay of ±4 seconds for
|
|
869
|
+
video streams by utilizing Common Media Application Format (CMAF) technology. So
|
|
870
|
+
you obtain latency from the traditional 30-50 seconds to ±4 seconds only by
|
|
871
|
+
default. If you need legacy non-low-latency HLS, then look at HLS MPEG-TS
|
|
872
|
+
delivery below.
|
|
799
873
|
|
|
800
874
|
You have access to additional functions such as:
|
|
801
875
|
|
|
@@ -808,11 +882,16 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
808
882
|
For more information see specific API methods, and the Knowledge Base. To
|
|
809
883
|
organize streaming with ultra-low latency, look for WebRTC delivery in different
|
|
810
884
|
section in the Knowledge Base.
|
|
885
|
+
|
|
811
886
|

|
|
812
887
|
|
|
813
888
|
Args:
|
|
814
|
-
name: Stream name.
|
|
815
|
-
|
|
889
|
+
name: Stream name.
|
|
890
|
+
|
|
891
|
+
Often used as a human-readable name for the stream, but can contain any text you
|
|
892
|
+
wish. The values are not unique and may be repeated.
|
|
893
|
+
|
|
894
|
+
Examples:
|
|
816
895
|
|
|
817
896
|
- Conference in July
|
|
818
897
|
- Stream #10003
|
|
@@ -820,17 +899,21 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
820
899
|
- 480fd499-2de2-4988-bc1a-a4eebe9818ee
|
|
821
900
|
|
|
822
901
|
active: Stream switch between on and off. This is not an indicator of the status "stream
|
|
823
|
-
is receiving and it is LIVE", but rather an on/off switch.
|
|
824
|
-
|
|
825
|
-
|
|
902
|
+
is receiving and it is LIVE", but rather an on/off switch.
|
|
903
|
+
|
|
904
|
+
When stream is switched off, there is no way to process it: PULL is deactivated
|
|
905
|
+
and PUSH will return an error.
|
|
826
906
|
|
|
827
907
|
- true – stream can be processed
|
|
828
908
|
- false – stream is off, and cannot be processed
|
|
829
909
|
|
|
830
910
|
auto_record: Enables autotomatic recording of the stream when it started. So you don't need
|
|
831
|
-
to call recording manually.
|
|
832
|
-
|
|
833
|
-
|
|
911
|
+
to call recording manually.
|
|
912
|
+
|
|
913
|
+
Result of recording is automatically added to video hosting. For details see the
|
|
914
|
+
/streams/`start_recording` method and in knowledge base
|
|
915
|
+
|
|
916
|
+
Values:
|
|
834
917
|
|
|
835
918
|
- true – auto recording is enabled
|
|
836
919
|
- false – auto recording is disabled
|
|
@@ -850,9 +933,12 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
850
933
|
field in any way when processing the stream. Example: `client_user_id = 1001`
|
|
851
934
|
|
|
852
935
|
dvr_duration: DVR duration in seconds if DVR feature is enabled for the stream. So this is
|
|
853
|
-
duration of how far the user can rewind the live stream.
|
|
854
|
-
|
|
855
|
-
|
|
936
|
+
duration of how far the user can rewind the live stream.
|
|
937
|
+
|
|
938
|
+
`dvr_duration` range is [30...14400].
|
|
939
|
+
|
|
940
|
+
Maximum value is 4 hours = 14400 seconds. If you need more, ask the Support Team
|
|
941
|
+
please.
|
|
856
942
|
|
|
857
943
|
dvr_enabled:
|
|
858
944
|
Enables DVR for the stream:
|
|
@@ -868,7 +954,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
868
954
|
|
|
869
955
|
projection: Visualization mode for 360° streams, how the stream is rendered in our web
|
|
870
956
|
player ONLY. If you would like to show video 360° in an external video player,
|
|
871
|
-
then use parameters of that video player.
|
|
957
|
+
then use parameters of that video player.
|
|
958
|
+
|
|
959
|
+
Modes:
|
|
872
960
|
|
|
873
961
|
- regular – regular “flat” stream
|
|
874
962
|
- vr360 – display stream in 360° mode
|
|
@@ -888,23 +976,28 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
888
976
|
your conditions. Look at GET /`quality_sets` method
|
|
889
977
|
|
|
890
978
|
record_type: Method of recording a stream. Specifies the source from which the stream will be
|
|
891
|
-
recorded: original or transcoded.
|
|
979
|
+
recorded: original or transcoded.
|
|
980
|
+
|
|
981
|
+
Types:
|
|
892
982
|
|
|
893
983
|
- "origin" – To record RMTP/SRT/etc original clean media source.
|
|
894
984
|
- "transcoded" – To record the output transcoded version of the stream,
|
|
895
985
|
including overlays, texts, logos, etc. additional media layers.
|
|
896
986
|
|
|
897
|
-
uri: When using PULL method, this is the URL to pull a stream from.
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
987
|
+
uri: When using PULL method, this is the URL to pull a stream from.
|
|
988
|
+
|
|
989
|
+
You can specify multiple addresses separated by a space (" "), so you can
|
|
990
|
+
organize a backup plan. In this case, the specified addresses will be selected
|
|
991
|
+
one by one using round robin scheduling. If the first address does not respond,
|
|
992
|
+
then the next one in the list will be automatically requested, returning to the
|
|
993
|
+
first and so on in a circle. Also, if the sucessfully working stream stops
|
|
994
|
+
sending data, then the next one will be selected according to the same scheme.
|
|
995
|
+
|
|
996
|
+
After 2 hours of inactivity of your original stream, the system stops PULL
|
|
997
|
+
requests and the stream is deactivated (the "active" field switches to "false").
|
|
998
|
+
|
|
999
|
+
Please, note that this field is for PULL only, so is not suitable for PUSH. Look
|
|
1000
|
+
at fields "`push_url`" and "`push_url_srt`" from GET method.
|
|
908
1001
|
|
|
909
1002
|
extra_headers: Send extra headers
|
|
910
1003
|
|
|
@@ -915,7 +1008,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
915
1008
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
916
1009
|
"""
|
|
917
1010
|
return await self._post(
|
|
918
|
-
"/streaming/streams",
|
|
1011
|
+
"/streaming/streams" if self._client._base_url_overridden else "https://api.gcore.com//streaming/streams",
|
|
919
1012
|
body=await async_maybe_transform(
|
|
920
1013
|
{
|
|
921
1014
|
"name": name,
|
|
@@ -947,13 +1040,13 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
947
1040
|
self,
|
|
948
1041
|
stream_id: int,
|
|
949
1042
|
*,
|
|
950
|
-
stream: stream_update_params.Stream |
|
|
1043
|
+
stream: stream_update_params.Stream | Omit = omit,
|
|
951
1044
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
952
1045
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
953
1046
|
extra_headers: Headers | None = None,
|
|
954
1047
|
extra_query: Query | None = None,
|
|
955
1048
|
extra_body: Body | None = None,
|
|
956
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1049
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
957
1050
|
) -> Stream:
|
|
958
1051
|
"""
|
|
959
1052
|
Updates stream settings
|
|
@@ -968,7 +1061,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
968
1061
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
969
1062
|
"""
|
|
970
1063
|
return await self._patch(
|
|
971
|
-
f"/streaming/streams/{stream_id}"
|
|
1064
|
+
f"/streaming/streams/{stream_id}"
|
|
1065
|
+
if self._client._base_url_overridden
|
|
1066
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}",
|
|
972
1067
|
body=await async_maybe_transform({"stream": stream}, stream_update_params.StreamUpdateParams),
|
|
973
1068
|
options=make_request_options(
|
|
974
1069
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
@@ -979,14 +1074,14 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
979
1074
|
def list(
|
|
980
1075
|
self,
|
|
981
1076
|
*,
|
|
982
|
-
page: int |
|
|
983
|
-
with_broadcasts: int |
|
|
1077
|
+
page: int | Omit = omit,
|
|
1078
|
+
with_broadcasts: int | Omit = omit,
|
|
984
1079
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
985
1080
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
986
1081
|
extra_headers: Headers | None = None,
|
|
987
1082
|
extra_query: Query | None = None,
|
|
988
1083
|
extra_body: Body | None = None,
|
|
989
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1084
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
990
1085
|
) -> AsyncPaginator[Stream, AsyncPageStreaming[Stream]]:
|
|
991
1086
|
"""Returns a list of streams
|
|
992
1087
|
|
|
@@ -1007,7 +1102,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1007
1102
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
1008
1103
|
"""
|
|
1009
1104
|
return self._get_api_list(
|
|
1010
|
-
"/streaming/streams",
|
|
1105
|
+
"/streaming/streams" if self._client._base_url_overridden else "https://api.gcore.com//streaming/streams",
|
|
1011
1106
|
page=AsyncPageStreaming[Stream],
|
|
1012
1107
|
options=make_request_options(
|
|
1013
1108
|
extra_headers=extra_headers,
|
|
@@ -1034,17 +1129,20 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1034
1129
|
extra_headers: Headers | None = None,
|
|
1035
1130
|
extra_query: Query | None = None,
|
|
1036
1131
|
extra_body: Body | None = None,
|
|
1037
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1132
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1038
1133
|
) -> None:
|
|
1039
1134
|
"""
|
|
1040
1135
|
Delete a live stream.
|
|
1041
1136
|
|
|
1042
1137
|
After deleting the live stream, all associated data is deleted: settings, PUSH
|
|
1043
|
-
and PULL links, video playback links, etc.
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1138
|
+
and PULL links, video playback links, etc.
|
|
1139
|
+
|
|
1140
|
+
Live stream information is deleted permanently and irreversibly. Therefore, it
|
|
1141
|
+
is impossible to restore data and files after this.
|
|
1142
|
+
|
|
1143
|
+
But if the live had recordings, they continue to remain independent Video
|
|
1144
|
+
entities. The "`stream_id`" parameter will simply point to a stream that no
|
|
1145
|
+
longer exists.
|
|
1048
1146
|
|
|
1049
1147
|
Perhaps, instead of deleting, you may use the stream deactivation:
|
|
1050
1148
|
|
|
@@ -1066,7 +1164,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1066
1164
|
"""
|
|
1067
1165
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1068
1166
|
return await self._delete(
|
|
1069
|
-
f"/streaming/streams/{stream_id}"
|
|
1167
|
+
f"/streaming/streams/{stream_id}"
|
|
1168
|
+
if self._client._base_url_overridden
|
|
1169
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}",
|
|
1070
1170
|
options=make_request_options(
|
|
1071
1171
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1072
1172
|
),
|
|
@@ -1082,7 +1182,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1082
1182
|
extra_headers: Headers | None = None,
|
|
1083
1183
|
extra_query: Query | None = None,
|
|
1084
1184
|
extra_body: Body | None = None,
|
|
1085
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1185
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1086
1186
|
) -> None:
|
|
1087
1187
|
"""
|
|
1088
1188
|
Clear live stream DVR
|
|
@@ -1098,7 +1198,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1098
1198
|
"""
|
|
1099
1199
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
1100
1200
|
return await self._put(
|
|
1101
|
-
f"/streaming/streams/{stream_id}/dvr_cleanup"
|
|
1201
|
+
f"/streaming/streams/{stream_id}/dvr_cleanup"
|
|
1202
|
+
if self._client._base_url_overridden
|
|
1203
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/dvr_cleanup",
|
|
1102
1204
|
options=make_request_options(
|
|
1103
1205
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1104
1206
|
),
|
|
@@ -1110,34 +1212,39 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1110
1212
|
stream_id: int,
|
|
1111
1213
|
*,
|
|
1112
1214
|
duration: int,
|
|
1113
|
-
expiration: int |
|
|
1114
|
-
start: int |
|
|
1115
|
-
vod_required: bool |
|
|
1215
|
+
expiration: int | Omit = omit,
|
|
1216
|
+
start: int | Omit = omit,
|
|
1217
|
+
vod_required: bool | Omit = omit,
|
|
1116
1218
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1117
1219
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1118
1220
|
extra_headers: Headers | None = None,
|
|
1119
1221
|
extra_query: Query | None = None,
|
|
1120
1222
|
extra_body: Body | None = None,
|
|
1121
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1223
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1122
1224
|
) -> Clip:
|
|
1123
|
-
"""
|
|
1225
|
+
"""
|
|
1226
|
+
Create an instant clip from on-going live stream.
|
|
1124
1227
|
|
|
1125
|
-
Instant clips are applicable
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1228
|
+
Instant clips are applicable in cases where there is no time to wait for the
|
|
1229
|
+
broadcast to be completed and recorded. For example, for quickly cutting
|
|
1230
|
+
highlights in sport events, or cutting an important moment in the news or live
|
|
1231
|
+
performance.
|
|
1129
1232
|
|
|
1130
1233
|
Instant clip becomes available for viewing in the following formats:
|
|
1131
1234
|
|
|
1132
1235
|
- HLS .m3u8,
|
|
1133
1236
|
- MP4,
|
|
1134
1237
|
- VOD in video hosting with a permanent link to watch video.
|
|
1135
|
-

|
|
1136
1238
|
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1239
|
+

|
|
1240
|
+
|
|
1241
|
+
**Clip lifetime:**
|
|
1242
|
+
|
|
1243
|
+
Instant clips are a copy of the stream, created from a live stream. They are
|
|
1244
|
+
stored in memory for a limited time, after which the clip ceases to exist and
|
|
1245
|
+
you will receive a 404 on the link.
|
|
1246
|
+
|
|
1247
|
+
Limits that you should keep in mind:
|
|
1141
1248
|
|
|
1142
1249
|
- The clip's lifespan is controlled by `expiration` parameter.
|
|
1143
1250
|
- The default expiration value is 1 hour. The value can be set from 1 minute to
|
|
@@ -1151,9 +1258,10 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1151
1258
|
you try to request it before this time, the response will be error code 425
|
|
1152
1259
|
"Too Early".
|
|
1153
1260
|
|
|
1154
|
-
**Cutting a clip from a source:**
|
|
1155
|
-
|
|
1156
|
-
for
|
|
1261
|
+
**Cutting a clip from a source:**
|
|
1262
|
+
|
|
1263
|
+
In order to use clips recording feature, DVR must be enabled for a stream:
|
|
1264
|
+
"`dvr_enabled`: true". The DVR serves as a source for creating clips:
|
|
1157
1265
|
|
|
1158
1266
|
- By default live stream DVR is set to 1 hour (3600 seconds). You can create an
|
|
1159
1267
|
instant clip using any segment of this time period by specifying the desired
|
|
@@ -1161,39 +1269,56 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1161
1269
|
- If you create a clip, but the DVR expires, the clip will still exist for the
|
|
1162
1270
|
specified time as a copy of the stream.
|
|
1163
1271
|
|
|
1164
|
-
**Getting permanent VOD:**
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1272
|
+
**Getting permanent VOD:**
|
|
1273
|
+
|
|
1274
|
+
To get permanent VOD version of a live clip use this parameter when making a
|
|
1275
|
+
request to create a clip: `vod_required: true`.
|
|
1276
|
+
|
|
1277
|
+
Later, when the clip is ready, grab `video_id` value from the response and query
|
|
1278
|
+
the video by regular GET /video/{id} method.
|
|
1168
1279
|
|
|
1169
1280
|
Args:
|
|
1170
|
-
duration: Requested segment duration in seconds to be cut.
|
|
1171
|
-
|
|
1172
|
-
|
|
1281
|
+
duration: Requested segment duration in seconds to be cut.
|
|
1282
|
+
|
|
1283
|
+
Please, note that cutting is based on the idea of instantly creating a clip,
|
|
1284
|
+
instead of precise timing. So final segment may be:
|
|
1173
1285
|
|
|
1174
1286
|
- Less than the specified value if there is less data in the DVR than the
|
|
1175
1287
|
requested segment.
|
|
1176
1288
|
- Greater than the specified value, because segment is aligned to the first and
|
|
1177
1289
|
last key frames of already stored fragment in DVR, this way -1 and +1 chunks
|
|
1178
|
-
can be added to left and right.
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1290
|
+
can be added to left and right.
|
|
1291
|
+
|
|
1292
|
+
Duration of cutted segment cannot be greater than DVR duration for this stream.
|
|
1293
|
+
Therefore, to change the maximum, use "`dvr_duration`" parameter of this stream.
|
|
1294
|
+
|
|
1295
|
+
expiration: Expire time of the clip via a public link.
|
|
1296
|
+
|
|
1297
|
+
Unix timestamp in seconds, absolute value.
|
|
1298
|
+
|
|
1299
|
+
This is the time how long the instant clip will be stored in the server memory
|
|
1300
|
+
and can be accessed via public HLS/MP4 links. Download and/or use the instant
|
|
1301
|
+
clip before this time expires.
|
|
1302
|
+
|
|
1303
|
+
After the time has expired, the clip is deleted from memory and is no longer
|
|
1304
|
+
available via the link. You need to create a new segment, or use
|
|
1305
|
+
`vod_required: true` attribute.
|
|
1306
|
+
|
|
1307
|
+
If value is omitted, then expiration is counted as +3600 seconds (1 hour) to the
|
|
1308
|
+
end of the clip (i.e. `unix timestamp = <start> + <duration> + 3600`).
|
|
1309
|
+
|
|
1310
|
+
Allowed range: 1m <= expiration <= 4h.
|
|
1311
|
+
|
|
1312
|
+
Example:
|
|
1191
1313
|
`24.05.2024 14:00:00 (GMT) + 60 seconds of duration + 3600 seconds of expiration = 24.05.2024 15:01:00 (GMT) is Unix timestamp = 1716562860`
|
|
1192
1314
|
|
|
1193
|
-
start: Starting point of the segment to cut.
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1315
|
+
start: Starting point of the segment to cut.
|
|
1316
|
+
|
|
1317
|
+
Unix timestamp in seconds, absolute value. Example:
|
|
1318
|
+
`24.05.2024 14:00:00 (GMT) is Unix timestamp = 1716559200`
|
|
1319
|
+
|
|
1320
|
+
If a value from the past is specified, it is used as the starting point for the
|
|
1321
|
+
segment to cut. If the value is omitted, then clip will start from now.
|
|
1197
1322
|
|
|
1198
1323
|
vod_required: Indicates if video needs to be stored also as permanent VOD
|
|
1199
1324
|
|
|
@@ -1206,7 +1331,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1206
1331
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
1207
1332
|
"""
|
|
1208
1333
|
return await self._put(
|
|
1209
|
-
f"/streaming/streams/{stream_id}/clip_recording"
|
|
1334
|
+
f"/streaming/streams/{stream_id}/clip_recording"
|
|
1335
|
+
if self._client._base_url_overridden
|
|
1336
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/clip_recording",
|
|
1210
1337
|
body=await async_maybe_transform(
|
|
1211
1338
|
{
|
|
1212
1339
|
"duration": duration,
|
|
@@ -1231,7 +1358,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1231
1358
|
extra_headers: Headers | None = None,
|
|
1232
1359
|
extra_query: Query | None = None,
|
|
1233
1360
|
extra_body: Body | None = None,
|
|
1234
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1361
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1235
1362
|
) -> Stream:
|
|
1236
1363
|
"""
|
|
1237
1364
|
Returns stream details
|
|
@@ -1246,7 +1373,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1246
1373
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
1247
1374
|
"""
|
|
1248
1375
|
return await self._get(
|
|
1249
|
-
f"/streaming/streams/{stream_id}"
|
|
1376
|
+
f"/streaming/streams/{stream_id}"
|
|
1377
|
+
if self._client._base_url_overridden
|
|
1378
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}",
|
|
1250
1379
|
options=make_request_options(
|
|
1251
1380
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1252
1381
|
),
|
|
@@ -1262,7 +1391,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1262
1391
|
extra_headers: Headers | None = None,
|
|
1263
1392
|
extra_query: Query | None = None,
|
|
1264
1393
|
extra_body: Body | None = None,
|
|
1265
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1394
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1266
1395
|
) -> StreamListClipsResponse:
|
|
1267
1396
|
"""
|
|
1268
1397
|
Get list of non expired instant clips for a stream.
|
|
@@ -1270,11 +1399,13 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1270
1399
|
You can now use both MP4 just-in-time packager and HLS for all clips. Get URLs
|
|
1271
1400
|
from "`hls_master`" and "`mp4_master`".
|
|
1272
1401
|
|
|
1273
|
-
**How to download renditions of clips:**
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1402
|
+
**How to download renditions of clips:**
|
|
1403
|
+
|
|
1404
|
+
URLs contain "master" alias by default, which means maximum available quality
|
|
1405
|
+
from ABR set (based on height metadata). There is also possibility to access
|
|
1406
|
+
individual bitrates from ABR ladder. That works for both HLS and MP4. You can
|
|
1407
|
+
replace manually "master" to a value from renditions list in order to get exact
|
|
1408
|
+
bitrate/quality from the set. Example:
|
|
1278
1409
|
|
|
1279
1410
|
- HLS 720p:
|
|
1280
1411
|
`https://CID.domain.com/rec/111_1000/rec_d7bsli54p8n4_qsid42_master.m3u8`
|
|
@@ -1295,7 +1426,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1295
1426
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
1296
1427
|
"""
|
|
1297
1428
|
return await self._get(
|
|
1298
|
-
f"/streaming/streams/{stream_id}/clip_recording"
|
|
1429
|
+
f"/streaming/streams/{stream_id}/clip_recording"
|
|
1430
|
+
if self._client._base_url_overridden
|
|
1431
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/clip_recording",
|
|
1299
1432
|
options=make_request_options(
|
|
1300
1433
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1301
1434
|
),
|
|
@@ -1311,7 +1444,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1311
1444
|
extra_headers: Headers | None = None,
|
|
1312
1445
|
extra_query: Query | None = None,
|
|
1313
1446
|
extra_body: Body | None = None,
|
|
1314
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1447
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1315
1448
|
) -> StreamStartRecordingResponse:
|
|
1316
1449
|
"""
|
|
1317
1450
|
Start recording a stream.
|
|
@@ -1331,12 +1464,14 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1331
1464
|
- If you have access to the premium feature of saving the original stream (so
|
|
1332
1465
|
not just transcoded renditions), then the link to the original file will be in
|
|
1333
1466
|
the "`origin_url`" field. Look at the description of the field how to use it.
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1467
|
+
|
|
1468
|
+
Stream must be live for the recording to start, please check fields "live"
|
|
1469
|
+
and/or "`backup_live`". After the recording starts, field "recording" will
|
|
1470
|
+
switch to "true", and the recording duration in seconds will appear in the
|
|
1471
|
+
"`recording_duration`" field.
|
|
1472
|
+
|
|
1473
|
+
Please, keep in mind that recording doesn't start instantly, it takes ±3-7
|
|
1474
|
+
seconds to initialize the process after executing this method.
|
|
1340
1475
|
|
|
1341
1476
|
Stream recording stops when:
|
|
1342
1477
|
|
|
@@ -1345,6 +1480,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1345
1480
|
method again, the recording will be made to a new video file.
|
|
1346
1481
|
- When sending the stream stops on the client side, or stops accidentally. In
|
|
1347
1482
|
this case, recording process is waiting for 10 seconds to resume recording:
|
|
1483
|
+
|
|
1348
1484
|
- If the stream resumes within that period, recording will continue to the same
|
|
1349
1485
|
file.
|
|
1350
1486
|
- After that period, the file will be completely saved and closed.
|
|
@@ -1363,7 +1499,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1363
1499
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
1364
1500
|
"""
|
|
1365
1501
|
return await self._put(
|
|
1366
|
-
f"/streaming/streams/{stream_id}/start_recording"
|
|
1502
|
+
f"/streaming/streams/{stream_id}/start_recording"
|
|
1503
|
+
if self._client._base_url_overridden
|
|
1504
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/start_recording",
|
|
1367
1505
|
options=make_request_options(
|
|
1368
1506
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1369
1507
|
),
|
|
@@ -1379,7 +1517,7 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1379
1517
|
extra_headers: Headers | None = None,
|
|
1380
1518
|
extra_query: Query | None = None,
|
|
1381
1519
|
extra_body: Body | None = None,
|
|
1382
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1520
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1383
1521
|
) -> Video:
|
|
1384
1522
|
"""
|
|
1385
1523
|
Stop recording a stream.
|
|
@@ -1400,7 +1538,9 @@ class AsyncStreamsResource(AsyncAPIResource):
|
|
|
1400
1538
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
1401
1539
|
"""
|
|
1402
1540
|
return await self._put(
|
|
1403
|
-
f"/streaming/streams/{stream_id}/stop_recording"
|
|
1541
|
+
f"/streaming/streams/{stream_id}/stop_recording"
|
|
1542
|
+
if self._client._base_url_overridden
|
|
1543
|
+
else f"https://api.gcore.com//streaming/streams/{stream_id}/stop_recording",
|
|
1404
1544
|
options=make_request_options(
|
|
1405
1545
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
1406
1546
|
),
|