Giter Site home page Giter Site logo

Comments (9)

nicoxiang avatar nicoxiang commented on July 18, 2024

好建议。另外下载超时日志能否提供下?windows 应该在 %AppData%\geektime-downloader 下的 log 文件里。网络正常情况应该不会超时,反爬虫会有额外的错误输出的

from geektime-downloader.

L-Super avatar L-Super commented on July 18, 2024

找到的日志如下:

time="2022-09-22T15:17:46+08:00" level=error msg="An error occurred" func=github.com/nicoxiang/geektime-downloader/internal/pkg/logger.Error file="github.com/nicoxiang/geektime-downloader/internal/pkg/logger/logger.go:58" error="unknown shorthand flag: '2' in -2"
time="2022-09-22T15:17:56+08:00" level=error msg="An error occurred" func=github.com/nicoxiang/geektime-downloader/internal/pkg/logger.Error file="github.com/nicoxiang/geektime-downloader/internal/pkg/logger/logger.go:58" error="unknown shorthand flag: '2' in -2"
time="2022-09-22T15:19:58+08:00" level=error msg="Request Timeout" func=github.com/nicoxiang/geektime-downloader/internal/pkg/logger.Error file="github.com/nicoxiang/geektime-downloader/internal/pkg/logger/logger.go:58" error="context deadline exceeded (Client.Timeout or context cancellation while reading body)"
time="2022-09-22T15:25:57+08:00" level=error msg="Request Timeout" func=github.com/nicoxiang/geektime-downloader/internal/pkg/logger.Error file="github.com/nicoxiang/geektime-downloader/internal/pkg/logger/logger.go:58" error="context deadline exceeded (Client.Timeout or context cancellation while reading body)"
time="2022-09-22T15:39:27+08:00" level=error msg="Request Timeout" func=github.com/nicoxiang/geektime-downloader/internal/pkg/logger.Error file="github.com/nicoxiang/geektime-downloader/internal/pkg/logger/logger.go:58" error="context deadline exceeded (Client.Timeout or context cancellation while reading body)"

from geektime-downloader.

nicoxiang avatar nicoxiang commented on July 18, 2024

.\geektime-downloader.exe -u "" -id "课程id"

这个我后面想了下,之前我考虑过这种做法。当时提供输入的原因是填完课程 id 后进入下一个选择列表后可以返回上一级重新输入课程id,并且下载某个课程的所有文字/视频后也可以重新输入课程id,不用重启命令行,所以当时做了这样的设计。

from geektime-downloader.

nicoxiang avatar nicoxiang commented on July 18, 2024

context deadline exceeded (Client.Timeout or context cancellation while reading body)

这个就是标准下载超时的输出,看不出来具体的原因,网络不好的情况都是出现,暂时不太好排查,如果有比较好的建议可以提出来,感谢。

from geektime-downloader.

L-Super avatar L-Super commented on July 18, 2024

.\geektime-downloader.exe -u "" -id "课程id"

这个我后面想了下,之前我考虑过这种做法。当时提供输入的原因是填完课程 id 后进入下一个选择列表后可以返回上一级重新输入课程id,并且下载某个课程的所有文字/视频后也可以重新输入课程id,不用重启命令行,所以当时做了这样的设计。

但实际体验并不好,因为下载较多节数专栏时,容易触发限流等问题,就需要重新登录。于是一直会重复以下流程

限流 - 重新执行 - 重新登录 - 输入密码 - 输入课程id - 选中下载全部

另外,好像并没有成功记住密码,所以我每次都需要输入密码登录。

功能很好,但实际使用体验,不理想,重复步骤太多,所以个人认为,重复步骤可以省略为以下流程,会极大提升便捷性

限流 - 重新执行命令行

from geektime-downloader.

nicoxiang avatar nicoxiang commented on July 18, 2024

.\geektime-downloader.exe -u "" -id "课程id"
这个我后面想了下,之前我考虑过这种做法。当时提供输入的原因是填完课程 id 后进入下一个选择列表后可以返回上一级重新输入课程id,并且下载某个课程的所有文字/视频后也可以重新输入课程id,不用重启命令行,所以当时做了这样的设计。

但实际体验并不好,因为下载较多节数专栏时,容易触发限流等问题,就需要重新登录。于是

嗯,这个确实是个不好的点,我再考虑下,感谢建议。

from geektime-downloader.

L-Super avatar L-Super commented on July 18, 2024

话还没说完,就误发出去了😂,希望能看到完整回复

from geektime-downloader.

nicoxiang avatar nicoxiang commented on July 18, 2024

限流 - 重新执行命令行

这个其实是记住 cookie 的,只是代码里做了清除保存的 cookie,重新输入密码才记录新 cookie,如果不要求用户输入,会出现这样的情况:

  1. 首次输入密码,保存 cookie 到本地
  2. 退出程序
    3.第二次进入程序,不需要输入密码,使用 cookie 登录
    4.发生限流
    5.此时无法读到密码,只能读到旧 cookie,所以无法重新生成新 cookie,所以这里才会要求重新输入密码

我也不想直接把密码存本地,这肯定不安全

from geektime-downloader.

github-actions avatar github-actions commented on July 18, 2024

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

from geektime-downloader.

Related Issues (20)

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.