V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
pc10201
V2EX  ›  Python

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

  •  
  •   pc10201 · 2014-02-07 13:46:23 +08:00 · 14824 次点击
    这是一个创建于 3977 天前的主题,其中的信息可能已经有所发展或是发生改变。
    比如这个视频
    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":"aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8wLm1wND9LRVkxPTdkZTVhOWY2YWI4ZjQ0NzBlOGZkMGE3YjY3MmU0NTBhJktFWTI9NTJmNDY5MDF8aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8xLm1wND9LRVkxPTYzNTgzOWIxMGRhZTg5Y2QxOGRjM2E4NjM0ZjJhNTgxJktFWTI9NTJmNDY5MDF8aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8yLm1wND9LRVkxPWRmNWY0MWVmYmFhN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NTJhODBmZTFkN2M1Ml85Lm1wND9LRVkxPWYxMDQ4Zjg3ODY2YjIwNzJlODAyMjU0MThiNTVlMzg1JktFWTI9NTJmNDY5MDF8aHR0cDovL3ZpZGVvLjUxY3RvLmNvbS8yMDEzLTEyLzExLzE0NzM2L3lhdmNfNTJhODBmZTFkN2M1Ml8xMC5tcDQ\/S0VZMT05ZTgyMDI3ZjBlZGNmZmNiZjg0YWEzZWYwNTMwMmZlYyZLRVkyPTUyZjQ2OTAxfGh0dHA6Ly92aWRlby41MWN0by5jb20vMjAxMy0xMi8xMS8xNDczNi95YXZjXzUyYTgwZmUxZDdjNTJfMTEubXA0P0tFWTE9Mjk1YjIxOTgyYzEyZDYzNDlhZTg3Mjk4MGRkNGUwOTQmS0VZMj01MmY0NjkwMQ==","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值怎么解,一个一个抓包太累了
    6 条回复    2014-07-06 16:40:43 +08:00
    alexwang
        1
    alexwang  
       2014-02-07 13:50:10 +08:00
    我也非常想知道。希望牛人解答
    pc10201
        2
    pc10201  
    OP
       2014-02-07 14:58:06 +08:00
    @alexwang 我大概知道怎么做了,开wireshark和selenium,然后提取数据就可以了,理论上是这样的,正在写脚本~
    Draycen
        3
    Draycen  
       2014-02-08 10:16:25 +08:00
    关注
    alexwang
        4
    alexwang  
       2014-02-08 16:59:58 +08:00
    @pc10201 若有最新成果,分享一下,THANKS
    zstarvkey
        5
    zstarvkey  
       2014-07-05 20:15:05 +08:00
    不知道你现在解决没,十分想知道方法。sign值怎么弄。
    pc10201
        6
    pc10201  
    OP
       2014-07-06 16:40:43 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2839 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 06:06 · PVG 14:06 · LAX 22:06 · JFK 01:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.