如何使用java在youtube上检索我的所有订阅频道

时间:2016-07-31 14:33:27

标签: java youtube-api youtube-data-api

我正在使用youtube api v3开展项目,我希望获得名称之类的订阅; ID ;等等......我正在使用java,当我试图修改样本时附带的代码addsubscription.java我得到错误plz帮助我:(

---------------- code ------------- https://developers.google.com/youtube/v3/docs/subscriptions/insert

我添加了什么

YouTube.Subscriptions.List gt = youtube.subscriptions()。list(" id,mine = true"); SubscriptionListResponse get = gt.execute(); - - - - - - - - - - - - -错误 - - - - - - - - - - - -

"消息" :"未选择过滤器。预期之一:channelId,mySubscribers,id,myRecentSubscribers,mine"

1 个答案:

答案 0 :(得分:0)

您需要将true参数设置为channelId,如this API explorer example所示,以获取您自己的订阅,或设置""" Example demonstrating turning lines on and off - with JS only """ import numpy as np from bokeh.io import output_file, show from bokeh.layouts import row from bokeh.palettes import Viridis3 from bokeh.plotting import figure from bokeh.models import CheckboxGroup, CustomJS output_file("line_on_off.html", title="line_on_off.py example") code = """ if (0 in checkbox.active) { l0.visible = true } else { l0.visible = false } if (1 in checkbox.active) { l1.visible = true } else { l1.visible = false } if (2 in checkbox.active) { l2.visible = true } else { l2.visible = false } """ p = figure() props = dict(line_width=4, line_alpha=0.7) x = np.linspace(0, 4 * np.pi, 100) l0 = p.line(x, np.sin(x), color=Viridis3[0], legend="Line 0", **props) l1 = p.line(x, 4 * np.cos(x), color=Viridis3[1], legend="Line 1", **props) l2 = p.line(x, np.tan(x), color=Viridis3[2], legend="Line 2", **props) callback = CustomJS(code=code, args={}) checkbox = CheckboxGroup(labels=["Line 0", "Line 1", "Line 2"], active=[0, 1, 2], callback=callback, width=100) callback.args = dict(l0=l0, l1=l1, l2=l2, checkbox=checkbox) layout = row(checkbox, p) show(layout) 参数以获取其他频道的订阅在this API explorer example中(您必须properly authorized才能执行此操作)