├── .gitignore
├── CONTRIBUTING.md
├── FedoraopenSUSE快速使用Panda-Learning方法.md
├── LICENSE
├── README.md
├── Source Packages
├── pandalearning.py
└── pdlearn
│ ├── __init__.py
│ ├── dingding.py
│ ├── get_links.py
│ ├── mydriver.py
│ ├── score.py
│ ├── threads.py
│ ├── user.py
│ ├── user_agent.py
│ └── version.py
├── Update log
├── aarch64版本使用说明.md
├── google-chrome.repo
├── img_folder
├── 1920px-LGPLv3_Logo.svg.png
├── 19618866.png
├── CONTRIBUTING.jpg
├── banner.jpg
├── banner.psd
├── contributors.png
├── detection.png
├── panda.ico
├── panda.png
├── peoplelearning.jpg
└── phone.jpg
├── pandalearning-aarch64
├── pandalearning-pi
├── windows不能运行时安装
├── vc_redist.x64.exe
├── vc_redist.x86.exe
└── 目录说明.txt
└── 树莓派版使用说明.md
/.gitignore:
--------------------------------------------------------------------------------
1 | .gitignore
2 | pandaico.ico
3 | contributors.psd
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # 第一次参与开源
4 |
5 | 万事起头难。特别是和其他人合作时,犯错格外令人不舒服。不过,开源的本质就是和其他人合作。我们希望为初学者带来一个简单的方法去学习及参与开源项目。
6 |
7 | 阅读文章和观看教程会有所帮助。不过,有什么方法能比实际动手做更好?本项目旨在指导初学者及简化初学者参与开源的方式。记住:过程越轻松,学习效益越高。如果你想要做出第一次贡献,只需按照以下简单步骤操作即可。我们答应你,这将很好玩 :)
8 |
9 |
10 |
11 | 如果你的电脑上尚未安装 git, 请按照这个[ 安装指引 ](https://help.github.com/articles/set-up-git/)进行安装。
12 |
13 | ## Fork(复制)本代码仓库
14 |
15 | 点击图示中的按钮去 Fork 这个代码仓库。
16 | 这个操作会将代码仓库复制到你的账户名下。
17 |
18 | ## Clone(克隆)代码仓库
19 |
20 |
21 |
22 | 接下来,将复制后的代码仓库克隆到你的电脑上。点击图示中的绿色按钮,接着点击复制到剪切板按钮(将代码仓库地址复制下来)
23 |
24 | 随后打开命令行窗口,敲入如下 git 命令:
25 |
26 | ```
27 | git clone "刚才复制的 url 链接"
28 | ```
29 |
30 | "刚才复制的 url 链接"(去掉双引号)就是复制到你账户名下的代码仓库地址。获取这链接地址的方法请见上一步。
31 |
32 |
33 |
34 | 譬如:
35 |
36 | ```
37 | git clone https://github.com/你的Github用户名/first-contributions.git
38 | ```
39 |
40 | '你的 Github 用户名' 指的就是你的 Github 用户名。这一步,你将复制到你账户名下的 first-contributions 这个代码仓库克隆到本地电脑上。
41 |
42 | ## 新建一个分支
43 |
44 | 下面的命令能在命令行窗口中,把目录切换到 first-contributions
45 |
46 | ```
47 | cd first-contributions
48 | ```
49 |
50 | 接下来使用 `git checkout` 命令新建一个代码分支
51 |
52 | ```
53 | git checkout -b <新分支的名称>
54 | ```
55 |
56 | 譬如:
57 |
58 | ```
59 | git checkout -b add-myname
60 | ```
61 |
62 | (新分支的名称不一定需要有* add *。然而,在新分支的名称加入* add *是一件合理的事情,因为这个分支的目的是将你的名字添加到列表中。)
63 |
64 | ## 对代码进行修改,而後 Commit (提交) 修改
65 |
66 | 打开 `Contributors.md` 这个文件,更新文件内容,将你的名字加上去,保存修改。`git status` 这命令会列出被改动的文件。接着 `git add` 这命令则可以添加你的改动,就像如下这条命令。
67 |
68 |
69 |
70 | ```
71 | git add Contributors.md
72 | ```
73 |
74 | 现在就可以使用 `git commit` 命令 commit 你的修改了。
75 |
76 | ```
77 | git commit -m "Add <你的名字> to Contributors list"
78 | ```
79 |
80 | 将 `<你的名字>` 替换为你的名字
81 |
82 | ## 将改动 Push(发布)到 GitHub
83 |
84 | 使用 `git push` 命令发布代码
85 |
86 | ```
87 | git push origin <分支的名称>
88 | ```
89 |
90 | 将 `<分支的名称>` 替换为之前新建的分支名称。
91 |
92 | ## 提出 Pull Request 将你的修改供他人审阅
93 |
94 | 前往 Github 你的代码仓库,你会看到一个 `Compare & pull request` 的按钮。点击该按钮。
95 |
96 |
97 |
98 | 接着再点击 `Create pull request` 按钮,正式提交 pull request。
99 |
100 |
101 |
102 | 不久之后,我便会把你所有的变化合并到这个项目的主分支。更改合并后,你会收到电子邮件通知。
103 |
104 | ### [ 更多资料 ](../additional-material/git_workflow_scenarios/additional-material.md)
105 |
106 |
107 |
108 |
109 |
110 | # 贡献什么
111 |
112 | ###### 你喜欢写作吗?
113 |
114 | - 编写并改进项目的文档
115 | - 策划一个示例文件夹,显示项目的使用方式
116 | - 为项目启动简报,或从邮件列表中挑选精彩集锦
117 | - 编写项目的教程,[就像PyPA的贡献者那样](https://github.com/pypa/python-packaging-user-guide/issues/194)
118 | - 为项目文档撰写翻译
119 |
120 | ###### 你喜欢组织吗?
121 |
122 | - 链接到重复的问题,并建议新的问题标签,以保持组织有序
123 | - 通过开放性问题并建议关闭旧问题,[比如@nzakas为ESLint做的事情](https://github.com/eslint/eslint/issues/6765)
124 | - 询问有关最近开放的问题的澄清问题,以推进讨论
125 |
126 | ###### 你喜欢编码吗?
127 |
128 | - 找一个待解决的公开问题,[就像@dianjin为Leaflet所做的那样](https://github.com/Leaflet/Leaflet/issues/4528#issuecomment-216520560)
129 | - 询问您是否可以帮助编写新功能
130 | - 自动化项目设置
131 | - 改进工具和测试
132 |
133 | ###### 你喜欢帮助别人吗?
134 |
135 | - 回答有关项目的问题
136 | - 回答有关未解决问题的人的问题
137 | - 帮助调节讨论板或对话渠道
138 |
139 | ###### 你喜欢帮助别人代码吗?
140 |
141 | - 查看其他人提交的代码
142 | - 编写有关如何使用项目的教程
143 | - 提供指导另一个贡献者,
--------------------------------------------------------------------------------
/FedoraopenSUSE快速使用Panda-Learning方法.md:
--------------------------------------------------------------------------------
1 | # Fedora/openSUSE快速使用Panda-Learning方法
2 | ## Fedora/openSUSE快速安装Chrome和ChromeDriver
3 | ### 1.配置Google Chrome源
4 | `cp google-chrome.repo /etc/yum.repos.d/`
5 | ### 2.安装Chrome和ChromeDriver
6 | `dnf install google-chrome-stable`
7 |
8 | `dnf install chromedriver`
9 |
10 | 此方法既快速又可避免缺少依赖造成的安装失败
11 |
12 | Fedora默认将chrome安装在/opt/google/chrome/
13 |
14 | 默认将chromedriver安装在/usr/lib64/chromium-browser/
15 |
16 | ### 注意:chromium ≠ chrome 试图安装使用chromium替代chrome的同学,可能会无法学习!
17 | ## 安装Python的WebDriver组件
18 | `pip3 install selenium`
19 |
20 | `pip3 install requests`
21 |
22 | ## 运行Panda-Learning源码
23 | `python3 pandalearning.py`
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
166 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > 由于原作者不再更新,特立此代码库收集大家的更新。
2 |
3 | 
4 |
5 |
6 |
7 | # 🐼Panda Learning
8 |
9 | Panda Learning 是一款使用python语言编写的学习工具。
10 |
11 |
12 |
13 | 
14 |
15 | [](https://github.com/PandaLearning/Panda-Learning/stargazers) [](https://github.com/PandaLearning/Panda-Learning/network/members) `请点击页面顶部靠右star与fork`
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | [](https://github.com/PandaLearning/Panda-Learning/releases/tag/V2.2)      [](https://github.com/PandaLearning/Panda-Learning/issues) [](https://github.com/PandaLearning/Panda-Learning/issues?q=is%3Aissue+is%3Aclosed)   
24 |
25 |
26 | [TOC]
27 |
28 | ## 🐷telegram 电报
29 |
30 | 为本项目的telegram: [telegram(点击加入讨论)]()
31 |
32 |
33 | ## 📃免责声明
34 |
35 | Panda Learning为本人python学习交流的开源非营利项目,仅作为程序员之间相互学习交流之用,使用需严格遵守开源许可协议。严禁用于商业用途,禁止使用Panda Learning进行任何盈利活动。对一切非法使用所产生的后果,本人概不负责。
36 |
37 |
38 |
39 |
40 |
41 | ## 👍程序特性
42 |
43 |
44 |
45 |
46 |
47 | ###### 全平台支持: win,macos,linux,vps,Raspbian-pi等各种平台
48 |
49 | `不支持xp`
50 |
51 | ###### 全程后台静默学习: 也可开启前台学习展示
52 |
53 | ###### 自动核对学习分数: 根据每日分数学满为止
54 |
55 | ###### 支持保存账户信息: 可以保存帐户信息每日免去重复登陆
56 |
57 | ###### 默认多线程学习: 可关闭,建议开启,每日学满只需20分钟
58 |
59 | ###### 可设置自动关机: 每天下班用办公室电脑学习后自动关机
60 |
61 | ###### 增强防检测:随机浏览器请求头及自然学习行为模拟
62 |
63 |
64 |
65 |
66 |
67 | `右侧为手机操作vps示例`
68 |
69 | 另有安卓本地运行方式,请查看issue #323
70 |
71 |
72 |
73 | ## 📗使用方法
74 |
75 | ### 🔑快速使用
76 |
77 | `解压后运行 pandalearning 来启动程序;`
78 |
79 | `根据提示输入用户标记,标记可以是任意***英文/中文/数字***`
80 |
81 | `根据提示选择是否保存钉钉账号密码,保存后下次使用将不需要输入。`
82 |
83 | `登陆之后自动学习`
84 |
85 | 注意`mac需要在终端中打开`
86 |
87 | `二维码登陆弹出右侧提示勿点击停用,直接x掉即可`
88 |
89 |
90 |
91 | ### 🔐进阶使用
92 |
93 | 快捷方式中或者终端运行时加入参数分别是:
94 |
95 | `第一个参数为用户标记;`
96 |
97 | `第二个参数为 hidden 或 show,对应后台运行和前台运行;`
98 |
99 | `第三个参数为 single 或 multithread, 对应单线程和多线程学习;`
100 |
101 | `第四个参数为 num 为输入一个数字,表示学习完成后多少秒自动关机。`
102 |
103 | ### 📅示例 win平台
104 |
105 | user1 为已经保存了钉钉账户的用户标记
106 |
107 | `pandalearning.exe user1 表示自动开启user1 学习`
108 |
109 | `pandalearning.exe user1 show single 表示前台显示且单线程开启user1 学习`
110 |
111 | `pandalearning.exe user1 hidden multithread 300 表示后台多线程开启user1 学习,学习完毕300秒关机`
112 |
113 | ### 🔧更新方法
114 |
115 | 下载更新包覆盖原文件,打开程序验证版本信息
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | ## 💾下载地址
124 |
125 | [](https://github.com/PandaLearning/Panda-Learning/releases/download/V20200408/Panda_learning-win.7z) 首次使用推荐下载
126 |
127 | [](https://pandalearning.github.io/Panda-Learning-download/pandalearning.exe)  下载覆盖即可使用,老用户下载
128 |
129 | ------
130 |
131 | [](https://github.com/PandaLearning/Panda-Learning/raw/mac/pandalearning-mac/pandalearning_macos.zip)  需预先安装Chrome浏览器
132 |
133 | [](https://github.com/PandaLearning/Panda-Learning/raw/mac/pandalearning-mac/googlechrome.dmg)  Google Chrome镜像
134 |
135 | ------
136 |
137 | [](https://github.com/PandaLearning/Panda-Learning/raw/linux/pandalearning-linux/pandalearning_linux.tar.gz)  需预先安装Chrome浏览器
138 |
139 | [](https://github.com/PandaLearning/Panda-Learning/raw/linux/pandalearning-linux/google-chrome-stable_current_x86_64.rpm)  适用于 Fedora/openSUSE
140 |
141 | [](https://github.com/PandaLearning/Panda-Learning/raw/linux/pandalearning-linux/google-chrome-stable_current_amd64.deb)  适用于 Debian/Ubuntu
142 |
143 | [Fedora/openSUSE dnf安装Chrome和Chromedriver方法]()
144 |
145 |
146 |
147 | ------
148 |
149 | [](https://github.com/PandaLearning/Panda-Learning/raw/linux/pandalearning-linux/google-chrome-stable_current_amd64.deb)  适用于 raspberrypi
150 |
151 | [Raspberry Pi 说明](https://github.com/PandaLearning/Panda-Learning/blob/master/%E6%A0%91%E8%8E%93%E6%B4%BE%E7%89%88%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md)
152 |
153 |
154 |
155 | ## 📑常见问题
156 |
157 | win平台可能提示`无法定位程序输入点ucrtbase.terminate于动态链接库api-ms-win-crt-runtime-|1-1-0.dll`等缺失dll文件的问题而无法使用,尝试安装`Visual C++ Redistributable for Visual Studio 2015`
158 |
159 | [](https://github.com/PandaLearning/Panda-Learning/raw/master/windows%E4%B8%8D%E8%83%BD%E8%BF%90%E8%A1%8C%E6%97%B6%E5%AE%89%E8%A3%85/vc_redist.x64.exe)
160 |
161 | [](https://github.com/PandaLearning/Panda-Learning/raw/master/windows%E4%B8%8D%E8%83%BD%E8%BF%90%E8%A1%8C%E6%97%B6%E5%AE%89%E8%A3%85/vc_redist.x86.exe)
162 |
163 |
164 |
165 |
166 |
167 | ## 📕问题提交
168 |
169 | 在仔细阅读文档的前提下
170 |
171 | - 检查当前的issue是否有与你相关的。发布重复的issue会让双方都降低效率,搜索开放和已经关闭的issue来检查你现在提出的issue是否已经被提及。
172 | - 请明确你的问题:期望的输出是什么,实际发生了什么?以及其他人如何复现你的问题。
173 | - 对结果的链接:复现问题的方式
174 | - 汇报系统环境的详细信息,注明程序版本号与运行环境。
175 | - 如果你粘贴错误输出到一个issue中,请使用三个反引号包裹` ```使得显示更漂亮易读``` `。
176 |
177 | [](https://github.com/PandaLearning/Panda-Learning/issues) [](https://github.com/PandaLearning/Panda-Learning/issues?q=is%3Aissue+is%3Aclosed)
178 |
179 | 提交issue标题示例 `V2.4 win10x64 软件显示问题…`
180 |
181 |
182 |
183 |
184 |
185 | ## 📒更新说明
186 |
187 | - v 2.5
188 | - `Security` 加入防js检测功能,防检测功能更强
189 | - `Fixed ` 针对强国积分获取更改修复程序获取逻辑
190 | - v 2.4
191 | - `Security` 增加随机请求头
192 | - `Security` 增加文章视频学习随机滑动窗口
193 | - `Added` 源码适配各个系统
194 | - v 2.3(preview)
195 | - `Fixed` 修复自动关机问题,以及剩余时间显示不正确,根据新版积分规则调整学习时间。
196 | - `Changed` 更改学习时长为文章2分钟,视频3分钟
197 | - v 2.2(preview)
198 | - `Fixed` 修复逻辑问题,增加程序鲁棒性。
199 | - v 2.1(preview)
200 | - `Fixed` 针对学习强国更新,紧急修复不能使用等问题。
201 | - v 2.0(preview)
202 | - `Added` 检查分数学满30分为止,
203 | - `Added` 增加自动关机,保存账号,支持开关多线程及headless。
204 | - `Removed` 删除cookies本地保存
205 | - v 1.8
206 | - `Added` 增加账号登陆,不用扫码也可以使用了。
207 | - `Changed` 变更为后台学习,登陆后自动关闭浏览器。
208 | - v 1.6
209 | - `Added` 增加win7 32位平台支持。
210 | - `Added` 增加mac os系统支持。
211 | - v 1.5
212 | - `Added` 加入活跃时间判断,修复用户自行学完文章篇书却没有学习时长等极端情况。
213 | - `Added` 开放python源码,可以自行在各平台使用,请仔细阅读开源协议.
214 | - v 1.0 alpha
215 | - `Added` pandalearning win10平台上线。
216 |
217 |
218 |
219 |
220 |
221 | ## 📈贡献
222 |
223 | 
224 |
225 | [](https://github.com/PandaLearning/Panda-Learning/graphs/contributors)
226 |
227 |
228 |
229 | ### [👨👨👦👦 参与贡献](https://github.com/PandaLearning/Panda-Learning/blob/master/CONTRIBUTING.md)(内附提交方法)
230 |
231 |
232 |
233 | ## 📌关于学习强国
234 |
235 | 个人认为,学习强国本身受众就是国家的栋梁,本人不欢迎不热爱国家的人加入本项目。
236 |
237 | 学习强国聚合了大量可免费阅读的期刊、古籍、公开课、歌曲、戏曲、电影、图书等资料,内容严谨,专业性强。没有博眼球,无下限的自媒体内容和虚假新闻。推荐大家自发积极学习使用。Panda Learning仅额外提供给上班上学期间工作学业繁重,抽不出时间完成学习强国任务的非程序员。
238 |
239 | “学习强国”意义深远。
240 |
241 |
242 |
243 |
244 |
245 | ## 📝源码
246 |
247 | [](https://github.com/PandaLearning/Panda-Learning/tree/master/Source%20Packages)
248 |
249 |
250 |
251 |
252 |
253 | ## 📜许可证
254 |
255 | 
256 |
257 | [](https://github.com/PandaLearning/Panda-Learning/blob/master/LICENSE)
258 |
259 |
260 |
--------------------------------------------------------------------------------
/Source Packages/pandalearning.py:
--------------------------------------------------------------------------------
1 | import time
2 | from sys import argv
3 | import random
4 | from pdlearn import version
5 | from pdlearn import user
6 | from pdlearn import dingding
7 | from pdlearn import mydriver
8 | from pdlearn import score
9 | from pdlearn import threads
10 | from pdlearn import get_links
11 |
12 |
13 | def user_flag(dd_status, uname):
14 | if dd_status:
15 | cookies = dingding.dd_login_status(uname, has_dd=True)
16 | else:
17 | if (input("是否保存钉钉帐户密码,保存后可后免登陆学习(Y/N) ")) not in ["y", "Y"]:
18 | driver_login = mydriver.Mydriver(nohead=False)
19 | cookies = driver_login.login()
20 | else:
21 | cookies = dingding.dd_login_status(uname)
22 | a_log = user.get_a_log(uname)
23 | v_log = user.get_v_log(uname)
24 |
25 | return cookies, a_log, v_log
26 |
27 |
28 | def get_argv():
29 | nohead = True
30 | lock = False
31 | stime = False
32 | if len(argv) > 2:
33 | if argv[2] == "hidden":
34 | nohead = True
35 | elif argv[2] == "show":
36 | nohead = False
37 | if len(argv) > 3:
38 | if argv[3] == "single":
39 | lock = True
40 | elif argv[3] == "multithread":
41 | lock = False
42 | if len(argv) > 4:
43 | if argv[4].isdigit():
44 | stime = argv[4]
45 | return nohead, lock, stime
46 |
47 |
48 | def show_score(cookies):
49 | total, each = score.get_score(cookies)
50 | print("当前学习总积分:" + str(total))
51 | print("阅读文章:{}/6,观看视频:{}/6,登陆:{}/1,文章时长:{}/6,视频时长:{}/6".format(*each))
52 | return total, each
53 |
54 |
55 | def article(cookies, a_log, each):
56 | if each[0] < 6 or each[3] < 8:
57 | driver_article = mydriver.Mydriver(nohead=nohead)
58 | driver_article.get_url("https://www.xuexi.cn/notFound.html")
59 | driver_article.set_cookies(cookies)
60 | links = get_links.get_article_links()
61 | try_count = 0
62 | while True:
63 | if each[0] < 6 and try_count < 10:
64 | a_num = 6 - each[0]
65 | for i in range(a_log, a_log + a_num):
66 | driver_article.get_url(links[i])
67 | time.sleep(random.randint(5, 15))
68 | for j in range(120):
69 | if random.random() > 0.5:
70 | driver_article.go_js('window.scrollTo(0, document.body.scrollHeight/120*{})'.format(j))
71 | print("\r文章学习中,文章剩余{}篇,本篇剩余时间{}秒".format(a_log + a_num - i, 120 - j), end="")
72 | time.sleep(1)
73 | driver_article.go_js('window.scrollTo(0, document.body.scrollHeight)')
74 | total, each = show_score(cookies)
75 | if each[0] >= 6:
76 | print("检测到文章数量分数已满,退出学习")
77 | break
78 | a_log += a_num
79 | else:
80 | with open("./user/{}/a_log".format(uname), "w", encoding="utf8") as fp:
81 | fp.write(str(a_log))
82 | break
83 | try_count = 0
84 | while True:
85 | if each[3] < 6 and try_count < 10:
86 | num_time = 60
87 | driver_article.get_url(links[a_log-1])
88 | time.sleep(random.randint(5, 15))
89 | remaining = (6 - each[3]) * 4 * num_time
90 | for i in range(remaining):
91 | if random.random() > 0.5:
92 | driver_article.go_js(
93 | 'window.scrollTo(0, document.body.scrollHeight/{}*{})'.format(remaining, i))
94 | print("\r文章时长学习中,文章总时长剩余{}秒".format(remaining - i), end="")
95 | time.sleep(1)
96 | if i % (120) == 0 and i != remaining:
97 | total, each = show_score(cookies)
98 | if each[3] >= 6:
99 | print("检测到文章时长分数已满,退出学习")
100 | break
101 | driver_article.go_js('window.scrollTo(0, document.body.scrollHeight)')
102 | total, each = show_score(cookies)
103 | else:
104 | break
105 | if try_count < 10:
106 | print("文章学习完成")
107 | else:
108 | print("文章学习出现异常,请检查用户名下a_log文件记录数")
109 | driver_article.quit()
110 | else:
111 | print("文章之前学完了")
112 |
113 |
114 | def video(cookies, v_log, each):
115 | if each[1] < 6 or each[4] < 10:
116 | driver_video = mydriver.Mydriver(nohead=nohead)
117 | driver_video.get_url("https://www.xuexi.cn/notFound.html")
118 | driver_video.set_cookies(cookies)
119 | links = get_links.get_video_links()
120 | try_count = 0
121 | while True:
122 | if each[1] < 6 and try_count < 10:
123 | v_num = 6 - each[1]
124 | for i in range(v_log, v_log + v_num):
125 | driver_video.get_url(links[i])
126 | time.sleep(random.randint(5, 15))
127 | for j in range(180):
128 | if random.random() > 0.5:
129 | driver_video.go_js('window.scrollTo(0, document.body.scrollHeight/180*{})'.format(j))
130 | print("\r视频学习中,视频剩余{}个,本次剩余时间{}秒".format(v_log + v_num - i, 180 - j), end="")
131 | time.sleep(1)
132 | driver_video.go_js('window.scrollTo(0, document.body.scrollHeight)')
133 | total, each = show_score(cookies)
134 | if each[1] >= 6:
135 | print("检测到视频数量分数已满,退出学习")
136 | break
137 | v_log += v_num
138 | else:
139 | with open("./user/{}/v_log".format(uname), "w", encoding="utf8") as fp:
140 | fp.write(str(v_log))
141 | break
142 | try_count = 0
143 | while True:
144 | if each[4] < 6 and try_count < 10:
145 | num_time = 60
146 | driver_video.get_url(links[v_log-1])
147 | time.sleep(random.randint(5, 15))
148 | remaining = (6 - each[4]) * 3 * num_time
149 | for i in range(remaining):
150 | if random.random() > 0.5:
151 | driver_video.go_js(
152 | 'window.scrollTo(0, document.body.scrollHeight/{}*{})'.format(remaining, i))
153 | print("\r视频学习中,视频总时长剩余{}秒".format(remaining - i), end="")
154 | time.sleep(1)
155 | if i % (180) == 0 and i != remaining:
156 | total, each = show_score(cookies)
157 | if each[4] >= 6:
158 | print("检测到视频时长分数已满,退出学习")
159 | break
160 | driver_video.go_js('window.scrollTo(0, document.body.scrollHeight)')
161 | total, each = show_score(cookies)
162 | else:
163 | break
164 | if try_count < 10:
165 | print("视频学习完成")
166 | else:
167 | print("视频学习出现异常,请检查用户名下v_log文件记录数")
168 | driver_video.quit()
169 | else:
170 | print("视频之前学完了")
171 |
172 |
173 | if __name__ == '__main__':
174 | # 0 读取版本信息
175 | start_time = time.time()
176 | info_shread = threads.MyThread("获取更新信息...", version.up_info)
177 | info_shread.start()
178 | # 1 创建用户标记,区分多个用户历史纪录
179 | dd_status, uname = user.get_user()
180 | cookies, a_log, v_log = user_flag(dd_status, uname)
181 | total, each = show_score(cookies)
182 |
183 | nohead, lock, stime = get_argv()
184 | article_thread = threads.MyThread("文章学习", article, cookies, a_log, each, lock=lock)
185 | video_thread = threads.MyThread("视频学习", video, cookies, v_log, each, lock=lock)
186 | article_thread.start()
187 | video_thread.start()
188 | article_thread.join()
189 | video_thread.join()
190 | print("总计用时" + str(int(time.time() - start_time) / 60) + "分钟")
191 | user.shutdown(stime)
192 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/Source Packages/pdlearn/__init__.py
--------------------------------------------------------------------------------
/Source Packages/pdlearn/dingding.py:
--------------------------------------------------------------------------------
1 | import re
2 | from pdlearn import mydriver
3 | import sys
4 |
5 |
6 | def get_dd():
7 | while True:
8 | dname = input('请输入正确的学习强国帐号(钉钉手机号):')
9 | ret = re.match(r"^1[3-9]\d{9}$", dname)
10 | if ret:
11 | pwd = input("请输入学习强国密码:")
12 | break
13 | return dname, pwd
14 |
15 |
16 | def dd_login_status(uname, has_dd=False):
17 | while True:
18 | if has_dd:
19 | dname, pwd = load_dingding("./user/{}/dingding".format(uname))
20 | print("读取用户信息成功")
21 | else:
22 | dname, pwd = get_dd()
23 | driver_login = mydriver.Mydriver(noimg=False)
24 | login_status = driver_login.dd_login(dname, pwd)
25 | if login_status:
26 | save_dingding("./user/{}/dingding".format(uname), dname, pwd)
27 | cookies = driver_login.get_cookies()
28 | break
29 | return cookies
30 |
31 |
32 | def save_dingding(user_path, dname, pwd):
33 | with open(user_path, "w", encoding="utf8") as fp:
34 | fp.write(dname + "," + pwd)
35 |
36 |
37 | def load_dingding(user_path):
38 | with open(user_path, "r", encoding="utf8") as fp:
39 | try:
40 | dname, pwd = fp.read().split(",")
41 | return dname, pwd
42 | except:
43 | print("钉钉记录文件损坏,错误代码3程序退出")
44 | sys.exit(3)
45 |
46 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/get_links.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import re
3 |
4 |
5 | def get_article_links():
6 | try:
7 | article = requests.get(
8 | "https://www.xuexi.cn/c06bf4acc7eef6ef0a560328938b5771/data9a3668c13f6e303932b5e0e100fc248b.js").content.decode(
9 | "utf8")
10 | pattern = r"list\"\:(.+),\"count\"\:"
11 | links = []
12 | list = eval(re.search(pattern, article).group(1))[:20000]
13 | list.reverse()
14 | for i in range(len(list)):
15 | links.append(list[i]["static_page_url"])
16 | return links
17 | except:
18 | print("=" * 120)
19 | print("get_article_links获取失败")
20 | print("=" * 120)
21 | raise
22 |
23 |
24 | def get_video_links():
25 | try:
26 | video = requests.get(
27 | "https://www.xuexi.cn/4426aa87b0b64ac671c96379a3a8bd26/datadb086044562a57b441c24f2af1c8e101.js").content.decode(
28 | "utf8")
29 | pattern = r'https://www.xuexi.cn/[^,"]*html'
30 | link = re.findall(pattern, video, re.I)
31 | link.reverse()
32 | return link
33 | except:
34 | print("=" * 120)
35 | print("get_video_links获取失败")
36 | print("=" * 120)
37 | raise
38 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/mydriver.py:
--------------------------------------------------------------------------------
1 | from selenium import webdriver
2 | from selenium.webdriver.support.ui import WebDriverWait
3 | from selenium.webdriver.support import expected_conditions as EC
4 | from selenium.common import exceptions
5 | from selenium.webdriver.chrome.options import Options
6 | from pdlearn import user_agent
7 | import os
8 |
9 |
10 | class Mydriver:
11 |
12 | def __init__(self, noimg=True, nohead=True):
13 | try:
14 | self.options = Options()
15 | if os.path.exists("./chrome/chrome.exe"): # win
16 | self.options.binary_location = "./chrome/chrome.exe"
17 | elif os.path.exists("/opt/google/chrome/chrome"): # linux
18 | self.options.binary_location = "/opt/google/chrome/chrome"
19 | if noimg:
20 | self.options.add_argument('blink-settings=imagesEnabled=true') # 不加载图片, 提升速度,但无法显示二维码
21 | if nohead:
22 | self.options.add_argument('--headless')
23 | self.options.add_argument('--disable-extensions')
24 | self.options.add_argument('--disable-gpu')
25 | self.options.add_argument('--no-sandbox')
26 | self.options.add_argument('--mute-audio') # 关闭声音
27 | self.options.add_argument('--window-size=400,500')
28 | self.options.add_argument('--window-position=800,0')
29 | self.options.add_argument('--log-level=3')
30 |
31 | self.options.add_argument('--user-agent={}'.format(user_agent.getheaders()))
32 | self.options.add_experimental_option('excludeSwitches', ['enable-automation']) # 绕过js检测
33 | self.webdriver = webdriver
34 | if os.path.exists("./chrome/chromedriver.exe"): # win
35 | self.driver = self.webdriver.Chrome(executable_path="./chrome/chromedriver.exe",
36 | chrome_options=self.options)
37 | elif os.path.exists("./chromedriver"): # linux
38 | self.driver = self.webdriver.Chrome(executable_path="./chromedriver",
39 | chrome_options=self.options)
40 | elif os.path.exists("/usr/lib64/chromium-browser/chromedriver"): # linux 包安装chromedriver
41 | self.driver = self.webdriver.Chrome(executable_path="/usr/lib64/chromium-browser/chromedriver",
42 | chrome_options=self.options)
43 | elif os.path.exists("/usr/local/bin/chromedriver"): # linux 包安装chromedriver
44 | self.driver = self.webdriver.Chrome(executable_path="/usr/local/bin/chromedriver",
45 | chrome_options=self.options)
46 | else:
47 | self.driver = self.webdriver.Chrome(chrome_options=self.options)
48 | except:
49 | print("=" * 120)
50 | print("Mydriver初始化失败")
51 | print("=" * 120)
52 | raise
53 |
54 |
55 | def login(self):
56 | print("正在打开二维码登陆界面,请稍后")
57 | self.driver.get("https://pc.xuexi.cn/points/login.html")
58 | try:
59 | remover = WebDriverWait(self.driver, 30, 0.2).until(
60 | lambda driver: driver.find_element_by_class_name("redflagbox"))
61 | except exceptions.TimeoutException:
62 | print("网络缓慢,请重试")
63 | else:
64 | self.driver.execute_script('arguments[0].remove()', remover)
65 | try:
66 | remover = WebDriverWait(self.driver, 30, 0.2).until(
67 | lambda driver: driver.find_element_by_class_name("header"))
68 | except exceptions.TimeoutException:
69 | print("当前网络缓慢...")
70 | else:
71 | self.driver.execute_script('arguments[0].remove()', remover)
72 | try:
73 | remover = WebDriverWait(self.driver, 30, 0.2).until(
74 | lambda driver: driver.find_element_by_class_name("footer"))
75 | except exceptions.TimeoutException:
76 | print("当前网络缓慢...")
77 | else:
78 | self.driver.execute_script('arguments[0].remove()', remover)
79 | self.driver.execute_script('window.scrollTo(document.body.scrollWidth/2 - 200 , 0)')
80 | try:
81 | WebDriverWait(self.driver, 270).until(EC.title_is(u"我的学习"))
82 | cookies = self.get_cookies()
83 | return cookies
84 | except:
85 | print("扫描二维码超时")
86 |
87 | def dd_login(self, d_name, pwd):
88 | __login_status = False
89 | self.driver.get(
90 | "https://login.dingtalk.com/login/index.htm?"
91 | "goto=https%3A%2F%2Foapi.dingtalk.com%2Fconnect%2Foauth2%2Fsns_authorize"
92 | "%3Fappid%3Ddingoankubyrfkttorhpou%26response_type%3Dcode%26scope%3Dsnsapi"
93 | "_login%26redirect_uri%3Dhttps%3A%2F%2Fpc-api.xuexi.cn%2Fopen%2Fapi%2Fsns%2Fcallback"
94 | )
95 | self.driver.find_elements_by_id("mobilePlaceholder")[0].click()
96 | self.driver.find_element_by_id("mobile").send_keys(d_name)
97 | self.driver.find_elements_by_id("mobilePlaceholder")[1].click()
98 | self.driver.find_element_by_id("pwd").send_keys(pwd)
99 | self.driver.find_element_by_id("loginBtn").click()
100 | try:
101 | print("登陆中...")
102 | WebDriverWait(self.driver, 2, 0.1).until(lambda driver: driver.find_element_by_class_name("modal"))
103 | print(self.driver.find_element_by_class_name("modal").find_elements_by_tag_name("div")[0].text)
104 | self.driver.quit()
105 | __login_status = False
106 | except:
107 | __login_status = True
108 | return __login_status
109 |
110 | def get_cookies(self):
111 | cookies = self.driver.get_cookies()
112 | return cookies
113 |
114 | def set_cookies(self, cookies):
115 | for cookie in cookies:
116 | self.driver.add_cookie({k: cookie[k] for k in cookie.keys()})
117 |
118 | def get_url(self, url):
119 | self.driver.get(url)
120 |
121 | def go_js(self, js):
122 | self.driver.execute_script(js)
123 |
124 | def quit(self):
125 | self.driver.quit()
126 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/score.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from requests.cookies import RequestsCookieJar
3 | import json
4 |
5 |
6 | def get_score(cookies):
7 | try:
8 | jar = RequestsCookieJar()
9 | for cookie in cookies:
10 | jar.set(cookie['name'], cookie['value'])
11 | total = requests.get("https://pc-api.xuexi.cn/open/api/score/get", cookies=jar).content.decode("utf8")
12 | total = int(json.loads(total, encoding="utf8")["data"]["score"])
13 | each = requests.get("https://pc-api.xuexi.cn/open/api/score/today/queryrate", cookies=jar).content.decode(
14 | "utf8")
15 | each = json.loads(each, encoding="utf8")["data"]["dayScoreDtos"]
16 | each = [int(i["currentScore"]) for i in each if i["ruleId"] in [1, 2, 9, 1002, 1003]]
17 | return total, each
18 | except:
19 | print("=" * 120)
20 | print("get_video_links获取失败")
21 | print("=" * 120)
22 | raise
23 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/threads.py:
--------------------------------------------------------------------------------
1 | from threading import Thread
2 | from threading import Lock
3 |
4 | threadLock = Lock()
5 | threads = []
6 |
7 |
8 | class MyThread(Thread):
9 | def __init__(self, name, func, *args, lock=False):
10 | Thread.__init__(self)
11 | self.name = name
12 | self.func = func
13 | self.args = args
14 | self.lock = lock
15 |
16 | def run(self):
17 | print("开启: " + self.name)
18 | if self.lock:
19 | threadLock.acquire()
20 | self.func(*self.args)
21 | threadLock.release()
22 | else:
23 | self.func(*self.args)
24 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/user.py:
--------------------------------------------------------------------------------
1 | import os
2 | from time import sleep
3 | from sys import argv
4 |
5 |
6 | def get_user():
7 | if len(argv) > 1:
8 | uname = argv[1]
9 | else:
10 | uname = input("输入用户标记名:")
11 | if check_uname(uname):
12 | dd = check_dd(uname)
13 | else:
14 | os.makedirs("./user/{}".format(uname))
15 | dd = False
16 | return dd, uname
17 |
18 |
19 | def check_uname(uname):
20 | __check_status = False
21 | if os.path.exists("./user/{}".format(uname)):
22 | __check_status = True
23 | return __check_status
24 |
25 |
26 | def check_dd(uname):
27 | __dd_status = False
28 | if os.path.exists("./user/{}/dingding".format(uname)):
29 | __dd_status = True
30 | return __dd_status
31 |
32 |
33 | def get_a_log(uname):
34 | __a_log = 0
35 | if os.path.exists("./user/{}/a_log".format(uname)):
36 | with open("./user/{}/a_log".format(uname), "r", encoding="utf8") as fp:
37 | __a_log = int(fp.read())
38 | else:
39 | with open("./user/{}/a_log".format(uname), "w", encoding="utf8") as fp:
40 | fp.write(str(__a_log))
41 | return __a_log
42 |
43 |
44 | def get_v_log(uname):
45 | __v_log = 0
46 | if os.path.exists("./user/{}/v_log".format(uname)):
47 | with open("./user/{}/v_log".format(uname), "r", encoding="utf8") as fp:
48 | __v_log = int(fp.read())
49 | else:
50 | with open("./user/{}/v_log".format(uname), "w", encoding="utf8") as fp:
51 | fp.write(str(__v_log))
52 | return __v_log
53 |
54 |
55 | def shutdown(stime):
56 | if stime:
57 | stime = int(stime)
58 | os.system('shutdown -s -t {}'.format(stime))
59 | for i in range(stime):
60 | print("\r{}秒后关机".format(stime-i), end="")
61 | sleep(1)
62 | else:
63 | print("无自动关机任务,已释放程序内存,10分钟后窗口将自动关闭")
64 | sleep(600)
65 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/user_agent.py:
--------------------------------------------------------------------------------
1 | # -*-coding:utf-8 -*-
2 |
3 | import random
4 |
5 |
6 | # 返回一个随机的请求头 headers
7 | def getheaders():
8 | # 各种PC端
9 | user_agent_list_2 = [
10 | # Opera
11 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60",
12 | "Opera/8.0 (Windows NT 5.1; U; en)",
13 | "Mozilla/5.0 (Windows NT 5.1; U; en; rv:1.8.1) Gecko/20061208 Firefox/2.0.0 Opera 9.50",
14 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 9.50",
15 | # Firefox
16 | "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0",
17 | "Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10",
18 | # Safari
19 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2",
20 | # chrome
21 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36",
22 | "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11",
23 | "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16",
24 | # 360
25 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36",
26 | "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
27 | # 淘宝浏览器
28 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/2.0 Safari/536.11",
29 | # 猎豹浏览器
30 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.71 Safari/537.1 LBBROWSER",
31 | "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; LBBROWSER)",
32 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E; LBBROWSER)",
33 | # QQ浏览器
34 | "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; QQBrowser/7.0.3698.400)",
35 | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 732; .NET4.0C; .NET4.0E)",
36 | # sogou浏览器
37 | "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.84 Safari/535.11 SE 2.X MetaSr 1.0",
38 | "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; SE 2.X MetaSr 1.0)",
39 | # maxthon浏览器
40 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.3.4000 Chrome/30.0.1599.101 Safari/537.36",
41 | # UC浏览器
42 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 UBrowser/4.0.3214.0 Safari/537.36",
43 | ]
44 | # 各种移动端
45 | user_agent_list_3 = [
46 | # IPhone
47 | "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
48 | # IPod
49 | "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
50 | # IPAD
51 | "Mozilla/5.0 (iPad; U; CPU OS 4_2_1 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5",
52 | "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5",
53 | # Android
54 | "Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; HTC_Wildfire_A3333 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
55 | "Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
56 | # QQ浏览器 Android版本
57 | "MQQBrowser/26 Mozilla/5.0 (Linux; U; Android 2.3.7; zh-cn; MB200 Build/GRJ22; CyanogenMod-7) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
58 | # Android Opera Mobile
59 | "Opera/9.80 (Android 2.3.4; Linux; Opera Mobi/build-1107180945; U; en-GB) Presto/2.8.149 Version/11.10",
60 | # Android Pad Moto Xoom
61 | "Mozilla/5.0 (Linux; U; Android 3.0; en-us; Xoom Build/HRI39) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13",
62 | # BlackBerry
63 | "Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.337 Mobile Safari/534.1+",
64 | # WebOS HP Touchpad
65 | "Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0",
66 | # Nokia N97
67 | "Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/20.0.019; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.18124",
68 | # Windows Phone Mango
69 | "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; HTC; Titan)",
70 | # UC浏览器
71 | "UCWEB7.0.2.37/28/999",
72 | "NOKIA5700/ UCWEB7.0.2.37/28/999",
73 | # UCOpenwave
74 | "Openwave/ UCWEB7.0.2.37/28/999",
75 | # UC Opera
76 | "Mozilla/4.0 (compatible; MSIE 6.0; ) Opera/UCWEB7.0.2.37/28/999"
77 | ]
78 | # 一部分 PC端的
79 | user_agent_list_1 = [
80 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1",
81 | "Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11",
82 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6",
83 | "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1090.0 Safari/536.6",
84 | "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/19.77.34.5 Safari/537.1",
85 | "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.9 Safari/536.5",
86 | "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.36 Safari/536.5",
87 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
88 | "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
89 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1063.0 Safari/536.3",
90 | "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3",
91 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1062.0 Safari/536.3",
92 | "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
93 | "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
94 | "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.1 Safari/536.3",
95 | "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/536.3 (KHTML, like Gecko) Chrome/19.0.1061.0 Safari/536.3",
96 | "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24",
97 | "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/535.24 (KHTML, like Gecko) Chrome/19.0.1055.1 Safari/535.24"
98 | ]
99 | UserAgent = random.choice(user_agent_list_1) # 这里只用list1
100 | headers = {'User-Agent': UserAgent}
101 | return headers
102 |
--------------------------------------------------------------------------------
/Source Packages/pdlearn/version.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 |
4 | def up_info():
5 | print("\n正在联网获取更新信息...")
6 | __Version = "v2.5"
7 | __INFO = "熊猫学习唯一下载地址为 https://github.com/Alivon/Panda-Learning"
8 | try:
9 | updata_log = requests.get(
10 | "https://raw.githubusercontent.com/Alivon/Panda-Learning/master/Update%20log").content.decode(
11 | "utf8")
12 | updata_log = updata_log.split("\n")
13 | print(__INFO)
14 | print("程序版本为:{},\n最新版本为:{}".format(__Version, updata_log[1].split("=")[1]))
15 | print("="*120)
16 | if __Version != updata_log[1].split("=")[1]:
17 | print("当前不是最新版本,建议更新")
18 | print("=" * 120)
19 | print("更新提要:")
20 | for i in updata_log[2:]:
21 | print(i)
22 | print("=" * 120)
23 | print("更新显示不会打断之前输入等操作,请继续......(若已输入用户标记直接enter)")
24 | except:
25 | print("版本信息网络错误")
26 |
27 |
28 | if __name__ == '__main__':
29 | up_info()
30 |
--------------------------------------------------------------------------------
/Update log:
--------------------------------------------------------------------------------
1 | Update log test
2 | version=v2.5
3 | 当前最新版本为2.5稳定版 2.5之前版本已无法使用,请更新!!!
4 | - Security` 加入防js检测功能,防检测功能更强
5 | - `Fixed ` 针对强国积分获取更改修复程序获取逻辑
--------------------------------------------------------------------------------
/aarch64版本使用说明.md:
--------------------------------------------------------------------------------
1 | 在aarch64设备上将v2.5版本的源码打包成了可执行文件:pandalearning-aarch64
2 |
3 | 在斐讯N1@Ubuntu18.04上测试可以正常运行
4 |
5 | 理论上运行linux的aarch64的设备,在安装了chromiumdriver和chromium-browser后,可以正常执行
6 |
7 | ubuntu运行示例:
8 | 安装chromium-chromedriver和chromium-browser
9 | ```
10 | apt-get update
11 | apt-get install chromium-chromedriver
12 | ```
13 | 执行aarch64的可执行文件:
14 | ```
15 | ./pandalearning-aarch64
16 | ```
--------------------------------------------------------------------------------
/google-chrome.repo:
--------------------------------------------------------------------------------
1 | [google-chrome]
2 | name=google-chrome
3 | baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
4 | enabled=1
5 | gpgcheck=1
6 | gpgkey=https://dl.google.com/linux/linux_signing_key.pub
7 |
--------------------------------------------------------------------------------
/img_folder/1920px-LGPLv3_Logo.svg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/1920px-LGPLv3_Logo.svg.png
--------------------------------------------------------------------------------
/img_folder/19618866.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/19618866.png
--------------------------------------------------------------------------------
/img_folder/CONTRIBUTING.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/CONTRIBUTING.jpg
--------------------------------------------------------------------------------
/img_folder/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/banner.jpg
--------------------------------------------------------------------------------
/img_folder/banner.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/banner.psd
--------------------------------------------------------------------------------
/img_folder/contributors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/contributors.png
--------------------------------------------------------------------------------
/img_folder/detection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/detection.png
--------------------------------------------------------------------------------
/img_folder/panda.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/panda.ico
--------------------------------------------------------------------------------
/img_folder/panda.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/panda.png
--------------------------------------------------------------------------------
/img_folder/peoplelearning.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/peoplelearning.jpg
--------------------------------------------------------------------------------
/img_folder/phone.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/img_folder/phone.jpg
--------------------------------------------------------------------------------
/pandalearning-aarch64:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/pandalearning-aarch64
--------------------------------------------------------------------------------
/pandalearning-pi:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/pandalearning-pi
--------------------------------------------------------------------------------
/windows不能运行时安装/vc_redist.x64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/windows不能运行时安装/vc_redist.x64.exe
--------------------------------------------------------------------------------
/windows不能运行时安装/vc_redist.x86.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/windows不能运行时安装/vc_redist.x86.exe
--------------------------------------------------------------------------------
/windows不能运行时安装/目录说明.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/luwei369/Panda-Learning-1/7fb36bb623a44298c059508ba3985eae227b7fc3/windows不能运行时安装/目录说明.txt
--------------------------------------------------------------------------------
/树莓派版使用说明.md:
--------------------------------------------------------------------------------
1 | 说明:
2 | 下面的运行环境是:树莓派3B+,系统为Raspbian Stretch Lite,Kernel version:4.14
3 |
4 | 第一步:更改系统镜像源,推荐清华镜像,速度快
5 | 1.1编辑/etc/apt/sources.list文件:
6 | deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
7 | deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
8 | 1.2编辑/etc/apt/sources.list.d/raspi.list文件:
9 | deb http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
10 | deb-src http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
11 | 2.更新源
12 | sudo update
13 | sudo upgrade
14 |
15 | 第二步:下载安装chromium和chromedriver及xvfb
16 | 1.下载网址:https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/pool/main/c/chromium-browser/
17 | 下载chromium-browser-l10n_72.0.3626.121-0+rpt3_all.deb和chromium-chromedriver_72.0.3626.121-0+rpt3_armhf.deb
18 | 注意:可以不下载这个版本,但是要保持版本一致,不要因为版本冲突不匹配使程序跑不起来。
19 | 2.安装软件,使用指令
20 | sudo dpkg -i ***.deb
21 | 先后安装chromium和chromedriver,注意安装chromium时会出现依赖关系问题,出现问题后,使用以下命令后再使用dpkg指令安装。
22 | sudo apt-get -f -y install
23 | 3.安装xvfb
24 | sudo apt-get install xvfb
25 |
26 | 第三步:直接运行程序
27 | 切换至pandalearning-pi当前目录
28 | ./pandalearning-pi
29 |
30 | 如果有问题欢迎在楼主[Issues#143](https://github.com/Alivon/Panda-Learning/issues/143)上提问。
31 |
32 |
--------------------------------------------------------------------------------