Browse Source

Merge pull request 'cookie存到redis' (#46) from wpd_cookie2 into master

Reviewed-on: #46
pull/47/head
pengda 5 days ago
parent
commit
0179e5e6d7
  1. 2
      control/weibo.php
  2. 6
      model/mSpider.php

2
control/weibo.php

@ -113,6 +113,8 @@ class weibo extends publicBase {
public function ajax_update_cookie() {
$cookie = trim($this->get('cookie'));
if(empty($cookie)) $this->ajax_json(false, '参数错误');
$type = $this->get('type') + 0;
$obj = new mWeiboBehavior();
$robj = $obj->initRedis();

6
model/mSpider.php

@ -267,7 +267,8 @@ class mSpider extends mBase {
$this->proxy_ip = $ipdata['ip'];
$this->proxy_port = $ipdata['port'];
$cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);;
$cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);
if(empty($cookie)) $cookie = WEIBO_LOGIN_COOKIE;
$url = "https://weibo.com/ajax/statuses/searchProfile?uid={$uid}&page={$page}&hasori=1";
$headers = array(
"Cookie: SUB={$cookie}",
@ -378,7 +379,8 @@ class mSpider extends mBase {
$this->proxy_ip = $ipdata['ip'];
$this->proxy_port = $ipdata['port'];
$cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);;
$cookie = $rdobj->get(_RC_WEIBO_LOGIN_COOKIE);
if(empty($cookie)) $cookie = WEIBO_LOGIN_COOKIE;
$endtime = strtotime("tomorrow");
$url = "https://weibo.com/ajax/statuses/searchProfile?uid={$uid}&page={$page}&endtime={$endtime}&hasret=1&hastext=1&haspic=1&hasvideo=1&hasmusic=1";
$headers = array(

Loading…
Cancel
Save