Skip to content

Commit

Permalink
更改endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesuiry committed Nov 16, 2021
1 parent e3b5beb commit 33defde
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 48 deletions.
31 changes: 14 additions & 17 deletions account_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ def __init__(self, cookie):

def generate_data_xls(self):
next_url = FILE_QUERY_URL
book = xlwt.Workbook(encoding="utf-8", style_compression=0)
sheet = book.add_sheet('test01', cell_overwrite_ok=True)
sheet.write(0, 0, '标题')
sheet.write(0, 1, '价格')
sheet.write(0, 2, '创建时间')
sheet.write(0, 3, '编号')
sheet.write(0, 4, '下载地址')
sheet.write(0, 5, '简介')
row = 1
titles = ['标题', '价格', '创建时间', '编号', '下载地址', '简介']
while next_url:
print(next_url)
res = requests.get(next_url, cookies=self.cookie)
Expand All @@ -38,22 +30,27 @@ def generate_data_xls(self):
result = data['results']
if len(result) < 1:
break
write_datas = []
row = 0
for file_data in result:
sheet.write(row, 0, file_data.get('title', ''))
sheet.write(row, 1, file_data.get('money', 0) / 100)
sheet.write(row, 2, file_data.get('c_time', ''))
sheet.write(row, 3, file_data.get('pk', 0))
sheet.write(row, 4, f"https://www.jiandanmaimai.cn/file/{file_data.get('pk', '')}/")
sheet.write(row, 5, file_data.get('markdown_describe', ''))
write_data = []
write_data.append(file_data.get('title', ''))
write_data.append(file_data.get('money', 0) / 100)
write_data.append(file_data.get('c_time', ''))
write_data.append(file_data.get('pk', 0))
write_data.append(f"https://www.jiandanmaimai.cn/file/{file_data.get('pk', '')}/")
write_data.append(file_data.get('markdown_describe', ''))
row += 1
time.sleep(0.1)
self.log_signal.emit(f"正在写入第{row}条数据:{file_data.get('title', '')} 编号:{file_data.get('pk', 0)}")
write_xlsx(titles, write_datas, add=True, file_path='account_file.xlsx')
self.log_signal.emit(f"正在写入第{row}条数据:{file_data.get('title', '')} 编号:{file_data.get('pk', 0)}")

if next_next_url == next_url:
break
else:
next_url = next_next_url
book.save(FILE_XLS_FILE)
if row > 1e2:
break
self.log_signal.emit(f"已经写入完成 共计{row}条数据")

def run(self):
Expand Down
30 changes: 1 addition & 29 deletions client.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="mainTab">
<property name="currentIndex">
<number>4</number>
<number>3</number>
</property>
<widget class="QWidget" name="loginTab">
<attribute name="title">
Expand Down Expand Up @@ -542,34 +542,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="accountInfoTab">
<attribute name="title">
<string>账号管理页</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<widget class="QPushButton" name="generate_file_xls_btn">
<property name="text">
<string>导出当前所有文件的xls信息</string>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_33">
<property name="text">
<string>调试信息</string>
</property>
</widget>
</item>
<item>
<widget class="QTextBrowser" name="account_info_log_text"/>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="prepubTab">
<attribute name="title">
<string>文件预发布</string>
Expand Down
2 changes: 1 addition & 1 deletion common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import openpyxl

# END_POINT = R'http://api.jiandanmaimai.cn'
END_POINT = R'https://www.jiandanmaimai.cn'
END_POINT = R'https://www.jdmm.top'
HEAD_STRUCT = bytes('128sIq32s', encoding='utf-8')
FILE_UPLOAD_URL = f'{END_POINT}/file/api/files/'
CLIENT_INFO_URL = f'{END_POINT}/file/api/client/'
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self):
self.on_login_btn_clicked()

self.file_server = JdmmFileServer(self.window, self)
self.account_manager = AccountManager(self.window, self)
# self.account_manager = AccountManager(self.window, self)
self.prepub = PrepubWidget(self.window, self)

def login_btn_process(self, res):
Expand Down

0 comments on commit 33defde

Please sign in to comment.