放牧代码和思想
专注自然语言处理、机器学习算法
    This thing called love. Know I would've. Thrown it all away. Wouldn't hesitate.

人人网全部好友相册一键批量下载工具

目录

通过cookie登陆人人网:

cookie选填,如果你具备抓包能力的话,cookie是类似于这样的字串:

当我们选择了记住密码时,登陆后服务器会返回这样的cookie:

POST /ajaxLogin/login?1=1&uniqueTimestamp=201401165375 HTTP/1.1

Accept: */*

Accept-Language: zh-cn

Referer: http://www.renren.com/SysHome.do

x-requested-with: XMLHttpRequest

Content-Type: application/x-www-form-urlencoded

Accept-Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Host: www.renren.com

Content-Length: 300

Connection: Keep-Alive

Cache-Control: no-cache

Cookie: anonymid=hg4xctmk-1uosdf; depovince=GW; _r01_=1; loginfrom=""; jebe_key=4f4ac408-sdfaaaaaaaaaaaaaaaaa1215d4%7C1390812603482%7C1; jebecookies=9ce3c757-7d59-4d10-a7c1-7eb911542a10|||||; ick_login=34cfb655-ea8c-4b6d-9b0c-2889293f5801; JSESSIONID=abcYWKGf_DJBIhQG-4spu

email=sdafsdf.com&autoLogin=true&icode=&origURL=http%3A%2F%2Fwww.renren.com%2Fhome&domain=renren.com&key_id=1&captcha_type=web_login&password=0d8142asdfaaaaaaaaaaaaaaaaaaaae9bc0242191e8d4db28&rkey=d0cf42c2d3d337f9e5d14083f2d52cb2&f=http%253A%252F%252Fguide.renren.com%252Fguide

HTTP/1.1 200 OK

Server: nginx/1.2.0

Date: Mon, 27 Jan 2014 08:53:58 GMT

Content-Type: text/html; charset=UTF-8

Transfer-Encoding: chunked

Connection: keep-alive

Cache-Control: no-cache

Pragma: no-cache

Expires: Thu, 01 Jan 1970 00:00:00 GMT

Set-Cookie: _de=F867288303AFF48C62A073876AA411E46DEBB8C2103DE356; domain=.renren.com; path=/; expires=Thu, 22-Jan-2015 08:53:58 GMT

Set-Cookie: p=9e7a3112a3099045c29610c0a390e4c89; domain=renren.com; path=/; expires=Wed, 26-Feb-2014 08:53:58 GMT

Set-Cookie: ap=265204029; domain=renren.com; path=/; expires=Wed, 26-Feb-2014 08:53:58 GMT

Set-Cookie: first_login_flag=1; domain=renren.com; path=/

Set-Cookie: t=aae437a2xxxxxxxxxxxxxxxx19; domain=.renren.com; path=/

Set-Cookie: t=e2818e7088578399e5a89d972f913102; domain=renren.com; path=/xtalk/

Set-Cookie: societyguester=aae437a2xxxxxxxxxxxxxxxx19; domain=.renren.com; path=/

Set-Cookie: id=265204029; domain=.renren.com; path=/

Set-Cookie: xnsid=2d18445d; domain=.renren.com; path=/

Set-Cookie: loginfrom=syshome; domain=.renren.com; path=/

Content-Encoding: gzip

GET /home HTTP/1.1

Accept: application/x-shockwave-flash, image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*

Accept-Language: zh-cn

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Accept-Encoding: gzip, deflate

Host: www.renren.com

Connection: Keep-Alive

Cookie: anonymid=hg4xctmk-1uosdf; depovince=GW; _r01_=1; loginfrom=syshome; jebe_key=4f4ac408-sdfaaaaaaaaaaaaaaaaa1215d4%7C1390812603482%7C1; jebecookies=9ce3c757-7d59-4d10-a7c1-7eb911542a10|||||; ick_login=34cfb655-ea8c-4b6d-9b0c-2889293f5801; _de=F867288303AFF48C62A073876AA411E46DEBB8C2103DE356; p=9e7a3112a3099045c29610c0a390e4c89; ap=265204029; first_login_flag=1; t=aae437a2xxxxxxxxxxxxxxxx19; societyguester=aae437a2xxxxxxxxxxxxxxxx19; id=265204029; xnsid=2d18445d; JSESSIONID=abcYWKGf_DJBIhQG-4spu

我们要利用的就是上面数据包里最后一串cookie。此时不用填写用户名和密码,照样能够登陆:

知识共享许可协议 知识共享署名-非商业性使用-相同方式共享码农场 » 人人网全部好友相册一键批量下载工具

评论 5

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #3

    博主可否更新下,因为人人网渐行渐下,保留所有好友相册还是挺好的一个功能,网上的工具多是要输入好友相册具体链接的。很不方便。多谢。

    阳光游泳池9年前 (2015-03-11)回复
    • 不好意思,已失效,永久放弃更新

      hankcs9年前 (2015-03-13)回复
  2. #2

    一直显示密码和cookie错误

    燕左布衣9年前 (2015-01-07)回复
  3. #1

    请问这是你写的吗?真是太高了。我是学计算机的都写不出!不知道你是怎么做到的。能不能分享一下您学习的经验。谢谢!qq:183180915

    毅峥明10年前 (2014-07-27)回复
    • 也不算我写的,fork别人的项目改了改而已。我不常用QQ,微博上聊~

      hankcs10年前 (2014-07-27)回复

我的作品

HanLP自然语言处理包《自然语言处理入门》