نحن بصدد تعديل Data API لتتطابق مع طريقة YouTube في احتساب مشاهدات Shorts.
مزيد من المعلومات
PlaylistImages: insert
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
لإضافة صورة إلى قائمة تشغيل
تتيح هذه الطريقة تحميل الوسائط. يجب أن تتوافق الملفات التي يتم تحميلها مع هذه القيود:
- الحد الأقصى لحجم الملف: 2 ميغابايت
- نسبة العرض إلى الارتفاع المقبولة: 1:1 (مربّعة)
- أنواع MIME للوسائط المقبولة:
image/jpeg
وimage/png
تأثير الحصة: تبلغ تكلفة حصة الطلب الذي يتضمّن هذه الطريقة 50 وحدة.
الطلب
طلب HTTP
POST https://www.googleapis.com/youtube/v3/playlistImages
التفويض
يتطلب هذا الطلب تفويضًا باستخدام نطاق واحد على الأقل من النطاقات التالية (مزيد من المعلومات عن المصادقة والتفويض).
النطاق |
https://www.googleapis.com/auth/youtubepartner |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
المعلمات
يسرد الجدول التالي المَعلمات التي يتيحها هذا طلب البحث. وجميع المَعلمات المُدرجة هي مَعلمات طلب بحث.
المعلمات |
المَعلمات المطلوبة |
part |
string
تحدد المعلمة part
قائمة مفصولة بفواصل تضمّ مورد playlistImage واحدًا أو أكثر
الخصائص التي ستتضمنها استجابة واجهة برمجة التطبيقات.
إذا كانت المعلمة
إلى خاصية تحتوي على خصائص فرعية، والخصائص الفرعية
سيتم تضمينها في الرد.
|
المَعلمات الاختيارية |
onBehalfOfContentOwner |
string
لا يمكن استخدام هذه المَعلمة إلّا في طلب مفوَّض بشكل صحيح. ملاحظة: هذه المعلَمة مخصّصة حصريًا لشركاء المحتوى في YouTube.
تشير المَعلمة onBehalfOfContentOwner إلى أنّ بيانات اعتماد التفويض المتعلّقة بالطلب تحدّد هوية مستخدم نظام إدارة محتوى (CMS) في YouTube يتصرف بالنيابة عن مالك المحتوى المحدّد في قيمة المَعلمة. هذه المَعلمة مخصّصة لشركاء المحتوى في YouTube الذين يملكون العديد من القنوات المختلفة على YouTube ويديرونها. وهي تتيح لمالكي المحتوى إجراء مصادقة لمرة واحدة والوصول إلى جميع بيانات القناة والفيديوهات، بدون الحاجة إلى تقديم بيانات اعتماد مصادقة لكل قناة على حدة. يجب أن يكون حساب نظام إدارة المحتوى الذي يصادق عليه المستخدم مرتبطًا بحساب مالك محتوى YouTube المحدّد. |
onBehalfOfContentOwnerChannel |
string
لا يمكن استخدام هذه المَعلمة إلّا في طلب مفوَّض بشكل صحيح. ملاحظة: هذه المَعلمة مخصّصة حصريًا لشركاء المحتوى في YouTube.
مَعلمة onBehalfOfContentOwnerChannel
معرّف قناة YouTube التابعة للقناة التي يتم عرض الفيديو عليها
تمت إضافتها. تكون هذه المعلمة مطلوبة عندما يحدد طلب قيمة
معلَمة onBehalfOfContentOwner ، ولا يمكن استخدامها إلا في
بالاقتران مع هذه المعلمة. بالإضافة إلى ذلك، يجب أن يكون الطلب
أن يكون مخوّلاً لاستخدام حساب CMS مرتبط بمالك المحتوى
تُحدِّد المعلَمة onBehalfOfContentOwner . أخيرًا،
القناة التي تكون فيها قيمة المعلمة onBehalfOfContentOwnerChannel
يحدد ضرورة ربطه بمالك المحتوى الذي
تحدد المعلمة onBehalfOfContentOwner .
هذا
مخصصة لشركاء محتوى YouTube الذين يملكون ويديرون العديد من
على قنوات YouTube المختلفة. يتيح لمالكي المحتوى المصادقة مرة واحدة
وتنفيذ إجراءات نيابةً عن القناة المحدّدة في المَعلمة
دون الحاجة إلى تقديم بيانات اعتماد مصادقة لكل
قناة منفصلة. |
نص الطلب
قدِّم موردًا لـplaylistImages في نص الطلب.
بالنسبة إلى هذا المورد:
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-08-16 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-08-16 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis API method adds an image to a playlist, supporting media uploads with a maximum file size of 2MB and a 1:1 aspect ratio, and only accepts \u003ccode\u003eimage/jpeg\u003c/code\u003e and \u003ccode\u003eimage/png\u003c/code\u003e MIME types.\u003c/p\u003e\n"],["\u003cp\u003eUsing this method requires authorization with scopes such as \u003ccode\u003ehttps://www.googleapis.com/auth/youtubepartner\u003c/code\u003e, \u003ccode\u003ehttps://www.googleapis.com/auth/youtube\u003c/code\u003e, or \u003ccode\u003ehttps://www.googleapis.com/auth/youtube.force-ssl\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epart\u003c/code\u003e parameter is required to specify the \u003ccode\u003eplaylistImage\u003c/code\u003e resource properties to be included in the API response.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eonBehalfOfContentOwner\u003c/code\u003e and \u003ccode\u003eonBehalfOfContentOwnerChannel\u003c/code\u003e parameters are available for YouTube content partners managing multiple channels to authenticate once and access data across all channels.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires a \u003ccode\u003eplaylistImages\u003c/code\u003e resource with \u003ccode\u003esnippet.playlistId\u003c/code\u003e and \u003ccode\u003esnippet.type\u003c/code\u003e, and it can include optional \u003ccode\u003esnippet.width\u003c/code\u003e and \u003ccode\u003esnippet.height\u003c/code\u003e properties.\u003c/p\u003e\n"]]],["To add an image to a playlist, send a POST request to `https://www.googleapis.com/youtube/v3/playlistImages`, ensuring authorization with appropriate scopes. Uploaded images must be square (1:1 aspect ratio), under 2MB, and be either JPEG or PNG. The request requires the `part` parameter, and the request body must include `snippet.playlistId` and `snippet.type`. Optional parameters include `onBehalfOfContentOwner` and `onBehalfOfContentOwnerChannel`. A successful call returns a `playlistImages` resource and has a quota cost of 50 units.\n"],null,["# PlaylistImages: insert\n\nAdds an image to a playlist.\n\nThis method supports media upload. Uploaded files must conform to these constraints:\n\n- **Maximum file size:** 2MB\n- **Accepted aspect ratio:** 1:1 (square)\n- **Accepted Media MIME types:** `image/jpeg`, `image/png`\n\n**Quota impact:** A call to this method has a [quota cost](/youtube/v3/getting-started#quota) of 50 units.\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/youtube/v3/playlistImages\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/youtube/v3/guides/authentication)).\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/youtubepartner` |\n| `https://www.googleapis.com/auth/youtube` |\n| `https://www.googleapis.com/auth/youtube.force-ssl` |\n\n### Parameters\n\nThe following table lists the parameters that this query supports. All of the parameters listed are query parameters.\n\n| Parameters ||\n|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| **Required parameters** |||\n| `part` | `string` The **part** parameter specifies a comma-separated list of one or more `playlistImage` resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. |\n| **Optional parameters** |||\n| `onBehalfOfContentOwner` | `string` This parameter can only be used in a properly [authorized request](/youtube/v3/guides/authentication). **Note:** This parameter is intended exclusively for YouTube content partners. The **onBehalfOfContentOwner** parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. |\n| `onBehalfOfContentOwnerChannel` | `string` This parameter can only be used in a properly [authorized request](/youtube/v3/guides/authentication). **Note:** This parameter is intended exclusively for YouTube content partners. \u003cbr /\u003e The **onBehalfOfContentOwnerChannel** parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the `onBehalfOfContentOwner` parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the `onBehalfOfContentOwner` parameter specifies. Finally, the channel that the `onBehalfOfContentOwnerChannel` parameter value specifies must be linked to the content owner that the `onBehalfOfContentOwner` parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. |\n\n### Request body\n\nProvide a [playlistImages resource](/youtube/v3/docs/playlistImages#resource) in the request body.\n\nFor that resource:\n\n- You must specify a value for these properties:\n\n - `snippet.playlistId`\n - `snippet.type`\n- You can set values for these properties:\n\n - `snippet.width`\n - `snippet.height`\n\nResponse\n--------\n\nIf successful, this method returns a [playlistImages resource](/youtube/v3/docs/playlistImages#resource) in the response body."]]