kajweb / wqxuetang_downloader

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

报错,一脸懵逼,咋修复 #40

Closed motoyeart closed 4 years ago

motoyeart commented 4 years ago

Traceback (most recent call last): File "main.py", line 22, in book = wqxtDownloader( bid ); File "c:\1\wqxtDownloader.py", line 34, in init self.name = bookInfo['name']; TypeError: list indices must be integers or slices, not str

构造函数

def __init__( self, bid ):
    # 储存输入列表
    self.bid = bid;
    self.jwt_key = self.getJwtKey();
    bookInfo = self.initread();

    self.name = bookInfo['name'];

    self.page = int(bookInfo['pages']);

    self.kData = self.getK();
    folder = self.getFolder();
    self.createFolder( folder );
    self.folder = folder;
    self.catatree = self.getCatatree();
    self.invalidpic = self.getInvalidPicInfo();

这一块没改动,咋还报错了,咋修复。好像是数据类型出错了,。

marzaha commented 4 years ago

你没登录

kajweb commented 4 years ago

Cookies没有替换好,导致登录失败。或者bid获取失败。

motoyeart commented 4 years ago

Cookies没有替换好,导致登录失败。或者bid获取失败。

PHPSESSID={Here Input You Cookies}---------搞了半天我括号没去除掉,谢谢。