Преглед изворни кода

cp banquanmao and lailiang

zhaoyang пре 2 година
родитељ
комит
b7b709e63c
1 измењених фајлова са 81 додато и 5 уклоњено
  1. 81 5
      content_spider/spiders/banquanmao/banquanmao.py

+ 81 - 5
content_spider/spiders/banquanmao/banquanmao.py

@@ -15,9 +15,23 @@ allowed_domains = ['api.banquanmao.com.cn']
 source = 'zy_banquanmao'
 source = 'zy_banquanmao'
 source_name = 'zy_banquanmao版权猫'
 source_name = 'zy_banquanmao版权猫'
 source_id = 38
 source_id = 38
-base_url = 'http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method={}&channelkey=6916f4f59737e43d43faeecb759b5e34'
+base_url = 'http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method={}&channelkey={}'
 
 
 doc = '''
 doc = '''
+大推_植宇
+书籍列表:
+http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=booklist&channelkey=ea1a4a2b760f1f385bc43b39abd0c6e0
+书籍详情:
+http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=bookinfo&channelkey=ea1a4a2b760f1f385bc43b39abd0c6e0&bid=6109
+章节列表:
+http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=chapterlist&channelkey=ea1a4a2b760f1f385bc43b39abd0c6e0&bid=6109
+章节内容:
+http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=chapter&channelkey=ea1a4a2b760f1f385bc43b39abd0c6e0&bid=6109&cid=1021506
+
+
+
+
+
 来量_植宇
 来量_植宇
 书籍列表:
 书籍列表:
 http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=booklist&channelkey=6916f4f59737e43d43faeecb759b5e34
 http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=booklist&channelkey=6916f4f59737e43d43faeecb759b5e34
@@ -27,6 +41,7 @@ http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=bookinfo&cha
 http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=chapterlist&channelkey=6916f4f59737e43d43faeecb759b5e34&bid=6109
 http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=chapterlist&channelkey=6916f4f59737e43d43faeecb759b5e34&bid=6109
 章节内容:
 章节内容:
 http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=chapter&channelkey=6916f4f59737e43d43faeecb759b5e34&bid=6109&cid=1021506
 http://api.banquanmao.com.cn/channel/custom/zhiyu/BookSource?method=chapter&channelkey=6916f4f59737e43d43faeecb759b5e34&bid=6109&cid=1021506
+
 '''
 '''
 
 
 
 
@@ -37,9 +52,10 @@ class banquanmao(object):
     source = source
     source = source
     source_name = source_name
     source_name = source_name
     source_id = source_id
     source_id = source_id
+    channelkey = 'ea1a4a2b760f1f385bc43b39abd0c6e0'
 
 
     def get_start_url(self):
     def get_start_url(self):
-        return base_url.format('booklist')
+        return base_url.format('booklist',self.channelkey)
 
 
     def bid_list_result(self, response):
     def bid_list_result(self, response):
         result = json.loads(response.text)
         result = json.loads(response.text)
@@ -51,7 +67,7 @@ class banquanmao(object):
         return result_list
         return result_list
 
 
     def get_book_info_url(self, bid):
     def get_book_info_url(self, bid):
-        return base_url.format('bookinfo') + '&bid={}'.format(bid)
+        return base_url.format('bookinfo',self.channelkey) + '&bid={}'.format(bid)
 
 
     def book_info_result(self, response):
     def book_info_result(self, response):
         result = json.loads(response.text)
         result = json.loads(response.text)
@@ -65,7 +81,7 @@ class banquanmao(object):
         }
         }
 
 
     def get_chapter_list_url(self, bid):
     def get_chapter_list_url(self, bid):
-        return base_url.format('chapterlist') + '&bid={}'.format(bid)
+        return base_url.format('chapterlist',self.channelkey) + '&bid={}'.format(bid)
 
 
     def chapter_list_result(self, response):
     def chapter_list_result(self, response):
         result = json.loads(response.text)
         result = json.loads(response.text)
@@ -82,7 +98,7 @@ class banquanmao(object):
         return result_list
         return result_list
 
 
     def get_chapter_content_url(self, bid, cid):
     def get_chapter_content_url(self, bid, cid):
-        return base_url.format('chapter') + '&bid={}&cid={}'.format(bid, cid)
+        return base_url.format('chapter',self.channelkey) + '&bid={}&cid={}'.format(bid, cid)
 
 
     def chapter_content_result(self, response):
     def chapter_content_result(self, response):
         result = json.loads(response.text)
         result = json.loads(response.text)
@@ -128,3 +144,63 @@ class banquanmaoBookInfoSpider(banquanmao, baseUpdateBookStatusSpider):
         'SOURCE': source,
         'SOURCE': source,
         'LOG_FILE': 'content_spider/log/' + name + time.strftime("%Y-%m-%d", time.localtime()) + '.log'
         'LOG_FILE': 'content_spider/log/' + name + time.strftime("%Y-%m-%d", time.localtime()) + '.log'
     }
     }
+
+
+
+
+
+
+#-------------------------------------------------------------------------------------------------
+
+class banquanmaoSpider(banquanmao, baseSpider):
+    name = 'lailiang'
+    source = 'zy_lailiang'
+    source_name = 'zy_lailiang来量'
+    source_id = 37
+    channelkey = '6916f4f59737e43d43faeecb759b5e34'
+    custom_settings = {
+        'DOWNLOAD_DELAY': 0.1,
+        'SOURCE': source,
+        'LOG_FILE': 'content_spider/log/' + name + time.strftime("%Y-%m-%d", time.localtime()) + '.log'
+    }
+
+
+class lailiangupdateSpider(banquanmao, baseUpdateSpider):
+    name = 'lailiangupdate'
+    source = 'zy_lailiang'
+    source_name = 'zy_lailiang来量'
+    source_id = 37
+    channelkey = '6916f4f59737e43d43faeecb759b5e34'
+    custom_settings = {
+        'DOWNLOAD_DELAY': 0.1,
+        'SOURCE': source,
+        'LOG_FILE': 'content_spider/log/' + name + time.strftime("%Y-%m-%d", time.localtime()) + '.log'
+    }
+
+
+class lailiangfixSpider(banquanmao, fixChapterSpider):
+    name = 'lailiangfix'
+    source = 'zy_lailiang'
+    source_name = 'zy_lailiang来量'
+    source_id = 37
+    channelkey = '6916f4f59737e43d43faeecb759b5e34'
+    custom_settings = {
+        'DOWNLOAD_DELAY': 0.1,
+        'SOURCE': source,
+        'LOG_FILE': 'content_spider/log/' + name + time.strftime("%Y-%m-%d", time.localtime()) + '.log'
+    }
+
+
+class lailiangBookInfoSpider(banquanmao, baseUpdateBookStatusSpider):
+    name = 'lailiangbookstatusinfo'
+    source = 'zy_lailiang'
+    source_name = 'zy_lailiang来量'
+    source_id = 37
+    channelkey = '6916f4f59737e43d43faeecb759b5e34'
+    custom_settings = {
+        'DOWNLOAD_DELAY': 0.1,
+        'SOURCE': source,
+        'LOG_FILE': 'content_spider/log/' + name + time.strftime("%Y-%m-%d", time.localtime()) + '.log'
+    }
+
+