universal-mcp-applications 0.1.20__py3-none-any.whl → 0.1.22__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 universal-mcp-applications might be problematic. Click here for more details.
- universal_mcp/applications/BEST_PRACTICES.md +166 -0
- universal_mcp/applications/airtable/app.py +0 -1
- universal_mcp/applications/apollo/app.py +0 -1
- universal_mcp/applications/aws_s3/app.py +40 -39
- universal_mcp/applications/browser_use/README.md +1 -0
- universal_mcp/applications/browser_use/__init__.py +0 -0
- universal_mcp/applications/browser_use/app.py +76 -0
- universal_mcp/applications/calendly/app.py +125 -125
- universal_mcp/applications/canva/app.py +95 -99
- universal_mcp/applications/confluence/app.py +0 -1
- universal_mcp/applications/contentful/app.py +4 -5
- universal_mcp/applications/domain_checker/app.py +11 -15
- universal_mcp/applications/e2b/app.py +4 -4
- universal_mcp/applications/elevenlabs/app.py +18 -15
- universal_mcp/applications/exa/app.py +17 -17
- universal_mcp/applications/falai/app.py +28 -29
- universal_mcp/applications/file_system/app.py +9 -9
- universal_mcp/applications/firecrawl/app.py +36 -36
- universal_mcp/applications/fireflies/app.py +55 -56
- universal_mcp/applications/fpl/app.py +49 -50
- universal_mcp/applications/ghost_content/app.py +0 -1
- universal_mcp/applications/github/app.py +41 -43
- universal_mcp/applications/google_calendar/app.py +40 -39
- universal_mcp/applications/google_docs/app.py +56 -56
- universal_mcp/applications/google_drive/app.py +212 -215
- universal_mcp/applications/google_gemini/app.py +1 -5
- universal_mcp/applications/google_mail/app.py +91 -90
- universal_mcp/applications/google_searchconsole/app.py +29 -29
- universal_mcp/applications/google_sheet/app.py +115 -115
- universal_mcp/applications/hashnode/README.md +6 -3
- universal_mcp/applications/hashnode/app.py +174 -25
- universal_mcp/applications/http_tools/app.py +10 -11
- universal_mcp/applications/hubspot/__init__.py +1 -1
- universal_mcp/applications/hubspot/api_segments/api_segment_base.py +36 -7
- universal_mcp/applications/hubspot/api_segments/crm_api.py +368 -368
- universal_mcp/applications/hubspot/api_segments/marketing_api.py +115 -115
- universal_mcp/applications/hubspot/app.py +131 -72
- universal_mcp/applications/jira/app.py +0 -1
- universal_mcp/applications/linkedin/app.py +20 -20
- universal_mcp/applications/markitdown/app.py +10 -5
- universal_mcp/applications/ms_teams/app.py +123 -123
- universal_mcp/applications/openai/app.py +40 -39
- universal_mcp/applications/outlook/app.py +32 -32
- universal_mcp/applications/perplexity/app.py +4 -4
- universal_mcp/applications/reddit/app.py +69 -70
- universal_mcp/applications/resend/app.py +116 -117
- universal_mcp/applications/rocketlane/app.py +0 -1
- universal_mcp/applications/scraper/__init__.py +1 -1
- universal_mcp/applications/scraper/app.py +234 -16
- universal_mcp/applications/serpapi/app.py +14 -14
- universal_mcp/applications/sharepoint/app.py +19 -20
- universal_mcp/applications/shopify/app.py +0 -1
- universal_mcp/applications/slack/app.py +48 -48
- universal_mcp/applications/tavily/app.py +4 -4
- universal_mcp/applications/twitter/api_segments/compliance_api.py +13 -15
- universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +20 -20
- universal_mcp/applications/twitter/api_segments/dm_events_api.py +12 -12
- universal_mcp/applications/twitter/api_segments/likes_api.py +12 -12
- universal_mcp/applications/twitter/api_segments/lists_api.py +37 -39
- universal_mcp/applications/twitter/api_segments/spaces_api.py +24 -24
- universal_mcp/applications/twitter/api_segments/trends_api.py +4 -4
- universal_mcp/applications/twitter/api_segments/tweets_api.py +105 -105
- universal_mcp/applications/twitter/api_segments/usage_api.py +4 -4
- universal_mcp/applications/twitter/api_segments/users_api.py +136 -136
- universal_mcp/applications/twitter/app.py +6 -2
- universal_mcp/applications/unipile/app.py +321 -71
- universal_mcp/applications/whatsapp/app.py +53 -54
- universal_mcp/applications/whatsapp/audio.py +39 -35
- universal_mcp/applications/whatsapp/whatsapp.py +176 -154
- universal_mcp/applications/whatsapp_business/app.py +92 -92
- universal_mcp/applications/yahoo_finance/app.py +105 -63
- universal_mcp/applications/youtube/app.py +206 -199
- universal_mcp/applications/zenquotes/__init__.py +2 -0
- universal_mcp/applications/zenquotes/app.py +3 -3
- {universal_mcp_applications-0.1.20.dist-info → universal_mcp_applications-0.1.22.dist-info}/METADATA +2 -1
- {universal_mcp_applications-0.1.20.dist-info → universal_mcp_applications-0.1.22.dist-info}/RECORD +78 -74
- {universal_mcp_applications-0.1.20.dist-info → universal_mcp_applications-0.1.22.dist-info}/WHEEL +0 -0
- {universal_mcp_applications-0.1.20.dist-info → universal_mcp_applications-0.1.22.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from typing import Any
|
|
2
3
|
|
|
3
|
-
from youtube_transcript_api import YouTubeTranscriptApi
|
|
4
|
-
from youtube_transcript_api.proxies import GenericProxyConfig
|
|
5
|
-
|
|
6
|
-
|
|
7
4
|
from universal_mcp.applications.application import APIApplication
|
|
8
5
|
from universal_mcp.integrations import Integration
|
|
6
|
+
from youtube_transcript_api import YouTubeTranscriptApi
|
|
7
|
+
from youtube_transcript_api.proxies import WebshareProxyConfig
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class YoutubeApp(APIApplication):
|
|
12
|
-
def __init__(self, integration: Integration = None, **kwargs) -> None:
|
|
11
|
+
def __init__(self, integration: Integration | None = None, **kwargs) -> None:
|
|
13
12
|
"""
|
|
14
13
|
Initializes an instance of a YouTube application integration.
|
|
15
14
|
|
|
@@ -35,7 +34,7 @@ class YoutubeApp(APIApplication):
|
|
|
35
34
|
) -> Any:
|
|
36
35
|
"""
|
|
37
36
|
Retrieves a paginated list of all reports for a specific job ID, with options for filtering by date. Unlike `get_jobs_job_reports_report`, which fetches a single report by its ID, this function returns a collection of reports associated with a job.
|
|
38
|
-
|
|
37
|
+
|
|
39
38
|
Args:
|
|
40
39
|
jobId: The unique identifier for the job whose reports are to be retrieved.
|
|
41
40
|
createdAfter: Optional; filter to include only reports created after this date (ISO 8601 format).
|
|
@@ -44,13 +43,13 @@ class YoutubeApp(APIApplication):
|
|
|
44
43
|
pageToken: Optional; a token identifying the page of results to return.
|
|
45
44
|
startTimeAtOrAfter: Optional; filter to include only reports starting at or after this date-time (ISO 8601 format).
|
|
46
45
|
startTimeBefore: Optional; filter to include only reports with a start time before this date-time (ISO 8601 format).
|
|
47
|
-
|
|
46
|
+
|
|
48
47
|
Returns:
|
|
49
48
|
A JSON object containing the job reports matching the provided criteria.
|
|
50
|
-
|
|
49
|
+
|
|
51
50
|
Raises:
|
|
52
51
|
ValueError: Raised if the required 'jobId' parameter is missing.
|
|
53
|
-
|
|
52
|
+
|
|
54
53
|
Tags:
|
|
55
54
|
retrieve, report, job-management, batch
|
|
56
55
|
"""
|
|
@@ -73,24 +72,22 @@ class YoutubeApp(APIApplication):
|
|
|
73
72
|
response.raise_for_status()
|
|
74
73
|
return response.json()
|
|
75
74
|
|
|
76
|
-
def get_job_report(
|
|
77
|
-
self, jobId, reportId, onBehalfOfContentOwner=None
|
|
78
|
-
) -> Any:
|
|
75
|
+
def get_job_report(self, jobId, reportId, onBehalfOfContentOwner=None) -> Any:
|
|
79
76
|
"""
|
|
80
77
|
Fetches a single, specific report identified by its `reportId` from within a given `jobId`. This retrieves an individual record, distinguishing it from `get_jobs_job_reports`, which returns a list of reports for a job. The request can be made on behalf of a content owner.
|
|
81
|
-
|
|
78
|
+
|
|
82
79
|
Args:
|
|
83
80
|
jobId: The unique identifier for the job containing the report (required).
|
|
84
81
|
reportId: The unique identifier for the report to fetch (required).
|
|
85
82
|
onBehalfOfContentOwner: Optional; specifies the content owner for whom the request is made.
|
|
86
|
-
|
|
83
|
+
|
|
87
84
|
Returns:
|
|
88
85
|
A JSON object containing the fetched report details.
|
|
89
|
-
|
|
86
|
+
|
|
90
87
|
Raises:
|
|
91
88
|
ValueError: Raised if 'jobId' or 'reportId' is not provided.
|
|
92
89
|
requests.HTTPError: Raised if the API request fails (e.g., invalid permissions or resource not found).
|
|
93
|
-
|
|
90
|
+
|
|
94
91
|
Tags:
|
|
95
92
|
retrieve, report, job, api, json
|
|
96
93
|
"""
|
|
@@ -111,18 +108,18 @@ class YoutubeApp(APIApplication):
|
|
|
111
108
|
def delete_job(self, jobId, onBehalfOfContentOwner=None) -> Any:
|
|
112
109
|
"""
|
|
113
110
|
Deletes a specific job resource using its unique `jobId`, optionally on behalf of a content owner. This action permanently removes the job itself, differentiating it from functions that only retrieve or manage job reports.
|
|
114
|
-
|
|
111
|
+
|
|
115
112
|
Args:
|
|
116
113
|
jobId: The unique identifier of the job to delete. Required.
|
|
117
114
|
onBehalfOfContentOwner: Optional. Content owner ID for delegated authorization.
|
|
118
|
-
|
|
115
|
+
|
|
119
116
|
Returns:
|
|
120
117
|
JSON response from the API as a Python dictionary.
|
|
121
|
-
|
|
118
|
+
|
|
122
119
|
Raises:
|
|
123
120
|
ValueError: Raised when jobId is None.
|
|
124
121
|
requests.exceptions.HTTPError: Raised for failed HTTP requests (e.g., invalid job ID, permission errors).
|
|
125
|
-
|
|
122
|
+
|
|
126
123
|
Tags:
|
|
127
124
|
delete, jobs, async_job, management
|
|
128
125
|
"""
|
|
@@ -147,19 +144,19 @@ class YoutubeApp(APIApplication):
|
|
|
147
144
|
) -> Any:
|
|
148
145
|
"""
|
|
149
146
|
Retrieves a paginated list of asynchronous jobs from the YouTube Reporting API. Supports filtering by content owner and including system-managed jobs. This function lists multiple jobs, distinct from `get_jobs_job_reports` which retrieves reports for a single job.
|
|
150
|
-
|
|
147
|
+
|
|
151
148
|
Args:
|
|
152
149
|
includeSystemManaged: Optional boolean indicating whether to include system-managed jobs.
|
|
153
150
|
onBehalfOfContentOwner: Optional string representing the content owner on behalf of which the request is made.
|
|
154
151
|
pageSize: Optional integer specifying the number of jobs per page.
|
|
155
152
|
pageToken: Optional string for paginated results page token.
|
|
156
|
-
|
|
153
|
+
|
|
157
154
|
Returns:
|
|
158
155
|
JSON-decoded response containing the list of jobs and related metadata.
|
|
159
|
-
|
|
156
|
+
|
|
160
157
|
Raises:
|
|
161
158
|
HTTPError: Raised if the server returns an unsuccessful status code.
|
|
162
|
-
|
|
159
|
+
|
|
163
160
|
Tags:
|
|
164
161
|
list, scrape, management
|
|
165
162
|
"""
|
|
@@ -181,17 +178,17 @@ class YoutubeApp(APIApplication):
|
|
|
181
178
|
def download_report_media(self, resourceName) -> Any:
|
|
182
179
|
"""
|
|
183
180
|
Downloads the content of a bulk data report from the YouTube Reporting API by its unique `resourceName`. This function retrieves the actual media file generated by a reporting job, distinct from functions that only fetch report metadata.
|
|
184
|
-
|
|
181
|
+
|
|
185
182
|
Args:
|
|
186
183
|
resourceName: The name of the media resource to retrieve. Required and cannot be None.
|
|
187
|
-
|
|
184
|
+
|
|
188
185
|
Returns:
|
|
189
186
|
JSON-formatted data representing the media resource.
|
|
190
|
-
|
|
187
|
+
|
|
191
188
|
Raises:
|
|
192
189
|
ValueError: If 'resourceName' is None.
|
|
193
190
|
requests.exceptions.HTTPError: If the HTTP request fails, such as a 404 for a non-existent resource.
|
|
194
|
-
|
|
191
|
+
|
|
195
192
|
Tags:
|
|
196
193
|
retrieve, media, json, http, get
|
|
197
194
|
"""
|
|
@@ -212,19 +209,19 @@ class YoutubeApp(APIApplication):
|
|
|
212
209
|
) -> Any:
|
|
213
210
|
"""
|
|
214
211
|
Retrieves a list of available report types from the YouTube Reporting API, supporting pagination and filtering. This function returns metadata about what kinds of reports can be generated, distinct from functions like `get_reports` that fetch actual report content.
|
|
215
|
-
|
|
212
|
+
|
|
216
213
|
Args:
|
|
217
214
|
includeSystemManaged: Boolean indicating whether to include system-managed report types in results.
|
|
218
215
|
onBehalfOfContentOwner: Content owner ID for delegated authority requests.
|
|
219
216
|
pageSize: Maximum number of items to return per response page.
|
|
220
217
|
pageToken: Token identifying a specific results page for pagination.
|
|
221
|
-
|
|
218
|
+
|
|
222
219
|
Returns:
|
|
223
220
|
Dictionary containing report type entries and pagination details, typically including 'items' list and 'nextPageToken' if applicable.
|
|
224
|
-
|
|
221
|
+
|
|
225
222
|
Raises:
|
|
226
223
|
HTTPError: If the API request fails due to network issues, authentication problems, or invalid parameters.
|
|
227
|
-
|
|
224
|
+
|
|
228
225
|
Tags:
|
|
229
226
|
retrieve, list, api-resource, filtering, pagination, report-management
|
|
230
227
|
"""
|
|
@@ -248,18 +245,18 @@ class YoutubeApp(APIApplication):
|
|
|
248
245
|
) -> Any:
|
|
249
246
|
"""
|
|
250
247
|
Deletes a specific YouTube caption resource using its unique ID, with optional delegation for content owners. This management function removes the entire caption track, unlike `get_captions` which only retrieves the transcript text for a given video ID.
|
|
251
|
-
|
|
248
|
+
|
|
252
249
|
Args:
|
|
253
250
|
id: Optional unique identifier for the caption resource to delete.
|
|
254
251
|
onBehalfOf: Optional parameter identifying the user on whose behalf the request is made.
|
|
255
252
|
onBehalfOfContentOwner: Optional parameter specifying the content owner authorizing the request.
|
|
256
|
-
|
|
253
|
+
|
|
257
254
|
Returns:
|
|
258
255
|
JSON response containing the result of the DELETE operation from the YouTube API.
|
|
259
|
-
|
|
256
|
+
|
|
260
257
|
Raises:
|
|
261
258
|
HTTPError: Raised when the HTTP request fails, such as invalid ID, authentication failures, or API limitations exceeded.
|
|
262
|
-
|
|
259
|
+
|
|
263
260
|
Tags:
|
|
264
261
|
delete, captions, api, management
|
|
265
262
|
"""
|
|
@@ -280,17 +277,17 @@ class YoutubeApp(APIApplication):
|
|
|
280
277
|
def get_transcript_text(self, video_id: str) -> str:
|
|
281
278
|
"""
|
|
282
279
|
Fetches the full text transcript for a YouTube video using its ID. Unlike other methods using the official API, this function utilizes the `youtube-transcript-api` library to extract and concatenate all caption snippets into a single, timestamp-free string of the video's spoken content.
|
|
283
|
-
|
|
280
|
+
|
|
284
281
|
Args:
|
|
285
282
|
video_id: The unique identifier for the target video (required)
|
|
286
|
-
|
|
283
|
+
|
|
287
284
|
Returns:
|
|
288
285
|
String containing the complete transcript text without timestamps
|
|
289
|
-
|
|
286
|
+
|
|
290
287
|
Raises:
|
|
291
288
|
ValueError: Raised when required 'video_id' parameter is missing
|
|
292
289
|
Exception: Raised when transcript cannot be retrieved (e.g., no captions available)
|
|
293
|
-
|
|
290
|
+
|
|
294
291
|
Tags:
|
|
295
292
|
retrieve, transcript, text, captions
|
|
296
293
|
"""
|
|
@@ -298,10 +295,20 @@ class YoutubeApp(APIApplication):
|
|
|
298
295
|
raise ValueError("Missing required parameter 'video_id'")
|
|
299
296
|
|
|
300
297
|
try:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
298
|
+
proxy_username = os.getenv("PROXY_USERNAME")
|
|
299
|
+
proxy_password = os.getenv("PROXY_PASSWORD")
|
|
300
|
+
proxy_port = int(os.getenv("PROXY_PORT", 80))
|
|
301
|
+
|
|
302
|
+
if not proxy_username or not proxy_password:
|
|
303
|
+
raise ValueError(
|
|
304
|
+
"PROXY_USERNAME and PROXY_PASSWORD must be set when using proxy"
|
|
304
305
|
)
|
|
306
|
+
api = YouTubeTranscriptApi(
|
|
307
|
+
proxy_config=WebshareProxyConfig(
|
|
308
|
+
proxy_username=proxy_username,
|
|
309
|
+
proxy_password=proxy_password,
|
|
310
|
+
proxy_port=proxy_port,
|
|
311
|
+
),
|
|
305
312
|
)
|
|
306
313
|
transcript = api.fetch(video_id)
|
|
307
314
|
|
|
@@ -318,16 +325,16 @@ class YoutubeApp(APIApplication):
|
|
|
318
325
|
def delete_comments(self, id=None) -> Any:
|
|
319
326
|
"""
|
|
320
327
|
Permanently removes a specific comment identified by its unique ID via a DELETE request. Unlike moderation functions like `add_comments_mark_as_spam`, which only alter a comment's state, this action is irreversible and deletes the resource. An `id` is required to specify the target comment.
|
|
321
|
-
|
|
328
|
+
|
|
322
329
|
Args:
|
|
323
330
|
id: Optional ID of the comment to be deleted. If not provided, and based on implementation, all comments may be deleted.
|
|
324
|
-
|
|
331
|
+
|
|
325
332
|
Returns:
|
|
326
333
|
The JSON response from the server after attempting to delete the comment(s).
|
|
327
|
-
|
|
334
|
+
|
|
328
335
|
Raises:
|
|
329
336
|
requests.RequestException: Raised if there is a network error or an invalid response from the server.
|
|
330
|
-
|
|
337
|
+
|
|
331
338
|
Tags:
|
|
332
339
|
delete, comments, management
|
|
333
340
|
"""
|
|
@@ -339,16 +346,16 @@ class YoutubeApp(APIApplication):
|
|
|
339
346
|
def mark_comment_as_spam(self, id=None) -> Any:
|
|
340
347
|
"""
|
|
341
348
|
Marks a specified YouTube comment as spam via a POST request to the API. This moderation action is distinct from deleting comments (`delete_comments`) or setting other statuses like 'approved' or 'rejected' (`add_comments_set_moderation_status`).
|
|
342
|
-
|
|
349
|
+
|
|
343
350
|
Args:
|
|
344
351
|
id: Optional unique identifier of the comment to mark as spam (included in request parameters when provided).
|
|
345
|
-
|
|
352
|
+
|
|
346
353
|
Returns:
|
|
347
354
|
JSON response from the API containing the operation result.
|
|
348
|
-
|
|
355
|
+
|
|
349
356
|
Raises:
|
|
350
357
|
HTTPError: If the POST request fails or returns a non-200 status code.
|
|
351
|
-
|
|
358
|
+
|
|
352
359
|
Tags:
|
|
353
360
|
comments, spam, post-request, api, moderation
|
|
354
361
|
"""
|
|
@@ -363,18 +370,18 @@ class YoutubeApp(APIApplication):
|
|
|
363
370
|
) -> Any:
|
|
364
371
|
"""
|
|
365
372
|
Sets the moderation status (e.g., 'approved', 'rejected') for specified comments and can optionally ban the author. Unlike `add_comments_mark_as_spam`, this function allows for various moderation states, providing more granular control over comment management.
|
|
366
|
-
|
|
373
|
+
|
|
367
374
|
Args:
|
|
368
375
|
banAuthor: Optional boolean indicating whether to ban the comment's author
|
|
369
376
|
id: Optional string representing the unique identifier of the comment to moderate
|
|
370
377
|
moderationStatus: Optional string specifying the new moderation status (e.g., 'approved', 'rejected')
|
|
371
|
-
|
|
378
|
+
|
|
372
379
|
Returns:
|
|
373
380
|
JSON response from the server containing the result of the moderation operation
|
|
374
|
-
|
|
381
|
+
|
|
375
382
|
Raises:
|
|
376
383
|
requests.HTTPError: Raised when the HTTP request fails (e.g., invalid parameters or server errors)
|
|
377
|
-
|
|
384
|
+
|
|
378
385
|
Tags:
|
|
379
386
|
moderation, comments, management, api-client, status-update, ban-author
|
|
380
387
|
"""
|
|
@@ -397,18 +404,18 @@ class YoutubeApp(APIApplication):
|
|
|
397
404
|
) -> Any:
|
|
398
405
|
"""
|
|
399
406
|
Deletes a YouTube live broadcast event by its unique ID via the API. This request can be made on behalf of a content owner or channel. It targets the `/liveBroadcasts` endpoint, distinguishing it from `delete_livestreams` which manages the actual content stream.
|
|
400
|
-
|
|
407
|
+
|
|
401
408
|
Args:
|
|
402
409
|
id: Optional; Unique identifier of the live broadcast to delete (str).
|
|
403
410
|
onBehalfOfContentOwner: Optional; Content owner acting on behalf of (str).
|
|
404
411
|
onBehalfOfContentOwnerChannel: Optional; Channel ID linked to content owner (str).
|
|
405
|
-
|
|
412
|
+
|
|
406
413
|
Returns:
|
|
407
414
|
Dict[str, Any] containing the JSON-parsed response from the API request.
|
|
408
|
-
|
|
415
|
+
|
|
409
416
|
Raises:
|
|
410
417
|
requests.HTTPError: Raised for any HTTP request failures or invalid status codes (4XX/5XX).
|
|
411
|
-
|
|
418
|
+
|
|
412
419
|
Tags:
|
|
413
420
|
delete, live-broadcast, management, api
|
|
414
421
|
"""
|
|
@@ -436,20 +443,20 @@ class YoutubeApp(APIApplication):
|
|
|
436
443
|
) -> Any:
|
|
437
444
|
"""
|
|
438
445
|
Binds a YouTube live broadcast to a video stream using their respective IDs. This action associates the broadcast's metadata with the content stream, optionally performing the action on behalf of a content owner, facilitating the link between a planned event and its live video feed.
|
|
439
|
-
|
|
446
|
+
|
|
440
447
|
Args:
|
|
441
448
|
id: The id of the live broadcast to bind.
|
|
442
449
|
onBehalfOfContentOwner: The YouTube CMS content owner on behalf of whom the operation is performed.
|
|
443
450
|
onBehalfOfContentOwnerChannel: The YouTube channel ID for which the live broadcast is operated.
|
|
444
451
|
part: A comma-separated list of liveBroadcast resource properties to include in the API response.
|
|
445
452
|
streamId: The id of the stream to which the live broadcast is to be bound.
|
|
446
|
-
|
|
453
|
+
|
|
447
454
|
Returns:
|
|
448
455
|
The JSON response object from the YouTube API after attempting to bind the live broadcast to the stream.
|
|
449
|
-
|
|
456
|
+
|
|
450
457
|
Raises:
|
|
451
458
|
HTTPError: Raised if the request to the YouTube API fails, typically due to server errors or invalid responses.
|
|
452
|
-
|
|
459
|
+
|
|
453
460
|
Tags:
|
|
454
461
|
bind, youtube-api, live-broadcast, stream
|
|
455
462
|
"""
|
|
@@ -481,7 +488,7 @@ class YoutubeApp(APIApplication):
|
|
|
481
488
|
) -> Any:
|
|
482
489
|
"""
|
|
483
490
|
Sends control commands to a YouTube live broadcast, identified by its ID. It can display a slate or schedule an action using a time offset. Unlike `add_live_broadcasts_transition`, which alters broadcast status (e.g., 'live'), this function manages in-stream state.
|
|
484
|
-
|
|
491
|
+
|
|
485
492
|
Args:
|
|
486
493
|
displaySlate: Optional; Specifies whether or not to show a slate during the broadcast.
|
|
487
494
|
id: Optional; The ID of the live broadcast to control.
|
|
@@ -490,13 +497,13 @@ class YoutubeApp(APIApplication):
|
|
|
490
497
|
onBehalfOfContentOwnerChannel: Optional; The channel owned by the content owner.
|
|
491
498
|
part: Optional; Specifies a comma-separated list of one or more broadcasts resource properties.
|
|
492
499
|
walltime: Optional; An RFC 3339 timestamp that represents the time at which the action takes place.
|
|
493
|
-
|
|
500
|
+
|
|
494
501
|
Returns:
|
|
495
502
|
The JSON response from the server after controlling the live broadcast.
|
|
496
|
-
|
|
503
|
+
|
|
497
504
|
Raises:
|
|
498
505
|
requests.HTTPError: Raised if the HTTP request returns an unsuccessful status code.
|
|
499
|
-
|
|
506
|
+
|
|
500
507
|
Tags:
|
|
501
508
|
control, live-broadcast, async_job, management
|
|
502
509
|
"""
|
|
@@ -528,20 +535,20 @@ class YoutubeApp(APIApplication):
|
|
|
528
535
|
) -> Any:
|
|
529
536
|
"""
|
|
530
537
|
Changes a YouTube live broadcast's status (e.g., making it 'live' or 'complete') by posting to the API's transition endpoint. This function alters the broadcast's lifecycle state, distinct from other control actions like binding it to a stream, and returns the API's JSON response.
|
|
531
|
-
|
|
538
|
+
|
|
532
539
|
Args:
|
|
533
540
|
broadcastStatus: Optional; The status to which the live broadcast should be transitioned.
|
|
534
541
|
id: Optional; The unique identifier of the broadcast that needs to be transitioned.
|
|
535
542
|
onBehalfOfContentOwner: Optional; The YouTube content owner on whose behalf the API request is being made.
|
|
536
543
|
onBehalfOfContentOwnerChannel: Optional; The YouTube channel ID of the channel associated with the specified content owner.
|
|
537
544
|
part: Optional; A comma-separated list of one or more liveBroadcast resource properties that the API response will include.
|
|
538
|
-
|
|
545
|
+
|
|
539
546
|
Returns:
|
|
540
547
|
The JSON response from the API containing the details of the transitioned live broadcast.
|
|
541
|
-
|
|
548
|
+
|
|
542
549
|
Raises:
|
|
543
550
|
requests.HTTPError: Raised when the HTTP request to the API fails due to a server error or invalid request.
|
|
544
|
-
|
|
551
|
+
|
|
545
552
|
Tags:
|
|
546
553
|
transition, live-broadcast, youtube-api, video-management
|
|
547
554
|
"""
|
|
@@ -564,16 +571,16 @@ class YoutubeApp(APIApplication):
|
|
|
564
571
|
def delete_live_chat_ban(self, id=None) -> Any:
|
|
565
572
|
"""
|
|
566
573
|
Deletes a specific YouTube live chat ban using its unique ID. It sends a DELETE request to the `/liveChat/bans` endpoint to revoke the ban, allowing the user to participate in the chat again.
|
|
567
|
-
|
|
574
|
+
|
|
568
575
|
Args:
|
|
569
576
|
id: Optional; The unique identifier of the live chat ban to delete. If None, no specific ban is targeted.
|
|
570
|
-
|
|
577
|
+
|
|
571
578
|
Returns:
|
|
572
579
|
The JSON response from the server after deletion, typically containing operation details.
|
|
573
|
-
|
|
580
|
+
|
|
574
581
|
Raises:
|
|
575
582
|
requests.HTTPError: Raised if the HTTP request fails, indicating server-side issues or invalid parameters.
|
|
576
|
-
|
|
583
|
+
|
|
577
584
|
Tags:
|
|
578
585
|
delete, management, live-chat, async-job
|
|
579
586
|
"""
|
|
@@ -586,16 +593,16 @@ class YoutubeApp(APIApplication):
|
|
|
586
593
|
def delete_live_chat_message(self, id=None) -> Any:
|
|
587
594
|
"""
|
|
588
595
|
Deletes a specific YouTube live chat message identified by its unique ID. This function targets the `/liveChat/messages` endpoint, distinguishing it from `delete_live_chat_bans` and `delete_live_chat_moderators`, which manage different aspects of a live chat.
|
|
589
|
-
|
|
596
|
+
|
|
590
597
|
Args:
|
|
591
598
|
id: Optional; The identifier of the specific live chat message to be deleted. If not provided, it defaults to None.
|
|
592
|
-
|
|
599
|
+
|
|
593
600
|
Returns:
|
|
594
601
|
A JSON object containing the server's response to the deletion request. It includes details about the operation's success or failure.
|
|
595
|
-
|
|
602
|
+
|
|
596
603
|
Raises:
|
|
597
604
|
HTTPError: Raised if the HTTP request to delete the message fails.
|
|
598
|
-
|
|
605
|
+
|
|
599
606
|
Tags:
|
|
600
607
|
delete, live-chat, message-management
|
|
601
608
|
"""
|
|
@@ -608,16 +615,16 @@ class YoutubeApp(APIApplication):
|
|
|
608
615
|
def delete_live_chat_moderators(self, id=None) -> Any:
|
|
609
616
|
"""
|
|
610
617
|
Deletes a specific YouTube live chat moderator using their unique ID. This function sends a DELETE request to the `/liveChat/moderators` API endpoint and returns the server's JSON response, confirming the successful removal or detailing errors. The moderator ID is a required parameter for this action.
|
|
611
|
-
|
|
618
|
+
|
|
612
619
|
Args:
|
|
613
620
|
id: The ID of the live chat moderator to delete. When None, no deletion occurs (moderator IDs must be explicitly specified).
|
|
614
|
-
|
|
621
|
+
|
|
615
622
|
Returns:
|
|
616
623
|
Parsed JSON response from the server containing deletion confirmation or error details.
|
|
617
|
-
|
|
624
|
+
|
|
618
625
|
Raises:
|
|
619
626
|
requests.HTTPError: Raised for unsuccessful HTTP responses (e.g., invalid ID, authorization failure, or server errors).
|
|
620
|
-
|
|
627
|
+
|
|
621
628
|
Tags:
|
|
622
629
|
delete, moderators, management, live-chat, async_job, ids
|
|
623
630
|
"""
|
|
@@ -630,17 +637,17 @@ class YoutubeApp(APIApplication):
|
|
|
630
637
|
def delete_videos(self, id=None, onBehalfOfContentOwner=None) -> Any:
|
|
631
638
|
"""
|
|
632
639
|
Deletes a specified YouTube video using its unique ID. The operation can be performed on behalf of a content owner by sending an HTTP DELETE request to the `/videos` endpoint. It's distinct from other video functions that only modify or retrieve metadata, like rating or abuse reports.
|
|
633
|
-
|
|
640
|
+
|
|
634
641
|
Args:
|
|
635
642
|
id: (str, optional): Unique identifier of the video to delete. If omitted, no video ID is specified.
|
|
636
643
|
onBehalfOfContentOwner: (str, optional): Content owner on whose behalf the operation is performed. Defaults to authenticated user.
|
|
637
|
-
|
|
644
|
+
|
|
638
645
|
Returns:
|
|
639
646
|
(Any): Parsed JSON response from the API including deletion status/errors.
|
|
640
|
-
|
|
647
|
+
|
|
641
648
|
Raises:
|
|
642
649
|
requests.HTTPError: Raised when the API request fails (e.g., invalid video ID, insufficient permissions).
|
|
643
|
-
|
|
650
|
+
|
|
644
651
|
Tags:
|
|
645
652
|
delete, video-management, api, async_job
|
|
646
653
|
"""
|
|
@@ -657,17 +664,17 @@ class YoutubeApp(APIApplication):
|
|
|
657
664
|
def get_video_ratings(self, id=None, onBehalfOfContentOwner=None) -> Any:
|
|
658
665
|
"""
|
|
659
666
|
Retrieves the authenticated user's rating (e.g., 'like', 'dislike') for specified videos. This function fetches existing rating data, distinct from `add_videos_rate` which submits a new rating, and can be performed on behalf of a content owner.
|
|
660
|
-
|
|
667
|
+
|
|
661
668
|
Args:
|
|
662
669
|
id: Optional; The ID of the video for which the rating is to be retrieved. If None, no specific video ID is used in the request.
|
|
663
670
|
onBehalfOfContentOwner: Optional; Identifies the content owner for whom the request is being made.
|
|
664
|
-
|
|
671
|
+
|
|
665
672
|
Returns:
|
|
666
673
|
A JSON object containing the video rating information returned by the API.
|
|
667
|
-
|
|
674
|
+
|
|
668
675
|
Raises:
|
|
669
676
|
HTTPError: Raised if the HTTP request returns an unsuccessful status code.
|
|
670
|
-
|
|
677
|
+
|
|
671
678
|
Tags:
|
|
672
679
|
check, video-management
|
|
673
680
|
"""
|
|
@@ -684,17 +691,17 @@ class YoutubeApp(APIApplication):
|
|
|
684
691
|
def rate_video(self, id=None, rating=None) -> Any:
|
|
685
692
|
"""
|
|
686
693
|
Submits a rating (e.g., 'like', 'dislike') for a video specified by its unique ID. This function sends a POST request to the YouTube API's `/videos/rate` endpoint and returns the server's JSON response upon successful submission.
|
|
687
|
-
|
|
694
|
+
|
|
688
695
|
Args:
|
|
689
696
|
id: Optional; The unique identifier of the video to rate. If None, the video ID is not included in the request.
|
|
690
697
|
rating: Optional; The rating value to assign to the video. If None, the rating is not included in the request.
|
|
691
|
-
|
|
698
|
+
|
|
692
699
|
Returns:
|
|
693
700
|
The JSON response from the server after submitting the rating.
|
|
694
|
-
|
|
701
|
+
|
|
695
702
|
Raises:
|
|
696
703
|
HTTPError: Raised when the server returns an HTTP error status.
|
|
697
|
-
|
|
704
|
+
|
|
698
705
|
Tags:
|
|
699
706
|
rate, video-management, importance
|
|
700
707
|
"""
|
|
@@ -709,16 +716,16 @@ class YoutubeApp(APIApplication):
|
|
|
709
716
|
def report_video_for_abuse(self, onBehalfOfContentOwner=None) -> Any:
|
|
710
717
|
"""
|
|
711
718
|
Reports a video for abuse via a POST request to the YouTube API. An optional parameter allows a content owner to submit the report on behalf of their account, flagging potentially inappropriate content for review by YouTube.
|
|
712
|
-
|
|
719
|
+
|
|
713
720
|
Args:
|
|
714
721
|
onBehalfOfContentOwner: Optional; YouTube content owner ID acting as the reporting entity (for partner accounts).
|
|
715
|
-
|
|
722
|
+
|
|
716
723
|
Returns:
|
|
717
724
|
Dict containing the JSON response from the YouTube API after reporting abuse.
|
|
718
|
-
|
|
725
|
+
|
|
719
726
|
Raises:
|
|
720
727
|
HTTPError: Raised when the YouTube API request fails, typically due to authentication errors or invalid parameters.
|
|
721
|
-
|
|
728
|
+
|
|
722
729
|
Tags:
|
|
723
730
|
report, abuse, video, content, api
|
|
724
731
|
"""
|
|
@@ -735,17 +742,17 @@ class YoutubeApp(APIApplication):
|
|
|
735
742
|
def set_channel_watermark(self, channelId=None, onBehalfOfContentOwner=None) -> Any:
|
|
736
743
|
"""
|
|
737
744
|
Sets a branding watermark on a specified YouTube channel. The operation targets the channel using its ID and can be executed on behalf of a content owner. This function contrasts with `add_watermarks_unset`, which removes the watermark.
|
|
738
|
-
|
|
745
|
+
|
|
739
746
|
Args:
|
|
740
747
|
channelId: Optional; The ID of the YouTube channel on which to set the watermark.
|
|
741
748
|
onBehalfOfContentOwner: Optional; The content owner's ID that the request is made on behalf of.
|
|
742
|
-
|
|
749
|
+
|
|
743
750
|
Returns:
|
|
744
751
|
The JSON response from the API call, which includes details about the watermark setting operation.
|
|
745
|
-
|
|
752
|
+
|
|
746
753
|
Raises:
|
|
747
754
|
requests.RequestException: Raised if there is an error with the API request, such as connection issues or invalid response status.
|
|
748
|
-
|
|
755
|
+
|
|
749
756
|
Tags:
|
|
750
757
|
watermark, youtube, management, channel-config
|
|
751
758
|
"""
|
|
@@ -762,20 +769,22 @@ class YoutubeApp(APIApplication):
|
|
|
762
769
|
response.raise_for_status()
|
|
763
770
|
return response.json()
|
|
764
771
|
|
|
765
|
-
def unset_channel_watermark(
|
|
772
|
+
def unset_channel_watermark(
|
|
773
|
+
self, channelId=None, onBehalfOfContentOwner=None
|
|
774
|
+
) -> Any:
|
|
766
775
|
"""
|
|
767
776
|
Removes the branding watermark for a specified YouTube channel via an API POST request. This operation, the inverse of `add_watermarks_set`, can be executed on behalf of a content owner to unset the channel's current watermark.
|
|
768
|
-
|
|
777
|
+
|
|
769
778
|
Args:
|
|
770
779
|
channelId: Optional; The unique identifier of the YouTube channel from which to remove watermarks.
|
|
771
780
|
onBehalfOfContentOwner: Optional; The content owner that the request is on behalf of, used by YouTube content partners.
|
|
772
|
-
|
|
781
|
+
|
|
773
782
|
Returns:
|
|
774
783
|
The JSON response from the YouTube API after attempting to remove the watermarks.
|
|
775
|
-
|
|
784
|
+
|
|
776
785
|
Raises:
|
|
777
786
|
HTTPError: Raised when there is an error in the HTTP request or if the server returns a status code indicating a client or server error.
|
|
778
|
-
|
|
787
|
+
|
|
779
788
|
Tags:
|
|
780
789
|
remove, watermark, youtube
|
|
781
790
|
"""
|
|
@@ -806,7 +815,7 @@ class YoutubeApp(APIApplication):
|
|
|
806
815
|
) -> Any:
|
|
807
816
|
"""
|
|
808
817
|
Retrieves a list of YouTube activities, such as video uploads or social posts. Supports filtering by channel, authenticated user's feed, publication date, and region. The function also handles pagination to navigate through large result sets and returns the JSON response from the API.
|
|
809
|
-
|
|
818
|
+
|
|
810
819
|
Args:
|
|
811
820
|
channelId: The YouTube channel ID to fetch activities from. If None, fetches from multiple sources (depending on other parameters).
|
|
812
821
|
home: If True, retrieves activities from the user's personalized YouTube home feed. Requires authentication if mine is not specified.
|
|
@@ -817,13 +826,13 @@ class YoutubeApp(APIApplication):
|
|
|
817
826
|
publishedAfter: Filter activities published after this datetime (ISO 8601 format).
|
|
818
827
|
publishedBefore: Filter activities published before this datetime (ISO 8601 format).
|
|
819
828
|
regionCode: Return activities viewable in the specified two-letter ISO country code.
|
|
820
|
-
|
|
829
|
+
|
|
821
830
|
Returns:
|
|
822
831
|
Dictionary containing parsed JSON response with activity data.
|
|
823
|
-
|
|
832
|
+
|
|
824
833
|
Raises:
|
|
825
834
|
requests.HTTPError: Raised when the API request fails due to invalid parameters, authentication issues, or server errors.
|
|
826
|
-
|
|
835
|
+
|
|
827
836
|
Tags:
|
|
828
837
|
retrieve, activities, youtube, api-client, pagination, filter, async
|
|
829
838
|
"""
|
|
@@ -847,22 +856,20 @@ class YoutubeApp(APIApplication):
|
|
|
847
856
|
response.raise_for_status()
|
|
848
857
|
return response.json()
|
|
849
858
|
|
|
850
|
-
def insert_channel_banner(
|
|
851
|
-
self, channelId=None, onBehalfOfContentOwner=None
|
|
852
|
-
) -> Any:
|
|
859
|
+
def insert_channel_banner(self, channelId=None, onBehalfOfContentOwner=None) -> Any:
|
|
853
860
|
"""
|
|
854
861
|
Uploads and sets a new banner image for a specified YouTube channel. This function makes a POST request to the `/channelBanners/insert` endpoint, optionally on behalf of a content owner, and returns details of the newly created banner.
|
|
855
|
-
|
|
862
|
+
|
|
856
863
|
Args:
|
|
857
864
|
channelId: Optional string specifying the unique identifier of the YouTube channel for banner insertion
|
|
858
865
|
onBehalfOfContentOwner: Optional string indicating the content owner's external ID when acting on their behalf
|
|
859
|
-
|
|
866
|
+
|
|
860
867
|
Returns:
|
|
861
868
|
JSON object containing the API response with details of the newly inserted channel banner
|
|
862
|
-
|
|
869
|
+
|
|
863
870
|
Raises:
|
|
864
871
|
HTTPError: Raised when the YouTube Data API request fails (4XX or 5XX status code)
|
|
865
|
-
|
|
872
|
+
|
|
866
873
|
Tags:
|
|
867
874
|
insert, channel, banner, youtube-api, management, async_job
|
|
868
875
|
"""
|
|
@@ -882,17 +889,17 @@ class YoutubeApp(APIApplication):
|
|
|
882
889
|
def delete_channel_sections(self, id=None, onBehalfOfContentOwner=None) -> Any:
|
|
883
890
|
"""
|
|
884
891
|
Deletes a YouTube channel section by its unique ID via an API request. The operation can be performed on behalf of a content owner for delegated management, returning a JSON response upon success or raising an HTTPError for failures like invalid IDs or insufficient permissions.
|
|
885
|
-
|
|
892
|
+
|
|
886
893
|
Args:
|
|
887
894
|
id: Optional string representing the unique identifier of the target channel section. If omitted, no specific deletion occurs (behavior depends on API implementation).
|
|
888
895
|
onBehalfOfContentOwner: Optional string indicating the content owner on whose behalf the request is made.
|
|
889
|
-
|
|
896
|
+
|
|
890
897
|
Returns:
|
|
891
898
|
JSON-decoded response payload from the API server after deletion attempt.
|
|
892
|
-
|
|
899
|
+
|
|
893
900
|
Raises:
|
|
894
901
|
requests.HTTPError: Raised for HTTP 4xx/5xx responses from the server during the deletion request.
|
|
895
|
-
|
|
902
|
+
|
|
896
903
|
Tags:
|
|
897
904
|
delete, channel-section, management
|
|
898
905
|
"""
|
|
@@ -922,7 +929,7 @@ class YoutubeApp(APIApplication):
|
|
|
922
929
|
) -> Any:
|
|
923
930
|
"""
|
|
924
931
|
Retrieves channel data from the YouTube API using specific filters like ID, username, or ownership status (`mine`, `managedByMe`). The function supports pagination and localization, returning a JSON object containing details for the targeted channels.
|
|
925
|
-
|
|
932
|
+
|
|
926
933
|
Args:
|
|
927
934
|
categoryId: Category ID to filter channels.
|
|
928
935
|
forUsername: Username to retrieve channels for.
|
|
@@ -935,13 +942,13 @@ class YoutubeApp(APIApplication):
|
|
|
935
942
|
onBehalfOfContentOwner: Content owner ID to retrieve channels on behalf of.
|
|
936
943
|
pageToken: Token for pagination.
|
|
937
944
|
part: Specified parts of the channel resource to include in the response.
|
|
938
|
-
|
|
945
|
+
|
|
939
946
|
Returns:
|
|
940
947
|
JSON response containing the requested channels.
|
|
941
|
-
|
|
948
|
+
|
|
942
949
|
Raises:
|
|
943
950
|
ResponseError: Raised if there is an error in the HTTP response.
|
|
944
|
-
|
|
951
|
+
|
|
945
952
|
Tags:
|
|
946
953
|
search, youtube, channels, management, important
|
|
947
954
|
"""
|
|
@@ -983,7 +990,7 @@ class YoutubeApp(APIApplication):
|
|
|
983
990
|
) -> Any:
|
|
984
991
|
"""
|
|
985
992
|
Retrieves YouTube comment threads using filters like channel ID, video ID, or search terms. It supports pagination and sorting, serving as the primary method for fetching comment data, distinct from other functions in the script that moderate or delete individual comments.
|
|
986
|
-
|
|
993
|
+
|
|
987
994
|
Args:
|
|
988
995
|
allThreadsRelatedToChannelId: Returns all threads associated with the specified channel, including replies
|
|
989
996
|
channelId: Channel ID to filter comment threads
|
|
@@ -996,13 +1003,13 @@ class YoutubeApp(APIApplication):
|
|
|
996
1003
|
searchTerms: Text search query to filter comments
|
|
997
1004
|
textFormat: Formatting for comment text (e.g., 'html', 'plainText')
|
|
998
1005
|
videoId: Video ID to filter associated comment threads
|
|
999
|
-
|
|
1006
|
+
|
|
1000
1007
|
Returns:
|
|
1001
1008
|
JSON response containing comment thread data and pagination information
|
|
1002
|
-
|
|
1009
|
+
|
|
1003
1010
|
Raises:
|
|
1004
1011
|
HTTPError: Raised for unsuccessful API requests (4xx/5xx status codes)
|
|
1005
|
-
|
|
1012
|
+
|
|
1006
1013
|
Tags:
|
|
1007
1014
|
retrieve, comments, pagination, youtube-api, rest, data-fetch
|
|
1008
1015
|
"""
|
|
@@ -1033,19 +1040,19 @@ class YoutubeApp(APIApplication):
|
|
|
1033
1040
|
) -> Any:
|
|
1034
1041
|
"""
|
|
1035
1042
|
Fetches a list of fan funding events from the YouTube API for the authenticated user's channel. Supports pagination, localization, and partial responses to retrieve customized event data like Super Chat or Super Stickers based on specified filter criteria and response parts.
|
|
1036
|
-
|
|
1043
|
+
|
|
1037
1044
|
Args:
|
|
1038
1045
|
hl: Optional; a string representing the language for text values.
|
|
1039
1046
|
maxResults: Optional; an integer specifying the maximum number of results to return.
|
|
1040
1047
|
pageToken: Optional; a string token to retrieve a specific page in a paginated set of results.
|
|
1041
1048
|
part: Optional; a comma-separated list of one or more 'fanFundingEvent' resource properties that the API response will include.
|
|
1042
|
-
|
|
1049
|
+
|
|
1043
1050
|
Returns:
|
|
1044
1051
|
A JSON-decoded response of the fan funding events data retrieved from the API.
|
|
1045
|
-
|
|
1052
|
+
|
|
1046
1053
|
Raises:
|
|
1047
1054
|
HTTPError: Raised if the API request returns a status code that indicates an error.
|
|
1048
|
-
|
|
1055
|
+
|
|
1049
1056
|
Tags:
|
|
1050
1057
|
retrieve, events, fanfunding
|
|
1051
1058
|
"""
|
|
@@ -1067,19 +1074,19 @@ class YoutubeApp(APIApplication):
|
|
|
1067
1074
|
def get_guide_categories(self, hl=None, id=None, part=None, regionCode=None) -> Any:
|
|
1068
1075
|
"""
|
|
1069
1076
|
Retrieves a list of official YouTube guide categories (e.g., Music, Sports). This function queries the `/guideCategories` endpoint, allowing results to be filtered by ID or region and localized for a specific language. These are distinct from the categories assigned to individual videos.
|
|
1070
|
-
|
|
1077
|
+
|
|
1071
1078
|
Args:
|
|
1072
1079
|
hl: Optional; a string that specifies the language localization.
|
|
1073
1080
|
id: Optional; a string representing the ID of the guide category.
|
|
1074
1081
|
part: Optional; a string indicating which parts of the guide category resource to return.
|
|
1075
1082
|
regionCode: Optional; a string that denotes the region of interest.
|
|
1076
|
-
|
|
1083
|
+
|
|
1077
1084
|
Returns:
|
|
1078
1085
|
A dictionary containing the JSON response representing guide categories from the service.
|
|
1079
|
-
|
|
1086
|
+
|
|
1080
1087
|
Raises:
|
|
1081
1088
|
requests.exceptions.HTTPError: Raised if the HTTP request returns an unsuccessful status code.
|
|
1082
|
-
|
|
1089
|
+
|
|
1083
1090
|
Tags:
|
|
1084
1091
|
get, fetch, guide-categories, api-call
|
|
1085
1092
|
"""
|
|
@@ -1101,17 +1108,17 @@ class YoutubeApp(APIApplication):
|
|
|
1101
1108
|
def get_i18n_languages(self, hl=None, part=None) -> Any:
|
|
1102
1109
|
"""
|
|
1103
1110
|
Retrieves a list of supported internationalization (i18n) languages from the YouTube API's `/i18nLanguages` endpoint. It can optionally localize the language names in the response. This function is distinct from `get_regions`, which fetches supported geographical regions.
|
|
1104
|
-
|
|
1111
|
+
|
|
1105
1112
|
Args:
|
|
1106
1113
|
hl: Optional language code to localize returned language names (e.g., 'en' for English).
|
|
1107
1114
|
part: Optional comma-separated list of i18nLanguage resource properties to include in response.
|
|
1108
|
-
|
|
1115
|
+
|
|
1109
1116
|
Returns:
|
|
1110
1117
|
JSON object containing API response with supported languages data.
|
|
1111
|
-
|
|
1118
|
+
|
|
1112
1119
|
Raises:
|
|
1113
1120
|
HTTPError: Raised for unsuccessful API requests (4XX/5XX status codes).
|
|
1114
|
-
|
|
1121
|
+
|
|
1115
1122
|
Tags:
|
|
1116
1123
|
fetch, i18n, languages, api-client
|
|
1117
1124
|
"""
|
|
@@ -1124,17 +1131,17 @@ class YoutubeApp(APIApplication):
|
|
|
1124
1131
|
def get_i18n_regions(self, hl=None, part=None) -> Any:
|
|
1125
1132
|
"""
|
|
1126
1133
|
Fetches a list of geographic regions supported by the YouTube API for content localization. It can localize region names using the 'hl' parameter. This is distinct from get_languages, which retrieves supported languages, not geographic areas.
|
|
1127
|
-
|
|
1134
|
+
|
|
1128
1135
|
Args:
|
|
1129
1136
|
hl: Optional string representing language code for regional localization.
|
|
1130
1137
|
part: Optional comma-separated string specifying i18nRegion resource parts to include.
|
|
1131
|
-
|
|
1138
|
+
|
|
1132
1139
|
Returns:
|
|
1133
1140
|
JSON response containing i18n regions data.
|
|
1134
|
-
|
|
1141
|
+
|
|
1135
1142
|
Raises:
|
|
1136
1143
|
HTTPError: If the API request fails with a 4XX/5XX status code.
|
|
1137
|
-
|
|
1144
|
+
|
|
1138
1145
|
Tags:
|
|
1139
1146
|
list, regions, i18n, api
|
|
1140
1147
|
"""
|
|
@@ -1149,18 +1156,18 @@ class YoutubeApp(APIApplication):
|
|
|
1149
1156
|
) -> Any:
|
|
1150
1157
|
"""
|
|
1151
1158
|
Deletes one or more YouTube livestreams by ID via the `/liveStreams` API endpoint, optionally on behalf of a content owner. This function is distinct from `delete_live_broadcasts`, which targets a different live video resource, and returns the server's JSON response upon successful deletion.
|
|
1152
|
-
|
|
1159
|
+
|
|
1153
1160
|
Args:
|
|
1154
1161
|
id: Optional; A comma-separated list of YouTube livestream IDs to be deleted.
|
|
1155
1162
|
onBehalfOfContentOwner: Optional; The YouTube content owner who is the channel owner of the livestream and makes this API call.
|
|
1156
1163
|
onBehalfOfContentOwnerChannel: Optional; The YouTube channel ID on behalf of which the API call is made.
|
|
1157
|
-
|
|
1164
|
+
|
|
1158
1165
|
Returns:
|
|
1159
1166
|
A JSON object containing the API's response to the delete request.
|
|
1160
|
-
|
|
1167
|
+
|
|
1161
1168
|
Raises:
|
|
1162
1169
|
requests.HTTPError: Raised when the HTTP request returns an unsuccessful status code.
|
|
1163
|
-
|
|
1170
|
+
|
|
1164
1171
|
Tags:
|
|
1165
1172
|
delete, livestream, youtube, api
|
|
1166
1173
|
"""
|
|
@@ -1181,17 +1188,17 @@ class YoutubeApp(APIApplication):
|
|
|
1181
1188
|
def delete_playlist_items(self, id=None, onBehalfOfContentOwner=None) -> Any:
|
|
1182
1189
|
"""
|
|
1183
1190
|
Deletes one or more YouTube playlist items by their unique IDs. The operation can be performed on behalf of a content owner for delegated authorization, sending a DELETE request to the `/playlistItems` endpoint and returning the server's response.
|
|
1184
|
-
|
|
1191
|
+
|
|
1185
1192
|
Args:
|
|
1186
1193
|
id: Optional; The ID of the playlist item to be deleted.
|
|
1187
1194
|
onBehalfOfContentOwner: Optional; The content owner on whose behalf the playlist item is being deleted.
|
|
1188
|
-
|
|
1195
|
+
|
|
1189
1196
|
Returns:
|
|
1190
1197
|
JSON response from the server indicating the result of the deletion operation.
|
|
1191
|
-
|
|
1198
|
+
|
|
1192
1199
|
Raises:
|
|
1193
1200
|
HTTPError: Raised if the API request fails due to invalid parameters, authorization issues, or server errors.
|
|
1194
|
-
|
|
1201
|
+
|
|
1195
1202
|
Tags:
|
|
1196
1203
|
delete, playlist-items, management
|
|
1197
1204
|
"""
|
|
@@ -1208,17 +1215,17 @@ class YoutubeApp(APIApplication):
|
|
|
1208
1215
|
def delete_playlists(self, id=None, onBehalfOfContentOwner=None) -> Any:
|
|
1209
1216
|
"""
|
|
1210
1217
|
Deletes a YouTube playlist by its unique ID via a DELETE request to the API. The operation can be performed on behalf of a specific content owner for delegated management. This function targets the entire playlist, distinct from `delete_play_list_items` which removes individual videos from a playlist.
|
|
1211
|
-
|
|
1218
|
+
|
|
1212
1219
|
Args:
|
|
1213
1220
|
id: Optional; A string representing the ID of the playlist to delete. If None, operation details depend on API implementation (not recommended without explicit identifier).
|
|
1214
1221
|
onBehalfOfContentOwner: Optional; A string representing the content owner on whose behalf the operation is performed. Used for delegated access.
|
|
1215
|
-
|
|
1222
|
+
|
|
1216
1223
|
Returns:
|
|
1217
1224
|
Dictionary containing the JSON response from the YouTube API after playlist deletion.
|
|
1218
|
-
|
|
1225
|
+
|
|
1219
1226
|
Raises:
|
|
1220
1227
|
HTTPError: Raised when the API request fails, typically due to invalid permissions, non-existent playlist, or network issues.
|
|
1221
|
-
|
|
1228
|
+
|
|
1222
1229
|
Tags:
|
|
1223
1230
|
delete, playlists, youtube-api, management
|
|
1224
1231
|
"""
|
|
@@ -1268,7 +1275,7 @@ class YoutubeApp(APIApplication):
|
|
|
1268
1275
|
) -> Any:
|
|
1269
1276
|
"""
|
|
1270
1277
|
Performs a versatile search on YouTube for videos, channels, or playlists. This function supports extensive filters, including keywords, publication dates, location, and specific video attributes like category or duration, returning a paginated list of matching resources from the YouTube Data API.
|
|
1271
|
-
|
|
1278
|
+
|
|
1272
1279
|
Args:
|
|
1273
1280
|
channelId: Channel filter for the search.
|
|
1274
1281
|
channelType: Type of channel to filter by.
|
|
@@ -1301,13 +1308,13 @@ class YoutubeApp(APIApplication):
|
|
|
1301
1308
|
videoLicense: License filter for videos.
|
|
1302
1309
|
videoSyndicated: Whether videos are syndicated.
|
|
1303
1310
|
videoType: Type of video (e.g., 'movie', 'episode')
|
|
1304
|
-
|
|
1311
|
+
|
|
1305
1312
|
Returns:
|
|
1306
1313
|
JSON response containing the search results.
|
|
1307
|
-
|
|
1314
|
+
|
|
1308
1315
|
Raises:
|
|
1309
1316
|
HTTPError: If the request to the YouTube Data API fails.
|
|
1310
|
-
|
|
1317
|
+
|
|
1311
1318
|
Tags:
|
|
1312
1319
|
search, youtube-api, video-search, web-api, important
|
|
1313
1320
|
"""
|
|
@@ -1358,19 +1365,19 @@ class YoutubeApp(APIApplication):
|
|
|
1358
1365
|
) -> Any:
|
|
1359
1366
|
"""
|
|
1360
1367
|
Retrieves a list of sponsors for the authenticated user's YouTube channel. This function supports filtering, pagination, and specifying which resource parts to include in the response, allowing for flexible and customized data fetching of sponsor information.
|
|
1361
|
-
|
|
1368
|
+
|
|
1362
1369
|
Args:
|
|
1363
1370
|
filter: Optional string containing filtering criteria for sponsors.
|
|
1364
1371
|
maxResults: Optional integer limiting the number of returned sponsors.
|
|
1365
1372
|
pageToken: Optional token string for paginating to a specific result page.
|
|
1366
1373
|
part: Optional string specifying which sponsor detail parts to include.
|
|
1367
|
-
|
|
1374
|
+
|
|
1368
1375
|
Returns:
|
|
1369
1376
|
JSON response containing the list of sponsors (filtered/paginated) as returned by the server.
|
|
1370
|
-
|
|
1377
|
+
|
|
1371
1378
|
Raises:
|
|
1372
1379
|
requests.HTTPError: If the HTTP request fails or returns a non-200 status code.
|
|
1373
|
-
|
|
1380
|
+
|
|
1374
1381
|
Tags:
|
|
1375
1382
|
fetch, list, pagination, filter, sponsors, api
|
|
1376
1383
|
"""
|
|
@@ -1392,16 +1399,16 @@ class YoutubeApp(APIApplication):
|
|
|
1392
1399
|
def delete_subscriptions(self, id=None) -> Any:
|
|
1393
1400
|
"""
|
|
1394
1401
|
Deletes a specific YouTube channel subscription identified by its unique ID. This function sends a DELETE request to the `/subscriptions` API endpoint and returns the server's JSON response, confirming the operation's success or failure.
|
|
1395
|
-
|
|
1402
|
+
|
|
1396
1403
|
Args:
|
|
1397
1404
|
id: Optional identifier for a specific subscription to delete (str, int, or None). If None, deletes all subscriptions.
|
|
1398
|
-
|
|
1405
|
+
|
|
1399
1406
|
Returns:
|
|
1400
1407
|
JSON-formatted response from the API containing deletion results.
|
|
1401
|
-
|
|
1408
|
+
|
|
1402
1409
|
Raises:
|
|
1403
1410
|
HTTPError: Raised for HTTP request failures (4XX/5XX status codes) during the deletion attempt.
|
|
1404
|
-
|
|
1411
|
+
|
|
1405
1412
|
Tags:
|
|
1406
1413
|
delete, subscriptions, async-job, management
|
|
1407
1414
|
"""
|
|
@@ -1416,19 +1423,19 @@ class YoutubeApp(APIApplication):
|
|
|
1416
1423
|
) -> Any:
|
|
1417
1424
|
"""
|
|
1418
1425
|
Retrieves a paginated list of Super Chat events from the YouTube Data API. Allows for localization and specifying which resource parts to include in the response. This function is distinct from `get_fanfundingevents`, which fetches a different type of monetary contribution event.
|
|
1419
|
-
|
|
1426
|
+
|
|
1420
1427
|
Args:
|
|
1421
1428
|
hl: Optional; the language code to select localized resource information.
|
|
1422
1429
|
maxResults: Optional; the maximum number of items that should be returned in the result set.
|
|
1423
1430
|
pageToken: Optional; the token to identify a specific page in the result set.
|
|
1424
1431
|
part: Optional; the parameter specifying which super chat event resource parts to include in the response.
|
|
1425
|
-
|
|
1432
|
+
|
|
1426
1433
|
Returns:
|
|
1427
1434
|
A JSON object containing the super chat events data returned by the YouTube API.
|
|
1428
|
-
|
|
1435
|
+
|
|
1429
1436
|
Raises:
|
|
1430
1437
|
RequestException: Raised if there is an issue with the HTTP request, such as network or server errors.
|
|
1431
|
-
|
|
1438
|
+
|
|
1432
1439
|
Tags:
|
|
1433
1440
|
fetch, youtube-api, async-job
|
|
1434
1441
|
"""
|
|
@@ -1450,17 +1457,17 @@ class YoutubeApp(APIApplication):
|
|
|
1450
1457
|
def set_video_thumbnail(self, onBehalfOfContentOwner=None, videoId=None) -> Any:
|
|
1451
1458
|
"""
|
|
1452
1459
|
Sets a custom thumbnail for a specified YouTube video via a POST request to the `/thumbnails/set` API endpoint. The operation can be performed on behalf of a content owner for delegated management of video assets.
|
|
1453
|
-
|
|
1460
|
+
|
|
1454
1461
|
Args:
|
|
1455
1462
|
onBehalfOfContentOwner: Optional; str. The YouTube content owner ID on whose behalf the request is being made.
|
|
1456
1463
|
videoId: Optional; str. The ID of the video for which the thumbnails are being set.
|
|
1457
|
-
|
|
1464
|
+
|
|
1458
1465
|
Returns:
|
|
1459
1466
|
dict. The response from the YouTube API as a JSON object, containing details of the updated video thumbnail.
|
|
1460
|
-
|
|
1467
|
+
|
|
1461
1468
|
Raises:
|
|
1462
1469
|
HTTPError: Raised if the HTTP request returns an unsuccessful status code.
|
|
1463
|
-
|
|
1470
|
+
|
|
1464
1471
|
Tags:
|
|
1465
1472
|
thumbnail, youtube-api, video-management, async-job
|
|
1466
1473
|
"""
|
|
@@ -1480,17 +1487,17 @@ class YoutubeApp(APIApplication):
|
|
|
1480
1487
|
def get_video_abuse_report_reasons(self, hl=None, part=None) -> Any:
|
|
1481
1488
|
"""
|
|
1482
1489
|
Retrieves a list of valid reasons (e.g., spam, hate speech) for reporting abusive video content. Supports response localization using a language code (`hl`) and allows filtering which parts of the reason resource (e.g., ID, snippet) are returned, providing metadata before submitting a report.
|
|
1483
|
-
|
|
1490
|
+
|
|
1484
1491
|
Args:
|
|
1485
1492
|
hl: Optional BCP-47 language code for localizing the response (e.g., 'en' or 'fr').
|
|
1486
1493
|
part: Optional parameter specifying which parts of the abuse report reasons to include in the response (e.g., 'id' or 'snippet').
|
|
1487
|
-
|
|
1494
|
+
|
|
1488
1495
|
Returns:
|
|
1489
1496
|
A JSON object containing the list of video abuse report reasons, or filtered parts if specified.
|
|
1490
|
-
|
|
1497
|
+
|
|
1491
1498
|
Raises:
|
|
1492
1499
|
requests.RequestException: Raised if there is a problem with the HTTP request (e.g., network issues or invalid response).
|
|
1493
|
-
|
|
1500
|
+
|
|
1494
1501
|
Tags:
|
|
1495
1502
|
fetch, management, abuse-report, video-content
|
|
1496
1503
|
"""
|
|
@@ -1503,19 +1510,19 @@ class YoutubeApp(APIApplication):
|
|
|
1503
1510
|
def get_video_categories(self, hl=None, id=None, part=None, regionCode=None) -> Any:
|
|
1504
1511
|
"""
|
|
1505
1512
|
Retrieves official YouTube video categories used for classifying uploaded videos, allowing filtering by ID, region, or language. This is distinct from `get_guecategories`, which fetches channel browsing guides, not categories for individual video uploads.
|
|
1506
|
-
|
|
1513
|
+
|
|
1507
1514
|
Args:
|
|
1508
1515
|
hl: Optional; the language code (e.g., 'en') for localized video category names
|
|
1509
1516
|
id: Optional; comma-separated list of video category IDs to filter results
|
|
1510
1517
|
part: Optional; list of properties (e.g., 'snippet') to include in the response
|
|
1511
1518
|
regionCode: Optional; ISO 3166-1 alpha-2 country code to filter region-specific categories
|
|
1512
|
-
|
|
1519
|
+
|
|
1513
1520
|
Returns:
|
|
1514
1521
|
Dictionary containing parsed JSON response with video category details
|
|
1515
|
-
|
|
1522
|
+
|
|
1516
1523
|
Raises:
|
|
1517
1524
|
requests.HTTPError: Raised when the API request fails with a non-success status code
|
|
1518
|
-
|
|
1525
|
+
|
|
1519
1526
|
Tags:
|
|
1520
1527
|
fetch, video-categories, api-request, json-response
|
|
1521
1528
|
"""
|
|
@@ -1537,17 +1544,17 @@ class YoutubeApp(APIApplication):
|
|
|
1537
1544
|
def delete_group_items(self, id=None, onBehalfOfContentOwner=None) -> Any:
|
|
1538
1545
|
"""
|
|
1539
1546
|
Deletes specified items from a YouTube Analytics group via an API request. An item can be targeted by its unique ID, and the action can be performed on behalf of a content owner. This function is distinct from `delete_groups`, which removes the entire group.
|
|
1540
|
-
|
|
1547
|
+
|
|
1541
1548
|
Args:
|
|
1542
1549
|
id: Optional; A string that identifies the group item to be deleted. If not provided, all group items may be affected depending on other parameters.
|
|
1543
1550
|
onBehalfOfContentOwner: Optional; A string representing the content owner on whose behalf the request is being made.
|
|
1544
|
-
|
|
1551
|
+
|
|
1545
1552
|
Returns:
|
|
1546
1553
|
A JSON object containing the response from the deletion request.
|
|
1547
|
-
|
|
1554
|
+
|
|
1548
1555
|
Raises:
|
|
1549
1556
|
HTTPError: Raised if the HTTP request returns an unsuccessful status code.
|
|
1550
|
-
|
|
1557
|
+
|
|
1551
1558
|
Tags:
|
|
1552
1559
|
delete, groupitems, management
|
|
1553
1560
|
"""
|
|
@@ -1564,17 +1571,17 @@ class YoutubeApp(APIApplication):
|
|
|
1564
1571
|
def delete_groups(self, id=None, onBehalfOfContentOwner=None) -> Any:
|
|
1565
1572
|
"""
|
|
1566
1573
|
Deletes a YouTube group by its ID via an API request, optionally on behalf of a content owner. Unlike `delete_groupitems`, which only removes an item from a group, this function deletes the entire group entity.
|
|
1567
|
-
|
|
1574
|
+
|
|
1568
1575
|
Args:
|
|
1569
1576
|
id: Optional unique identifier for the group to delete. If None, no specific group targeted.
|
|
1570
1577
|
onBehalfOfContentOwner: Optional content owner ID for delegated authorization.
|
|
1571
|
-
|
|
1578
|
+
|
|
1572
1579
|
Returns:
|
|
1573
1580
|
JSON-decoded response indicating operation success/failure.
|
|
1574
|
-
|
|
1581
|
+
|
|
1575
1582
|
Raises:
|
|
1576
1583
|
requests.exceptions.HTTPError: Raised for invalid requests, authentication failures, or server errors during deletion.
|
|
1577
|
-
|
|
1584
|
+
|
|
1578
1585
|
Tags:
|
|
1579
1586
|
delete, management, async_job, api
|
|
1580
1587
|
"""
|
|
@@ -1603,7 +1610,7 @@ class YoutubeApp(APIApplication):
|
|
|
1603
1610
|
) -> Any:
|
|
1604
1611
|
"""
|
|
1605
1612
|
Queries the YouTube Analytics API for performance reports, allowing customization via metrics, dimensions, and filters. Unlike `get_jobs_job_reports` which manages bulk report jobs, this function fetches analytical data directly, providing on-demand insights into channel or content performance.
|
|
1606
|
-
|
|
1613
|
+
|
|
1607
1614
|
Args:
|
|
1608
1615
|
currency: Optional; specifies the currency format for monetary values in the report
|
|
1609
1616
|
dimensions: Optional; list of dimensions (e.g., 'country', 'device') to include in report breakdowns
|
|
@@ -1615,13 +1622,13 @@ class YoutubeApp(APIApplication):
|
|
|
1615
1622
|
metrics: Optional; list of measurable values to include (e.g., 'clicks', 'conversions')
|
|
1616
1623
|
sort: Optional; criteria for sorting results (e.g., '-clicks' for descending order)
|
|
1617
1624
|
start: Optional; start date (YYYY-MM-DD format) for the report data range
|
|
1618
|
-
|
|
1625
|
+
|
|
1619
1626
|
Returns:
|
|
1620
1627
|
Report data as parsed JSON from the API response
|
|
1621
|
-
|
|
1628
|
+
|
|
1622
1629
|
Raises:
|
|
1623
1630
|
requests.exceptions.HTTPError: Raised when the API request fails due to invalid parameters, authentication issues, or server errors
|
|
1624
|
-
|
|
1631
|
+
|
|
1625
1632
|
Tags:
|
|
1626
1633
|
fetch, report, api, filter, sort, metrics, management
|
|
1627
1634
|
"""
|