kajweb / wqxuetang_downloader

文泉学堂、悦读下载器 | 2020-02-16网站不再公益开放阅读,项目失效。
MIT License
219 stars 119 forks source link

报错,无法解决。谢谢 #28

Closed daxian1niubi closed 4 years ago

daxian1niubi commented 4 years ago

运行程序后报错,请问有没有方法可以解决?感谢!下载完全只是自己阅读,完全不会用于商业用途。

Traceback (most recent call last): File "main.py", line 19, in <module> book = wqxtDownloader( bid ); File "C:\Users\mayn\Desktop\文泉学堂下载器\wqxtDownloader.py", line 21, in __init__ self.name = bookInfo['name']; TypeError: list indices must be integers or slices, not str

kajweb commented 4 years ago

请根据最新指引重新替换相关文件

ynlsg commented 4 years ago

请问你怎么问题解决这个问题?我也遇到同样的问题@daxian1niubi

kajweb commented 4 years ago

1、main.py没有修改好 (main.py) 2、cookies没有替换好 (cookies.txt)

a2448116274 commented 4 years ago

请问可以说的详细点吗,我是小白,遇到一样的问题

kajweb commented 4 years ago

你发cookies的内容上来

kajweb commented 4 years ago

cookies.txt是不带括号的

a2448116274 commented 4 years ago

C:\Users\Administrator\Desktop\wqxuetang_downloader-master>python main.py 3199490 # Traceback (most recent call last): File "main.py", line 19, in book = wqxtDownloader( bid ); File "C:\Users\Administrator\Desktop\wqxuetang_downloader-master\wqxtDownloader.py", line 22, in init self.name = bookInfo['3199490']; TypeError: list indices must be integers or slices, not str

kajweb commented 4 years ago

cookies.txt

a2448116274 commented 4 years ago

我手动在文件夹里加了一个cookies。txt

LWP-Cookies-2.0

// Semicolon separated Cookie File // This file was generated by EditThisCookie // Details: http://www.cookiecentral.com/faq/#3.5 // Example: http://www.tutorialspoint.com/javascript/javascript_cookies.htm // URL: https://lib-nuanxin.wqxuetang.com/#/Book/3202765 Set-Cookie3: PHPSESSID={Here Input You Cookies}; path="/"; domain=.wqxuetang.com; path_spec; expires="0"; version=0

kajweb commented 4 years ago

ID={Here Input You Cookies}; 这里需要你自己替换的

kajweb commented 4 years ago

解决后麻烦回复。

a2448116274 commented 4 years ago

不好意思啊,还没有解决,不太明白这个cookies,在看那个网站学习,辛苦了,谢谢,我先弄一下,不会的明天问你吧------------------ 原始邮件 ------------------ 发件人: "kajweb"notifications@github.com 发送时间: 2020年2月5日(星期三) 晚上11:23 收件人: "kajweb/wqxuetang_downloader"wqxuetang_downloader@noreply.github.com; 抄送: "a2448116274"2635581258@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [kajweb/wqxuetang_downloader] 报错,无法解决。谢谢 (#28)

解决后麻烦回复。

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

a2448116274 commented 4 years ago

Set-Cookie3: PHPSESSID=name=https%3A//lib-nuanxin.wqxuetang.com/read/pdf/3199490;; path="/"; path="/";这是我加入的cookies,但是运行提示UserWarning: http.cookiejar bug!,请问是怎么回事呢,附运行结果: C:\Users\Administrator\Desktop\wqxuetang_downloader-master>python main.py 3199490 # C:\Users\Administrator\Desktop\wqxuetang_downloader-master\cookies.txt C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\http\cookiejar.py:1971: UserWarning: http.cookiejar bug! Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\http\cookiejar.py", line 1952, in _really_load domain_specified = domain.startswith(".") AttributeError: 'NoneType' object has no attribute 'startswith'

_warn_unhandled_exception() Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\http\cookiejar.py", line 1952, in _really_load domain_specified = domain.startswith(".") AttributeError: 'NoneType' object has no attribute 'startswith'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 13, in initUrllib(); File "C:\Users\Administrator\Desktop\wqxuetang_downloader-master\utils.py", line 15, in initUrllib cookie.load( cookies_file, ignore_discard=True, ignore_expires=True) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\http\cookiejar.py", line 1799, in load self._really_load(f, filename, ignore_discard, ignore_expires) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\http\cookiejar.py", line 1972, in _really_load raise LoadError("invalid Set-Cookie3 format file %r: %r" % http.cookiejar.LoadError: invalid Set-Cookie3 format file 'C:\Users\Administrator\Desktop\wqxuetang_downloader-master\cookies.txt': 'PHPSESSID={Here Input You Cookies};#LWP-Cookies-2.0'

kajweb commented 4 years ago

Set-Cookie3: PHPSESSID=name=https%3A//lib-nuanxin.wqxuetang.com/read/pdf/3199490;; path="/";

这里错了,你应该是不会获取cookies……你百度一下、、、获取后应该是26位英文或数字的

kajweb commented 4 years ago

还有,现在可以更新到最新版了。

a2448116274 commented 4 years ago

好的,谢谢

------------------ 原始邮件 ------------------ 发件人: "kajweb"<notifications@github.com>; 发送时间: 2020年2月6日(星期四) 中午12:44 收件人: "kajweb/wqxuetang_downloader"<wqxuetang_downloader@noreply.github.com>; 抄送: "梁芳玉"<2635581258@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [kajweb/wqxuetang_downloader] 报错,无法解决。谢谢 (#28)

Set-Cookie3: PHPSESSID=name=https%3A//lib-nuanxin.wqxuetang.com/read/pdf/3199490;; path="/";

这里错了,你应该是不会获取cookies……你百度一下、、、获取后应该是26位英文或数字的

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.