如何采集51cto视频的真实下载地址?

2014-02-07 13:46:23 +08:00
 pc10201
比如这个视频
http://edu.51cto.com/static/js/51player.swf?id=16836&autoplay=1&callbackJs=SyPlayerStatus

浏览器器会发一个请求
http://edu.51cto.com/index.php?do=api&m=index&lesson_id=16836&sign=1c1a46c7b63a403c15c9d94bd610b887

sign后面的值应该是swf文件生成的,返回的数据包如下

{"lesson_title":"\u5229\u7528python socketServer\u591a\u7ebf\u7a0b\u5f00\u53d1FTP\u8f6f\u4ef6","lesson_duration":"3493","video_url":"aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8wLm1wND9LRVkxPTdkZTVhOWY2YWI4ZjQ0NzBlOGZkMGE3YjY3MmU0NTBhJktFWTI9NTJmNDY5MDF8aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8xLm1wND9LRVkxPTYzNTgzOWIxMGRhZTg5Y2QxOGRjM2E4NjM0ZjJhNTgxJktFWTI9NTJmNDY5MDF8aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8yLm1wND9LRVkxPWRmNWY0MWVmYmFhNjA4YjhiZTZmNzc3MjZlMWU2MDhmJktFWTI9NTJmNDY5MDF8aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8zLm1wND9LRVkxPTUxMWQ1M2M1MzU5MTk4OTZmZTI3Y2U1MGNiNGNjYWJkJktFWTI9NTJmNDY5MDF8aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml80Lm1wND9LRVkxPWViZDY0MzJjYTA1Y2MyMzRhZDEyYTYzODM3ZWJjNz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0P0tFWTE9Mjk1YjIxOTgyYzEyZDYzNDlhZTg3Mjk4MGRkNGUwOTQmS0VZMj01MmY0NjkwMQ==","uid":8343567,"htime":"2580","utime":1391748703,"stime":1391749377,"infotip":"\u6b22\u8fce\u89c2\u770b51CTO\u5b66\u9662\u8bfe\u7a0b\uff01","heartInterval":30000}

video_url用base64解码即可
http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_0.mp4?KEY1=7de5a9f6ab8f4470e8fd0a7b672e450a&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_1.mp4?KEY1=635839b10dae89cd18dc3a8634f2a581&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_2.mp4?KEY1=df5f41efbaa608b8be6f77726e1e608f&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_3.mp4?KEY1=511d53c535919896fe27ce50cb4ccabd&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_4.mp4?KEY1=ebd6432ca05cc234ad12a63837ebc739&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_5.mp4?KEY1=ab63225320f0a7f34e2dc928555c3440&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_6.mp4?KEY1=ea30874625be9e211a0c40fb43990649&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_7.mp4?KEY1=ed8b31b51ed19d5ca615eeb7952e1988&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_8.mp4?KEY1=11c9b0e78d315780c7595da47073c6d6&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_9.mp4?KEY1=f1048f87866b2072e80225418b55e385&KEY2=52f46901|http://video.51cto.com/2013-12/11/14736/yavc_52a80fe1d7c52_10.mp4

假如我想批量获取下载地址,那个sign值怎么解,一个一个抓包太累了
14792 次点击
所在节点    Python
6 条回复
alexwang
2014-02-07 13:50:10 +08:00
我也非常想知道。希望牛人解答
pc10201
2014-02-07 14:58:06 +08:00
@alexwang 我大概知道怎么做了,开wireshark和selenium,然后提取数据就可以了,理论上是这样的,正在写脚本~
Draycen
2014-02-08 10:16:25 +08:00
关注
alexwang
2014-02-08 16:59:58 +08:00
@pc10201 若有最新成果,分享一下,THANKS
zstarvkey
2014-07-05 20:15:05 +08:00
不知道你现在解决没,十分想知道方法。sign值怎么弄。
pc10201
2014-07-06 16:40:43 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/99215

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX