Code Monkey home page Code Monkey logo

cqu-kb's Introduction

cqu-kb

cqu-tool-bucket Liscence pypi download Upload Python Package

cqu-kb 是一个基于python3的,导出重庆大学本科生和研究生课程表的第三方工具。

1. 安装和使用

本项目有两种使用方式,直接订阅和自行安装配置。

1.1. 订阅使用

访问http://cal.loopy.tech/{你的学号}/{教务网密码}即可下载你的课程表日历文件,同时也可直接在日历软件中订阅该地址。

例如,如果你的学号是20170006,教务网密码为qazwsx,则你的课程表就在http://cal.loopy.tech/20170006/qazwsx

1.2. 安装使用

  1. 安装Python
  2. 安装cqu-kb:pip install cqu-kb
  3. 在命令行中输入cqu-kb即可开始运行
  4. 首次运行,需要输入学号和教务网密码
  5. 运行成功后,课表将被保存到桌面的课表.ics文件中。
  6. 课表.ics导入你的日历软件

帐号和密码会存储在你的电脑上,如需清除记录,可使用cqu-kb -r

2. 声明

  1. 本程序开放源代码,可自行检查是否窃取你的信息。
  2. 本程序不存储用户的帐号,密码。
  3. 本程序不存储任何人的课表,所有的数据来自于重庆大学教务网。
  4. 本程序依赖于cqu-jxgl
  5. 在订阅使用时,由于直接使用http的get,存在一定的隐私泄露风险,详见 #5 。

cqu-kb's People

Contributors

0xseanll avatar hagb avatar loopyme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

loopyme hagb

cqu-kb's Issues

A wired character `Ò»` caused the program to crash

Traceback (most recent call last):
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/mc/.local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/mc/.local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./app.py", line 14, in get_ical
    server_main(username, password, path)
  File "/home/mc/.local/lib/python3.6/site-packages/cqu_kb/__main__.py", line 11, in server_main
    main(username, password, path)
  File "/home/mc/.local/lib/python3.6/site-packages/cqu_kb/__main__.py", line 32, in main
    data=get_payload(student)
  File "/home/mc/.local/lib/python3.6/site-packages/cqu_kb/core.py", line 118, in get_cal
    day = chinese_to_numbers[course['time'].split('[')[0]]
KeyError: 'Ò»'

This only appears in some special cases. The character may come from the trash website.

Potential security problems

Here are potential problems:

  1. The public subscription server is not using HTTPS, besides the default HTTP method is GET. It can be easily MITM attack and cause user's credential leak.
  2. This repo is not using any encryption with user's password, it can be stolen by malwares easily.

Maybe you can consider:

  1. Using nginx/caddy to provide HTTP service with reliable HTTPS, using this repo as an upstream.
  2. Provide user graphical interface (web page frontend) for user. In this way you can change GET method to POST to ensure the security. (Credential information should not using GET method to submit)
  3. Implementing master-key mechanism or not saving password to protect user's password.

部分日历软件无法正确读取同时带时区(`TZID`)和`VALUE`属性的时间

比如锤子日历(当然这是它们的锅)。
另见 collective/icalendar#75
在一个同类项目里为了兼容这部分软件,我使用了以下 workaround 来把VALUE去掉同时保留时区。

from icalendar import vDDDTypes
def add_datetime(component, name, time):
    vdatetime = vDDDTypes(time)
    if 'VALUE' in vdatetime.params and 'TZID' in vdatetime.params:
        vdatetime.params.pop('VALUE')
    component.add(name, vdatetime)
...

add_datetime(event, 'dtstart', event_start_datetime)
add_datetime(event, 'dtend', event_end_datetime)

新系统

换了新的选课系统,用的是统一认证号了,失效了

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.