当我使用 Python 程序将视频上传到 YouTube 时出现问题。在发生这种情况之前,我有很多天没有使用它来上传,所以它不应该超过配额。我试了很多次,它有同样的错误。
以下是错误:
[RequestError] 服务器响应:
{
"error": {
"code": 403,
"message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
"errors": [
{
"message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
"domain": "youtube.quota",
"reason": "quotaExceeded",
"debugInfo": "Code: 8; Description: ?metric=youtube.googleapis.com/default&limit=defaultPerDayPerProject&qs_error_code=INSUFFICIENT_TOKENS"
}
]
}
}
Run Code Online (Sandbox Code Playgroud) 我正在构建一个嵌入 YouTube 视频的 Android 应用程序。我对 YouTube Data API v3 的计费方式感到困惑。是否取决于 API 是从 GCP 服务器还是 AWS 服务器调用?
当我iframe
使用 YouTube 嵌入式视频 JavaScript API 在 Chrome 浏览器中运行嵌入式 YouTube 视频时,控制台中出现以下错误:
www-widgetapi.js:581 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://symfony.XXXXXX.com')
.
我提供的网页包含iframe
who 的src
属性设置为 YouTube 视频的 URL 以及 URL 搜索参数中的几个设置,包括origin
设置为我的网页 URL的参数。这是iframe
:
"<iframe width="480" height="390" frameborder="0"
src="https://www.youtube.com/embed/rs50Ie1dHXg?autohide=1&autoplay=1&cc_load_policy=0&controls=0&disablekb=1&enablejsapi=1&fs=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0&start=0&widgetid=1&origin=https://symfony.XXXXXX.com"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"></iframe>"
Run Code Online (Sandbox Code Playgroud)
在执行以下语句后,我已针对 YouTube 对象内容验证了上述内容,并且 YouTube API 对象正确具有上述值。以下是我用来创建 YouTube API 对象的语句:
const IFRAME = document.querySelector( 'iframe#YouTube-Player.YouTube-iframe' );
const $IFRAME = $( …
Run Code Online (Sandbox Code Playgroud) 我希望在嵌入的 YouTube 视频暂停时不显示“更多视频”叠加层。
我看过类似这个或这个的其他帖子,但没有人提到这样一个事实:Edpuzzle(例如https://edpuzzle.com/media/5e96205457b2f23efd7e8903)和可汗学院能够阻止“更多视频”(ytp -暂停覆盖)从显示。
YouTube 对于教育网站有什么例外吗?
我有一个 Google Apps 脚本,它已经运行了一段时间,没有出现错误。
它从我的 RSS 提供商获取新的 RSS 提要项目,从 YoutTbe 获取有关视频的一些基本信息,然后根据该信息将视频添加到某个播放列表。
从几天前开始,虽然其余播放列表工作正常,但将任何视频添加到 WL(稍后观看)播放列表会导致以下错误:
GoogleJsonResponseException:对 youtube.playlistItems.insert 的 API 调用失败并出现错误:API 不支持将视频插入指定播放列表的功能。
这是我发送的请求(同样,为我创建的另外两个播放列表工作):
{
snippet: {
playlistId: 'WL',
resourceId: {
videoId: '<videoId>',
kind: 'youtube#video'
}
}
}
Run Code Online (Sandbox Code Playgroud)
它的使用方式如下:
YouTube.PlaylistItems.insert(resource, "snippet");
Run Code Online (Sandbox Code Playgroud)
此外,我确实在脚本的开头记录了 WL 播放列表的内容,并且播放列表项目以空列表的形式返回(尽管该列表中有视频)。据我所知,这两个问题是同时开始的。
你可能知道OBS studio这个软件:只要知道直播密钥,它就可以将直播发送到YouTube。
我猜想它正在使用某种 YouTube API 来做到这一点。如果是这样的话,那个 API 是什么?我可以将其与 Node.js 一起使用吗?
我每天尝试从我的服务器上传视频到我的帐户,但浏览器无法访问。我可以在我的桌面上执行此操作,通过运行下面提到的脚本打开浏览器,请求我的权限并完成上传视频所需的完整授权,然后上传视频。
python upload_video.py --file clips/concatenated.mp4 --title testing --desc empty_dec
/Users/devansh.dalal/Desktop/hackathon/tiktoki/venv/lib/python3.7/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access upload_video.py-oauth2.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?client_id=73183172161-48495o1tqgjgih3v7j218av2bghdcm30.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.upload&access_type=offline&response_type=code
If your browser is on a different machine then exit and re-run this
application with the command-line parameter
--noauth_local_webserver
Authentication successful.
Uploading file...
Run Code Online (Sandbox Code Playgroud)
但我想要一个不需要手动授权脚本的解决方案,因为我的服务器是完全安全的。请提出建议?
oauth-2.0 youtube-data-api google-cloud-platform video-upload
我需要通过 API 找出频道上订阅者的确切数量。
该频道不在我的帐户上,但我有权观看。我需要 上显示的确切金额studio.youtube.com
。
我用:
https://www.googleapis.com/youtube/v3/channels?part=statistics,snippet&mine=true&access_token=[your_access_token]
。
但它只显示个人帐户,如果你替换mine
为managedByMe
,我会看到一个错误:
我刚开始使用 YouTube API v3 和 StacOverflow,对于任何错误,我深表歉意。
现在我无法理解该forUsername
参数。对于某些频道,例如YouTube或H2ODelerious,我能够找到正确的频道。当涉及到使用诸如leagueoflegends或playoverwatch之类的频道时(这两个频道都是在编写表单 URL 时的频道名称https://www.youtube.com/c/...
),我找不到正确的频道,也没有找到任何频道,也没有找到没有频道的频道。浏览量或订阅者。
这是我的代码:
channelStats = testConnection.channels().list(
part ='statistics',
forUsername ='Youtube'
)
response = channelStats.execute()
Run Code Online (Sandbox Code Playgroud)
如果有人知道在使用该方法时是否有其他方法可以正确识别正确的通道Channels.list
,请告诉我。(我通过 Google 的 Python 和 Python 3.8 客户端库使用 YouTube Data API v3。)
我有一个在 Raspberry Pi 上运行的 Python 应用程序,它开始向我管理的 YouTube 频道进行直播。这是我用来验证的代码:
import google_auth_oauthlib.flow
import googleapiclient.discovery
import googleapiclient.errors
import google.auth.transport.requests
import google.oauth2.credentials
import requests
CLIENT_SECRETS_FILE = "client_secrets.json"
YOUTUBE_READ_WRITE_SCOPE = "https://www.googleapis.com/auth/youtube"
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
def get_authenticated_service(args):
credentials = None
credentials_json_file = "youtube-%s.json" % slugify(args.oauth2_name)
if os.path.exists(credentials_json_file):
# load credentials from file
with open(credentials_json_file, encoding='utf-8') as f:
credentials_json = json.load(f)
credentials = google.oauth2.credentials.Credentials.from_authorized_user_info(credentials_json)
if not credentials or not credentials.valid:
# no credentials file or invalid credentials
if credentials and credentials.expired and credentials.refresh_token:
# …
Run Code Online (Sandbox Code Playgroud) youtube-api ×7
javascript ×3
youtube ×3
node.js ×2
google-api ×1
google-oauth ×1
oauth-2.0 ×1
python ×1
python-3.x ×1
quota ×1
video ×1
video-upload ×1