def slot_startDownload(self):
url = self.urlL_ineEdit.text()
path = self.save_path_lineEdit.text()
type = self.comboBox.currentIndex()
try:
if url is None or url.strip() == "":
QMessageBox.information(self, "??", "????????", QMessageBox.Yes)
elif not re.match('http:\/\/.*?\/', url):
QMessageBox.information(self, "??", "????????", QMessageBox.Yes)
elif path is None or path.strip() == "":
QMessageBox.information(self, "??", "??????????", QMessageBox.Yes)
else:
html = GetMezi._get_html(url)
soup = GetMezi._get_soup(html)
if self.TYPE_MORE == type:
albums = GetMezi._get_img_dirs(soup)
if None == albums:
QMessageBox.information(self, "??", "???????????????????????????????????????????", QMessageBox.Yes)
else:
QMessageBox.information(self, "??", "?????...", QMessageBox.Yes)
self.downloadButton.setDisabled(True)
self.bwThread = AlbumsThread(path, albums)
self.bwThread.finishSignal.connect(self.resetDownloadBtn)
self.bwThread.start()
elif self.TYPE_SINGLE == type:
title = GetMezi._get_page_title(soup)
QMessageBox.information(self, "??", "?????...", QMessageBox.Yes)
self.downloadButton.setDisabled(True)
self.bwThread = SingleAlbumThread(path, title, url)
self.bwThread.finishSignal.connect(self.resetDownloadBtn)
self.bwThread.start()
except Exception as e:
print(e)
QMessageBox.information(self, "??", "???‘????’?‘????’?????\n ??????????????\n ???http://www.mzitu.com/ \n ? http://www.mzitu.com/xinggan \n ????????????????\n http://www.mzitu.com/75636 ", QMessageBox.Yes)
评论列表
文章目录