Giter Site home page Giter Site logo

awannabecoder / bzpro Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trinitrotofu/bzpro

0.0 0.0 0.0 140.21 MB

BZOJ离线题库 附赠下载器一枚

Home Page: https://trinitrotofu.github.io/BZPRO/

License: GNU General Public License v3.0

Shell 0.01% C++ 0.02% HTML 99.97%

bzpro's Introduction

BZPRO

What's this

BZOJ离线题库

包含了所有题面,以及权限题甚至还包含了爬虫

还有所有的题目图片,以及几乎所有的pdf/rar/doc/txt都包含在内并且转换成了相对连接。(也就是说你能到处复制它而不会出现题目显示不出来的问题)

(为什么说是几乎所有的呢?因为有的pdf是放在https://begin.lydsy.com/JudgeOnline/上的,而我暂时还不知道怎么爬,所以并未爬取。如果有大佬知道欢迎在issue里告诉我这个辣鸡或者直接提交pr也行)

因为RuanXZ大佬把他的爬虫搞丢了所以我就重新写了一个

因为没有CSS/HTML基础所以很垃圾的还请大家见谅。

(而且我真的不会用github)

How to use it

离线题库

下载本仓库后浏览器打开index.html

或者直接通过GitPage访问:https://trinitrotofu.github.io/BZPRO/

爬虫

打开Clawer文件夹。

首先chmod一波:

chmod +x ./Get_Cookies.sh

chmod +x ./Get_Bzoj.sh

chmod +x ./Render.sh

然后获取Cookie:

./Get_Cookies.sh

会要求输入BZOJ账号密码,如果需要爬取权限题的话请输入权限号。

会生成一个cookies.txt,内容就是cookie内容,是有有效期的,有多久我不知道。

接着设置一下爬取的题目范围:

编辑begin.txt,将里面的数字设置为“需要爬取的最小题目编号”,再编辑end.txt,将里面的数字设置为“需要爬取的最大题目编号”,爬虫将会爬取编号在区间[begin, end]内的题目。

然后下载原始题目文件:

./Get_Bzoj.sh

大概等个四十分钟的样子(网速不同可能有所差异)。。。爬虫会把题目下载到www.lydsy.com文件夹内。

最后生成题库首页和题目页面:

./Render.sh

脚本会把原始题目备份到www.lydsy.com_bak文件夹中,然后生成好的BZPRO会放在www.lydsy.com中。

如果爬虫在运行过程中出现问题,请检查:

  • 网络是否通畅
  • Cookie是否获取正确以及是否过期
  • 是否存在有题目未被下载的情况

如果还有问题可以提交issue。

Thx

感谢对此项目提供了很大帮助的大佬:

Xeonacid

(本来在contributor里可以看到这位大佬的,结果因为Remmina不会用Github导致好像。。。覆盖了。。。就。。。没了QwQ)

At Last

至于为什么爬虫要延迟0.3秒再爬下一道题,是因为BZOJ添加了检查机制,访问速度太快会导致被拒绝访问导致很多题目下载不下来。

还有代码很可能有问题,因为作者是个制杖。

Powered by Remmina.

The UI is based on syzoj, using GPL License.

bzpro's People

Contributors

konnyakuxzy avatar remmina avatar trinitrotofu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.