cURL 上传到 YouTube,不起作用(通过 curl.exe/DOS) - YT 服务器返回"来自服务器的空回复"



我尝试通过cURL上传一小部分flv到YouTube,但没有运气。

下面是trace的一部分:


==信息:即将连接()到gdata.youtube.com端口80 (#0)
==提示:尝试74.125.228.69…
==信息:已连接
==信息:连接到gdata.youtube.com(74.125.228.69)端口80 (#0)
=>发送报头,658字节(0x292)
0000: POST/action/GetUploadToken HTTP/1.1
0026: User-Agent: curl/7.28.1
003f:接受:/
004c:主机:uploads.gdata.youtube.com
006d: Authorization: Bearer=ACCESS-TOKEN
0190: GData-Version: 2
01a2: X-GData-Key: key=DEVELOPER-KEY
0217:弹头:test2。flv
0228:内容类型:multipart/related;边界= " a1b2c3d4e5f6g7h8i9 "
0268: font - family:宋体
027e: Connection:Close
0290:
=>发送数据,7832字节(0x1e98)
0000:
02:
2004:
2008:——a1b2c3d4e5f6g7h8i9
001c:
001e:
0020:
0022:内容类型:application/atom+xml;utf - 8字符集=
0055:
0057:
0059:
005 b:009 b: " xmlns:媒体= " http://search.yahoo.com/mrss/" xmlns:欧美="计画"
00 db: p://gdata.youtube.com/schemas/2007 ">011b: type ="plain">圣餐宣传片015b: pe="plain">EWTN电视节目《圣餐》宣传片019 b:>01 db:类别。猫"> EducationEucha
021b: ist, EWTN
024e:
0250:——a1b2c3d4e5f6g7h8i9
0266:
0268:内容类型:video/x-flv
0283:
0285: Content-Transfer-Encoding: binary
02a8:
02aa:
[02ac: .ftypmp42 . mp42mp41 . fmomov . lmvhd .8T. 8T..]^。
ec:……@
032 c : .'.轨道,轨道,轨道,轨道JP
[00:36] . .@ .@$edts .elst
[03:03]Jp…"媒体中心……"情况. . p . .D
03ec: hdlr Video Mainconcept MP4视频媒体处理程序

++++++++++++++++++ 更多的二进制代码在这里 ++++++++++++++

1: 12月. . .v .@ .. .. .. . f。 .v . . .y * T .. .. .. ..
1 e2c : ., .{ . 年代.G….d…r .{ .. .. . 2 .. .. .. ..
1e6c: .. ..


-- -


== Info: upload complete sent off: 7832 out of 7832 bytes
==信息:来自服务器的空回复
==信息:连接到主机gdata.youtube.com的0号连接完好无损
==信息:关闭连接#0

您尝试使用的基于浏览器的上传流程实际上不适合从命令行上传。

直接上传流程更合适。

更好的是,尝试使用支持的客户端库之一,避免在cURL中手工执行此操作(除非您真的想要)。

最新更新