获取YouTube Analytics的确切时间:estimatedMinutesWatched(Getting exact time with YouTube Analytics: estimatedMinutesWatched)
我正在尝试将YouTube Analytics客户端用于个人用途,以防止我手动记录所有内容。 我可能最终会用C#编写它,但这并不一定重要。
我注意到的是YouTube上的Google Analytics页面将
estimatedMinutesWatched
参数向下estimatedMinutesWatched
到只有一个精度元素(即如果超过1小时,则会丢失秒级精度)。 我的问题是,是否有任何方法可以从Analytics API中检索确切的时间量(hh :: mm :: ss等)。I'm attempting to brew a YouTube Analytics client for personal use to prevent me from having to log everything manually. I'll probably end up writing it in C#, but that isn't necessarily important.
The thing that I notice is the Analytics page on YouTube rounds down the
estimatedMinutesWatched
parameter to only one element of precision (i.e. if over 1 hour, you lose seconds-level precision). My question is if there is any way of retrieving the exact amount of time (hh::mm::ss, etc.) from the Analytics API.
原文:https://stackoverflow.com/questions/27007680
最满意答案
我认为这有点模棱两可,因为grails从控制器的allowedMethods闭包中获得405s。
由于没有映射到DELETE for rest /,框架返回404,这似乎是正确的。
文档似乎希望你做类似的事情
delete(Long id) { if(!id){ response.sendError 405 } else { ... } }
http://grails.org/doc/latest/ref/Controllers/allowedMethods.html
如果您认为这种行为不正确,可能值得提高JIRA。 从grails-core中的测试来看,它似乎根本不涉及405s。
I think it's a bit ambiguos since grails gets the 405s from the allowedMethods closure of the controller.
Since there is no mapping to DELETE for rest/, the framework is returning a 404, which seems to be correct.
The documentation seems to want you to do something like
delete(Long id) { if(!id){ response.sendError 405 } else { ... } }
http://grails.org/doc/latest/ref/Controllers/allowedMethods.html
Might be worth raising a JIRA if you don't think this behaviour is correct. From the tests in grails-core, it doesn't seem to be dealing with 405s at all.
相关问答
更多-
问题是你有一个与你的路线匹配的物理目录( /api/invitations )。 因为存在这样的物理目录,IIS本机DirectoryListingModule和DefaultDocumentModule模块(不允许POST动词)在TransferRequestHandler (由MVC和WebAPI使用)能够处理它之前接管请求。 没有理由将InvitationsController.cs放在与请求的路由匹配的相同目录结构中。 这就是我们首先进行路由的原因,无论控制器的物理位置如何,都能够动态注册路由。 通 ...
-
使用Django REST Framework进行身份验证返回405(Authenticating with Django REST Framework returns 405)[2023-12-24]
curl响应与AJAX响应相同。 curl响应返回301状态代码而不是405,因为您使用了不同的URL(没有尾部斜杠)。 问题是你只能POST到/api-token-auth/ URL,没有实现GET方法。 正如Django REST框架API令牌认证文档所说,用例是这样的: 您必须将username和password POST到/api-token-auth/ - 以获取身份验证令牌。 要访问需要身份验证的URL,您必须在Authorization HTTP标头中包含该标记。 这意味着您必须测试令牌身份验 ... -
您需要使用另一个名为System.Web.Http.HttpGetAttribute属性来修饰搜索操作。 基于这个原因,您可以在下面的帖子中查看我的答案: 405使用AttributeRouting.PUTAttribute时除非我还包含HttpPutAttribute You would need to decorate the Search action with one more attribute called System.Web.Http.HttpGetAttribute. For the re ...
-
对于同一控制器上的不同URL,UrlMappings不返回405(UrlMappings not returning 405 for different URLs on same controller)[2022-06-30]
我认为这有点模棱两可,因为grails从控制器的allowedMethods闭包中获得405s。 由于没有映射到DELETE for rest /,框架返回404,这似乎是正确的。 文档似乎希望你做类似的事情 delete(Long id) { if(!id){ response.sendError 405 } else { ... } } http://grails.org/doc/latest/ref/Controllers/allowedMethods.html 如果您认 ... -
泽西队在PUT上回归405(Jersey Returning a 405 on a PUT)[2021-12-16]
在我看来,Jersey(2.19)在运行你的路由示例时有一个错误。 我试过这个控制器模仿你的例子: @Path("/hash") public class HashController { @PUT @Produces("text/plain") @Path("{path: .+}") public String m1(@PathParam("path") String path) { return "m1 called with path " + path; ... -
我通过迭代控制器artefacts并动态构建url映射来实现这一点: class UrlMappings { static mappings = { def adminControllers = ACH.grailsApplication.controllerClasses .findAll({ it.logicalPropertyName.endsWith('Admin')}) .collect({ it.logicalPropertyName }) ...
-
让我们分析你正在呼叫的端点。 第一个URI: https://localhost:44300/api/accountapi/emailexists?email=info@something.com 查看路由配置,这将仅匹配api/{controller}/{id}路由模板。 这是因为第一个约定路由配置只匹配以api/MyArea开头的URI部分,而控制器的属性路由前缀只匹配以myarea/api/accountapi开头的路径。 这将转换为以下路径属性: {controller} : accountapi ...
-
这与内容协商有关,您可以在Grails用户指南的第6.8节中阅读。 如果Grails将扩展名识别为特定类型,则会从URL中删除扩展名,并将类型添加到“format”参数中。 您可以通过将此条目添加到grails-app/conf/Config.groovy来禁用此行为: grails.mime.file.extensions = false This is related to content negotiation, which you can read about in section 6.8 of ...
-
要做到这一点,您首先需要知道Grails在底层使用Spring Web。 Spring Web是我能想到的最复杂的Web框架(能够做AFAIK)。 无论如何,重要的是要知道Spring Web的请求生命周期是如何工作的。 您可以通过阅读Spring Web中的主要Servlet“DispatcherServlet”的文档(以及Grails中的文档)来了解它: http : //docs.spring.io/spring/docs/current/javadoc-api /org/springframewor ...
-
你应该做 "/"(controller: 'home', action: 'home') You should do "/"(controller: 'home', action: 'home')