up to date

This commit is contained in:
岛风 2021-05-17 16:39:08 +08:00
parent ffd636c870
commit 440ab1ab06

View File

@ -6,8 +6,16 @@ P站小爬虫 爬每日排行榜
""" """
"""
--------------------------------------------------------------
"""
import re import re
import os import os
from cmd import Cmd
try: try:
import requests import requests
@ -23,7 +31,15 @@ requests.packages.urllib3.disable_warnings()
error_list = [] error_list = []
class PixivSpider(object): """
V 1 . 0
---------------------------------------------------------------------
"""
class PixivSpider(Cmd):
def __init__(self): def __init__(self):
self.ajax_url = 'https://www.pixiv.net/ajax/illust/{}/pages' # id self.ajax_url = 'https://www.pixiv.net/ajax/illust/{}/pages' # id
@ -133,10 +149,47 @@ class PixivSpider(object):
error_list.append(k) error_list.append(k)
for k in error_list: for k in error_list:
pixiv.r.delete(k) pixiv.r.delete(k)
"""
C M D
---------------------------------------------------------------------------------
"""
def main(self):
self.cmdloop()
def do_help(self):
pass
def do_exit(self):
pass
def do_rank(self):
pass
def do_stars(self):
pass
def do_like(self):
pass
"""
----------------------------------------------------------
"""
if __name__ == '__main__': if __name__ == '__main__':
pixiv = PixivSpider() pixiv = PixivSpider()
pixiv.pixiv_main() pixiv.main()
# for id_url in pixiv.get_list(): # for id_url in pixiv.get_list():
# pixiv.get_img(id_url) # pixiv.get_img(id_url)