天道酬勤,学无止境

youtube-data-api

YouTube API v3 Java 授权(YouTube API v3 Java authorization)

问题 我正在使用 YouTube 数据 API (Java) 将视频上传到我的 YouTube 频道。 我已经在我的 Windows PC 上测试过它并成功了。 但是示例中的授权通过打开浏览器窗口登录谷歌来创建一个 Credential 实例。 这在我的 Windows PC 上很好,但我试图让这段代码在我只有 SSH 访问权限的远程 linux 机器上工作。 我在 stackoverflow 上搜索了类似的问题,并找到了完全相同的问题。 但由于该问题没有谷歌工程师需要的特定标签,我将其作为一个新问题发布。 Youtube API V3 Java 无需调用浏览器即可上传视频 如果您有任何想法可以提供帮助,我将不胜感激。 谢谢你。 回答1 我寻找方法来实现这一点并找到了它。 我按照 https://developers.google.com/identity/protocols/OAuth2ServiceAccount 上的说明进行操作 您需要一个新的 OAuth 客户端 ID,并在开发者控制台 - APIs & auth - Credentials 中将其设置为“服务帐户”,然后下载 P12 密钥。 您还需要在 Developers Console 中将服务帐户的权限更改为“是所有者”。 然后修改代码 Credential credential = Auth.authorize

2021-11-29 19:44:41    分类:技术分享    java   youtube-api   credentials   youtube-data-api

在 Json 中获取 youtube 趋势 v3 国家明智吗?(Get youtube trends v3 country wise in Json?)

问题 如何在 Json 中获取最流行或最受国家/地区观看次数最多的YouTube 趋势。 以前使用 youtube feeds v2。 似乎已弃用,https://gdata.youtube.com/feeds/api/standardfeeds/IN/most_popular?v=2 我可以获得 youtube api v3 或任何其他结果,例如趋势仪表板 https://www.youtube.com/trendsdashboard 回答1 根据 YouTube 指南,YouTube Feeds v2 现已弃用。 您应该使用 YouTube 数据 API v3。 对于最受欢迎的视频: https://www.googleapis.com/youtube/v3/videos?part=contentDetails&chart=mostPopular&regionCode=IN&maxResults=25&key=API_KEY 部分: 您可以包含在参数值中的部件名称有: id, snippet, contentDetails, fileDetails, liveStreamingDetails, localizations, player, processingDetails, recordingDetails, statistics, status, suggestions

2021-11-29 18:40:14    分类:技术分享    youtube-api   youtube-data-api

YouTube API v3 filtering embeddable videos

In YouTube API v3 documentation there are parameters like regionCode, videoEmbeddable, videoSyndicated. But it seems none of them are working properly. I want to exclude VEVO videos from my search results. So it should be possible with videoEmbeddable='true' parameter. But this parameter makes no difference to my search results. Using API v2 I could remove VEVO vidoes by adding the parameter format=5 but this parameter is not available in v3. Does anyone know how to do this using v3?

2021-11-29 00:27:12    分类:问答    api   youtube   youtube-api   youtube-data-api

无法向 http://www.youtube.com 发布消息。 收件人有来源 https://www.youtube.com(Unable to post message to http://www.youtube.com. Recipient has origin https://www.youtube.com)

问题 我在 http://beta.billboard.fm 上的应用程序在播放一首歌曲后在我的正常浏览会话中产生错误。 如果我以隐身模式重新加载页面,该应用程序将完全正常工作。 我最近才开始遇到这些问题。 我已完成清除所有缓存并再次运行,但只是在抛出相同错误之前暂时运行。 此外,我已禁用所有浏览器扩展。 但是,无论我做什么,我都无法从 Youtube API 抛出这个错误: 无法向 http://www.youtube.com 发布消息。 收件人有来源 https://www.youtube.com 看起来安全协议不匹配。 我尝试将它们更改为 https 或只是删除“http:”在我身边。 但这并没有解决问题。 任何人都知道这里发生了什么? 回答1 在这一点上,我很清楚这是 Google/YouTube 的 API 中的一个主要错误。 他们在某处写了一些糟糕的代码。 这个错误不是一致的。 这是有据可查的事实,即每个人的代码在很长一段时间内都可以正常工作,然后他们发现他们的站点突然停止正常工作。 此外,我上周遇到这个问题的所有网站现在都可以正常工作了——同样,我也没有更改代码。 因此,虽然这样说很糟糕 - 谷歌和 YouTube 有责任解决这个问题并提供真正像广告一样工作的 API......在我看来,我们自己无法做任何事情:( 回答2 我遇到了同样的问题 - 我也尝试将链接更改为

2021-11-27 11:32:24    分类:技术分享    javascript   youtube   youtube-api   youtube-javascript-api   youtube-data-api

Why is the YouTube API v3 inconsistent with the amount of comments it lets you download before an error 400?

I am downloading YouTube comments with a python script that uses API keys and the YouTube Data API V3, but sooner or later I run into the following error: {'error': {'code': 400, 'message': "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the request's input is invalid. Check the structure of the commentThread resource in the request body to ensure that it is valid.", 'errors': [{'message': "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the

2021-11-27 05:07:17    分类:问答    python-requests   youtube-api   youtube-data-api

Upload thumbnail to Youtube API using curl

I'm using curl with YouTube API v3 to create a broadcast, modify video title, etc without any issues. My problem is when I try to add a thumbnail to a video using the docs from Google. Here is my sample with the keys changed for security reasons: curl --request POST -v \ "https://youtube.googleapis.com/youtube/v3/thumbnails/set\ ?videoId=RoZypUhZY04\ &uploadType=media\ &key=mykey" \ --header 'Authorization: Bearer my_access_token' \ --header 'Content-Type: image/jpeg'\ -F 'file=@/Users/adviner/Projects/Prototypes/VendorAPI/source/YouTube/YouTube-BOS.jpg'\ -F 'filename=YouTube-BOS.jpg' I have

2021-11-27 04:57:22    分类:问答    curl   youtube-api   youtube-data-api

Get view count using Google Youtube API

I want to get the view count of set of videos. Following is the relevant part of my code. SearchResult singleVideo = iteratorSearchResults.next(); ResourceId rId = singleVideo.getId(); // Double checks the kind is video. if (rId.getKind().equals("youtube#video")) { Thumbnail thumbnail = singleVideo.getSnippet().getThumbnails().get("default"); System.out.println(" Video Id" + rId.getVideoId()); System.out.println(" Title: " + singleVideo.getSnippet().getTitle()); System.out.println(" Thumbnail: " + thumbnail.getUrl()); YouTube.Videos.List list = youtube.videos().list("statistics"); list.setId

2021-11-26 15:45:31    分类:问答    youtube   youtube-data-api   google-api-java-client

Order doesn't work when using youtube API v3

I am trying to get the last 10 videos of a channel. When I run the following code: from apiclient.discovery import build API_SERVICE_NAME = "youtube" API_VERSION = "v3" def youtubeTest(): KEY = "my key here" service = build(API_SERVICE_NAME, API_VERSION , developerKey=KEY) args = {} args['part']='snippet' args['maxResults']='10' args['channelId']='UCq-Fj5jknLsUf-MWSy4_brA' args['order']='date' args['type']='video' results = service.search().list(**args).execute() items = results['items'] for item in items: print item['snippet']['publishedAt'] youtubeTest() This is the result I am getting 2018

2021-11-26 08:30:33    分类:问答    python   youtube-api   youtube-data-api

YouTube API UnicodeEncodeError in Python 3.4

I was exploring the YouTube Data API and finding that improperly encoded results were holding me back. I got good results until I retrieve a set that includes unmapped characters in the titles. My code is NOW (cleaned up a little for you fine folks): import urllib.request import urllib.parse import json import datetime # Look for videos published up to THIS MANY hours ago IntHoursToSub = 2 RightNow = datetime.datetime.utcnow() StartedAgo = datetime.timedelta(hours=-(IntHoursToSub)) HourAgo = RightNow + StartedAgo HourAgo = str(HourAgo).replace(" ", "T") HourAgo = HourAgo[:HourAgo.find(".")] +

2021-11-25 16:12:39    分类:问答    python   youtube-api   youtube-data-api

Finding premieres through Youtube API

Premieres are a mix between a live stream and a traditional YouTube video. Detailed description: https://wersm.com/youtube-makes-premieres-available-to-everyone/ Is there any way for finding premieres of a channel through Youtube API?, is there any playlist, similar to autogenerated playlists of live broadcasts (https://www.youtube.com/channel/UC4R8DWoMoI7CAwX8_LjQHig), only with premieres? YouTube search:list end-point (https://developers.google.com/youtube/v3/docs/search/list) doesn't include a event type filter for this kind of video. Only includes "upcoming" and "live" event filters, but

2021-11-25 04:18:46    分类:问答    youtube-api   youtube-data-api