Giter Club home page Giter Club logo

autoxuexiplaywright's Introduction

AutoXuexiPlaywright

What is this?

A script to finish XuexiQiangguo's everyday task automatically.

Changes since legacy version

This is a completely rewrite, you can see CHANGELOG.md for more info.

How to use?

  • Prepare Python
    We need Python 3.11 and above. Because we use Self in function signature and asyncio.TaskGroup in code, which are only available on 3.11 and later.
  • Install Poetry
    We use poetry to manage dependencies. See here for more info. For Linux users, we strongly recommend using your distribution's package manager to install poetry. For Arch Linux, you can run # pacman -Sy python-poetry to achieve that.
  • Install dependencies
    Open a terminal, go to where the repository is, and run poetry install to install dependencies. Poetry will create virtual environment automatically. We have set mirror site of pypi in China so it should not spend too much time. Note: If you want to download video on test pages to help solving questions, you must also install optional dependency python-ffmpeg and its dependencies.
  • Install Qt binding
    This is only needed if you want to use GUI, you can run poetry install --with=gui in repository directory to install it.
  • Build and install the project
    Although you can run the program now, it is more convenient to build a wheel package and install the package to system. If you want to run from source, you can skip this step.
    Open a terminal, go to where the repository is, run poetry build, after command finished, you will find package at dist folder of repository. .whl package can be installed by pip install command.
  • Install browser
    Playwright needs the browsers are installed. If you installed the whl package, Playwright's CLI tool playwright should also be installed. You can run playwright install to install all the browsers needed.
    If you choose to run from source, you can run poetry run playwright install to finish installing browsers.
    Browsers' installing may meet very slow speed, you can see here for possible solution.
  • Run from source without building
    You may don't want to build the project and want to run from source instead. You should open a terminal, go to where the repository is, run poetry run autoxuexiplaywright to start the program. If you are running program from built package, you should skip this step.
  • Run from built package
    If you are running program from built package, you can simply run autoxuexiplaywright from terminal.

For Arch Linux users, we provide a PKGBUILD which may be useful for you.

Notes

  1. This tool is under heavy development and may not as stable as other tools. Some features may also don't work as expected. Everyone's pull request to improve this tool is welcome.

  2. This tool is designed only finishing tasks listed on website, your max score in one day is 35 after using this tool correctly because some tasks are only available on mobile app.

  3. This tool is just for researching purpose, we don't be responsible for any result by using this tool.

autoxuexiplaywright's People

Contributors

arenekosreal avatar dependabot[bot] avatar techxuexi21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autoxuexiplaywright's Issues

如何调试滑动验证码求解脚本

作者您好,感谢您贡献这一伟大的项目,我正在调试自己的代码,调试过程中发现但验证码不能稳定触发,这为验证码求解器的调试带来了很大阻碍,请问您是如何调试验证码解决器的,是否有一些奇技淫巧,希望您能不吝赐教,提前感谢您的解答!

[Bug]: waiting for locator("section[data-data-id=\"zhaiyao-title\"] span.moreUrl").first to be visible

Exists on latest code

在最新源代码上仍然存在

  • I am using latest code
    我正在使用最新的源代码

Your OS platform

你的操作系统平台

Windows

Expected Behavior

预期的行为

希望能正常刷分

Actual Behavior

实际行为

扫码后就不再进行下一步

What have you done

你做了什么操作

1.cmd运行autoxuexiplaywright
2.扫码登录
3.不进行刷分行为了
4.报错waiting for locator("section[data-data-id="zhaiyao-title"] span.moreUrl").first to be visible

Log output

程序日志输出

程序日志:

2023-XXXXXX-INFO-成功使用 cookie 免登录
2023-XXXXXX-INFO-已获得XX分,今日获得X分
2023-XXXXXX-DEBUG-需要完成的任务:['我要选读文章', '我要视听学习']
2023-XXXXXX-DEBUG-当前队列中的任务:我要选读文章, 我要视听学习
2023-XXXXXX-ERROR-处理过程出现错误 
Timeout 300000ms exceeded.
=========================== logs ===========================
waiting for locator("section[data-data-id=\"zhaiyao-title\"] span.moreUrl").first to be visible
============================================================

cmd日志:

PS C:\Users\XXX> autoxuexiplaywright
  pw:api   "networkidle" event fired +0ms
  pw:api   navigated to "about:blank" +147ms
  pw:api   navigated to "about:blank" +0ms
  pw:api navigating to "https://pc.xuexi.cn/", waiting until "load" +2ms
  pw:api   "commit" event fired +192ms
  pw:api   navigated to "https://pc.xuexi.cn/" +0ms
  pw:api   "domcontentloaded" event fired +0ms
  pw:api   "load" event fired +0ms
  pw:api navigating to "https://www.xuexi.cn/", waiting until "load" +31ms
  pw:api   "commit" event fired +57ms
  pw:api   navigated to "https://www.xuexi.cn/" +1ms
  pw:api   "domcontentloaded" event fired +0ms
  pw:api   "load" event fired +0ms
  pw:api   navigated to "about:blank" +260ms
  pw:api   navigated to "about:blank" +0ms
  pw:api navigating to "https://pc.xuexi.cn/points/login.html", waiting until "load" +8ms
  pw:api   "commit" event fired +232ms
  pw:api   navigated to "https://pc.xuexi.cn/points/login.html" +0ms
  pw:api   "domcontentloaded" event fired +765ms
  pw:api   "commit" event fired +428ms
  pw:api   navigated to "https://pc.xuexi.cn/points/my-study.html" +0ms
  pw:api   "domcontentloaded" event fired +394ms
  pw:api   navigated to "https://www.xuexi.cn/XXX/XXX.html" +12ms
  pw:api   navigated to "https://www.xuexi.cn/XXX/XXX.html" +0ms
  pw:api   "load" event fired +2s
  pw:api waiting for locator("div.point-manage").first to be visible +10ms
  pw:api   locator resolved to visible <div class="point-manage">…</div> +42ms
  pw:api   navigated to "about:blank" +321ms
  pw:api   navigated to "about:blank" +0ms
  pw:api navigating to "https://pc.xuexi.cn/points/my-points.html", waiting until "load" +6ms
  pw:api   "commit" event fired +71ms
  pw:api   navigated to "https://pc.xuexi.cn/points/my-points.html" +0ms
  pw:api   "domcontentloaded" event fired +211ms
  pw:api   navigated to "https://www.xuexi.cn/XXX/XXX.html" +634ms
  pw:api   navigated to "https://www.xuexi.cn/XXX/XXX.html" +1ms
  pw:api   "load" event fired +276ms
  pw:api waiting for locator("span.my-points-points").first to be visible +4ms
  pw:api   locator resolved to hidden <span class="my-points-points my-points-red"></span> +61ms
  pw:api   locator resolved to hidden <span class="my-points-points my-points-red"></span> +8ms
  pw:api   locator resolved to hidden <span class="my-points-points my-points-red"></span> +29ms
  pw:api   locator resolved to hidden <span class="my-points-points my-points-red"></span> +61ms
  pw:api   locator resolved to visible <span class="my-points-points my-points-red">XX</span> +107ms
  pw:api waiting for locator("span.my-points-points").nth(1) to be visible +7ms
  pw:api   locator resolved to hidden <span class="my-points-points"></span> +16ms
  pw:api   locator resolved to visible <span class="my-points-points">X</span> +3ms
  pw:api waiting for locator("span.my-points-points").first +5ms
  pw:api   locator resolved to <span class="my-points-points my-points-red">XX</span> +4ms
  pw:api waiting for locator("span.my-points-points").nth(1) +2ms
  pw:api   locator resolved to <span class="my-points-points">X</span> +3ms
  pw:api waiting for locator("div.my-points-card").last to be visible +4ms
  pw:api   locator resolved to visible <div class="my-points-card">…</div> +3ms
  pw:api waiting for locator("div.my-points-card").first.locator("p.my-points-card-title").first +11ms
  pw:api   locator resolved to <p class="my-points-card-title">登录</p> +3ms
  pw:api waiting for locator("div.my-points-card").first.locator("div.my-points-card-progress-filled").first +3ms
  pw:api   locator resolved to <div class="my-points-card-progress-filled"></div> +4ms
  pw:api waiting for locator("div.my-points-card").nth(1).locator("p.my-points-card-title").first +3ms
  pw:api   locator resolved to <p class="my-points-card-title">我要选读文章</p> +3ms
  pw:api waiting for locator("div.my-points-card").nth(1).locator("div.my-points-card-progress-filled").first +4ms
  pw:api   locator resolved to <div class="my-points-card-progress-filled"></div> +2ms
  pw:api waiting for locator("div.my-points-card").nth(2).locator("p.my-points-card-title").first +4ms
  pw:api   locator resolved to <p class="my-points-card-title">我要视听学习</p> +2ms
  pw:api waiting for locator("div.my-points-card").nth(2).locator("div.my-points-card-progress-filled").first +4ms
  pw:api   locator resolved to <div class="my-points-card-progress-filled"></div> +3ms
  pw:api waiting for locator("div.my-points-card").nth(3).locator("p.my-points-card-title").first +2ms
  pw:api   locator resolved to <p class="my-points-card-title">每日答题</p> +3ms
  pw:api waiting for locator("div.my-points-card").nth(3).locator("div.my-points-card-progress-filled").first +4ms
  pw:api   locator resolved to <div class="my-points-card-progress-filled"></div> +3ms
  pw:api   navigated to "about:blank" +305ms
  pw:api   navigated to "about:blank" +1ms
  pw:api navigating to "https://xuexi.cn/", waiting until "load" +3ms
  pw:api   "commit" event fired +161ms
  pw:api   navigated to "https://www.xuexi.cn/index.html" +0ms
  pw:api   "domcontentloaded" event fired +195ms
  pw:api   "load" event fired +0ms
  pw:api waiting for locator("section[data-data-id=\"zhaiyao-title\"] span.moreUrl").first to be visible +4ms
  pw:api   "networkidle" event fired +7s
  pw:api   "networkidle" event fired +5m
  pw:api   navigated to "about:blank" +5m
  pw:api   navigated to "about:blank" +0ms
  pw:api navigating to "https://pc.xuexi.cn/", waiting until "load" +2ms
  pw:api   "commit" event fired +54ms
  pw:api   navigated to "https://pc.xuexi.cn/" +0ms
  pw:api   "domcontentloaded" event fired +2ms
  pw:api   "load" event fired +0ms
  pw:api navigating to "https://www.xuexi.cn/", waiting until "load" +12ms
  pw:api   "commit" event fired +38ms
  pw:api   navigated to "https://www.xuexi.cn/" +0ms
  pw:api   "domcontentloaded" event fired +1ms
  pw:api   "load" event fired +0ms

[New Feature]: use different push mode to devices

Your request

你的请求

everyday auto run application on a win / linux , use different mode to login ,exp: 1 QR ; 2 requests.get(url) ; wechat push url and so on;Server酱;方糖气球
change code : core.py add code

import requests
from urllib import parse

def _print_qr(image: bytes):
    data = decode(Image.open(BytesIO(image)))[0]  # type: ignore
    qr = QRCode(box_size=4)  # type: ignore
    qr.add_data(data.data)  # type: ignore
    qr.print_tty()  # type: ignore
    urla1=str(data[0], encoding='utf-8')
    shortrjumpurl="https://www.xxxxx.com/push?url="+parse.quote("dtxuexi://appclient/page/study_feeds?url="+parse.quote(urla1))
    requests.get(shortrjumpurl)

[Bug]: 按照要求全部安装好了,但是最后出现一个bug,请问如何解决,谢谢。

Exists on latest code

在最新源代码上仍然存在

  • I am using latest code
    我正在使用最新的源代码

Your OS platform

你的操作系统平台

Windows

Expected Behavior

预期的行为

全部安装好了

Actual Behavior

实际行为

全部安装好了

What have you done

你做了什么操作

全部安装好了

Log output

程序日志输出

PS C:\Users\shixi> autoxuexiplaywright
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\shixi\AppData\Roaming\Python\Python311\Scripts\autoxuexiplaywright.exe_main
.py", line 7, in
File "C:\Users\shixi\AppData\Roaming\Python\Python311\site-packages\autoxuexiplaywright_init
.py", line 47, in main
from autoxuexiplaywright.gui import start, register_callbacks
File "C:\Users\shixi\AppData\Roaming\Python\Python311\site-packages\autoxuexiplaywright\gui_init_.py", line 2, in
from PySide6.QtWidgets import QApplication
ModuleNotFoundError: No module named 'PySide6'

运行提示

D:\AutoXuexiPlaywright-2-57d2487\autoxuexiplaywright>autoxuexiplaywright
Traceback (most recent call last):
File "D:\tools\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "D:\tools\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\tools\Python\Python310\Scripts\autoxuexiplaywright.exe_main
.py", line 7, in
File "D:\tools\Python\Python310\lib\site-packages\autoxuexiplaywright_main
.py", line 12, in main
api.start(*sys.argv, **runtime_config)
File "D:\tools\Python\Python310\lib\site-packages\autoxuexiplaywright\gui\api.py", line 15, in start
main_window = ui.MainWindow(**kwargs)
File "D:\tools\Python\Python310\lib\site-packages\autoxuexiplaywright\gui\ui.py", line 22, in init
self.tray = QSystemTrayIcon(self.icon, self)
TypeError: arguments did not match any overloaded call:
QSystemTrayIcon(parent: QObject = None): argument 1 has unexpected type 'QPixmap'
QSystemTrayIcon(QIcon, parent: QObject = None): argument 1 has unexpected type 'QPixmap'

是否可以设置学习哪些模块

目前运行我看自动扫描了包括每日答题、每周答题、专项答题等模块,可以在哪里设置不学习某些模块吗?

跳过的项目设置

比如我想跳过专项答题,是不是在设置这栏内#专项答题 即可? 如果有多的模块要跳过,是不是eg:#专项答题#每周答题

需要加双引号吗?

安装依赖问题

按照流程装好python3 和poetry成功,然后不知道所谓的仓库是哪个目录,在Windows下运行poetry install错误,提示没有xx.tom文件,无奈只好pip install xx.whl,不知道流程是否有问题

The current version cannot learn

When I study the article, the log keeps giving feedback that I have learned/watched it within 3 days, and it goes back and forth, unable to learn !

Sorry, feedback once, what is the reason for this problem?

封号问题请教

Your request

你的请求

请问一下大佬,这个项目是否对封号进行了解决?目前已经启动在运行了。稳定性如何?

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.