|
|
@@ -7,6 +7,7 @@ import redis
|
|
|
import scrapy
|
|
|
|
|
|
from ..items import Hgjieshu
|
|
|
+from ..settings import R_HOST, R_PASSWORD, R_POST, R_DB
|
|
|
|
|
|
|
|
|
class HgjieshuSpider(scrapy.Spider):
|
|
|
@@ -20,7 +21,7 @@ class HgjieshuSpider(scrapy.Spider):
|
|
|
# 'LOG_LEVEL': 'DEBUG',
|
|
|
# 'LOG_FILE': "../hg3535/log/saiguo{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
|
|
|
}
|
|
|
- rls = redis.Redis(host='192.168.2.200', port=6379, db=1, password=123456)
|
|
|
+ rls = redis.Redis(host=R_HOST, port=R_POST, db=R_DB, password=R_PASSWORD)
|
|
|
|
|
|
def start_requests(self):
|
|
|
match_ids = self.rls.smembers("hg3535.gunqiu.ids")
|
|
|
@@ -38,7 +39,7 @@ class HgjieshuSpider(scrapy.Spider):
|
|
|
if not status:
|
|
|
ball = data['i'][31]
|
|
|
match_id = data['i'][2]
|
|
|
- # self.rls.srem('hg3535.zq.gunqiu', data)
|
|
|
+ self.rls.srem('hg3535.zq.gunqiu', data)
|
|
|
item = Hgjieshu()
|
|
|
item['ball'] = ball
|
|
|
item['match_id'] = match_id
|