Skip to content

Commit

Permalink
bump version to 6.3.0, close #64
Browse files Browse the repository at this point in the history
  • Loading branch information
leovan committed May 12, 2024
1 parent 782851e commit 364d86e
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 33 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [6.3.0](https://github.com/leovan/SciHubEVA/compare/v6.2.5...v6.3.0) (2024-05-12)

### Features

- Add failed queries exporting.

## [6.2.5](https://github.com/leovan/SciHubEVA/compare/v6.2.4...v6.2.5) (2024-02-06)

### Tests
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ Range pattern in query is supported, e.g. `00.000/{1-99}` will download `00.000/

Also you can download with a query list file, in which each line represents a query. Click `Load` button to load the query list file.

Right clicking the log area will popup menu, you can open the log file or log directory.
Right clicking the `Logs` area will popup menu, you can open the log file or log directory and export failed queries.

![](docs/images/scihub-eva-log-area-popup-menu-en.png)

Click <img style="width: 24px; vertical-align: middle;" src="images/icons/information.svg"> will show the `About` dialog.

Expand Down
2 changes: 1 addition & 1 deletion building/Windows/SciHubEVA-x86_64.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Sci-Hub EVA"
#define MyAppVersion "6.2.5"
#define MyAppVersion "6.3.0"
#define MyAppPublisher "Leo Van"
#define MyAppURL "https://github.com/leovan/SciHubEVA"
#define MyAppExeName "SciHubEVA.exe"
Expand Down
8 changes: 4 additions & 4 deletions building/Windows/SciHubEVA.win.version
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VSVersionInfo(
ffi=FixedFileInfo(
filevers=(6, 2, 5, 0),
prodvers=(6, 2, 5, 0),
filevers=(6, 3, 0, 0),
prodvers=(6, 3, 0, 0),
mask=0x3f,
flags=0x0,
OS=0x4,
Expand All @@ -16,12 +16,12 @@ VSVersionInfo(
u'040904B0',
[StringStruct(u'CompanyName', u'leovan.tech'),
StringStruct(u'FileDescription', u'Sci-Hub EVA'),
StringStruct(u'FileVersion', u'6.2.5.0'),
StringStruct(u'FileVersion', u'6.3.0.0'),
StringStruct(u'InternalName', u'SciHubEVA'),
StringStruct(u'LegalCopyright', u'\xa9 2018-2024 Leo Van.'),
StringStruct(u'OriginalFilename', u'SciHubEVA.exe'),
StringStruct(u'ProductName', u'Sci-Hub EVA'),
StringStruct(u'ProductVersion', u'6.2.5.0')])
StringStruct(u'ProductVersion', u'6.3.0.0')])
]),
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
]
Expand Down
2 changes: 1 addition & 1 deletion building/macOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>MacOS/Sci-Hub EVA</string>
<key>CFBundleShortVersionString</key>
<string>6.2.5</string>
<string>6.3.0</string>
<key>LSBackgroundOnly</key>
<string>0</string>
<key>CFBundleName</key>
Expand Down
Binary file added docs/images/scihub-eva-log-area-popup-menu-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions i18n/SciHubEVA_pt_PT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,16 @@
<translation>Registros: </translation>
</message>
<message>
<source>Open Log File</source>
<translation>Abrir Ficheiro de Registro</translation>
<source>Open log file</source>
<translation>Abrir ficheiro de registro</translation>
</message>
<message>
<source>Open Log Directory</source>
<translation>Abrir Localização do Registro</translation>
<source>Open log directory</source>
<translation>Abrir localização do registro</translation>
</message>
<message>
<source>Export failed queries</source>
<translation>Exportar consultas com falha</translation>
</message>
</context>
<context>
Expand Down
20 changes: 12 additions & 8 deletions i18n/SciHubEVA_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
</message>
<message>
<source>Query type: </source>
<translation>搜索类型: </translation>
<translation>查询类型: </translation>
</message>
<message>
<source>Fetching PDF URL ...</source>
Expand Down Expand Up @@ -245,7 +245,7 @@
</message>
<message>
<source>Dealing with query: </source>
<translation>正在处理搜索: </translation>
<translation>正在处理查询: </translation>
</message>
<message>
<source>Wrong captcha, failed to kill Angel [CAPTCHA]!</source>
Expand All @@ -260,11 +260,11 @@
</message>
<message>
<source>Query: </source>
<translation>搜索: </translation>
<translation>查询: </translation>
</message>
<message>
<source>URL, PMID, DOI, Title or Query List File</source>
<translation>URL, PMID, DOI, 标题或搜索列表文件</translation>
<translation>URL, PMID, DOI, 标题或查询列表文件</translation>
</message>
<message>
<source>Rampage</source>
Expand All @@ -276,7 +276,7 @@
</message>
<message>
<source>Please set the query!</source>
<translation>请设置搜索内容!</translation>
<translation>请设置查询内容!</translation>
</message>
<message>
<source>Load</source>
Expand All @@ -299,13 +299,17 @@
<translation>日志: </translation>
</message>
<message>
<source>Open Log File</source>
<source>Open log file</source>
<translation>打开日志文件</translation>
</message>
<message>
<source>Open Log Directory</source>
<source>Open log directory</source>
<translation>打开日志目录</translation>
</message>
<message>
<source>Export failed queries</source>
<translation>导出失败查询</translation>
</message>
</context>
<context>
<name>UICaptcha</name>
Expand All @@ -318,7 +322,7 @@
<name>UISciHubEVA</name>
<message>
<source>Query list file is not a text file!</source>
<translation>搜索列表文件不是一个文本文件!</translation>
<translation>查询列表文件不是一个文本文件!</translation>
</message>
<message>
<source>Dealing with {}/{} query ...</source>
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
docopt==0.6.2
flask==3.0.2
flask==3.0.3
opencc-python-reimplemented==0.1.7
pyinstaller==6.3.0
pyinstaller==6.6.0
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
darkdetect==0.8.0
lxml==5.1.0
lxml==5.2.1
pathvalidate==3.2.0
pdfminer.six==20231228
PySide6==6.6.1
PySide6==6.7.0
PySocks==1.7.1
requests==2.31.0
urllib3==2.2.0
urllib3==2.2.1
2 changes: 1 addition & 1 deletion scihub_eva/api/scihub_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def rampage(self, query, rampage_type):

def run(self):
res, err = self.rampage(self._query, self._rampage_type)
self._callback(res, err)
self._callback(self._raw_query, res, err)


__all__ = [
Expand Down
8 changes: 4 additions & 4 deletions scihub_eva/globals/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

NETWORK_SCIHUB_URLS_KEY = 'Network/SciHubURLs'
NETWORK_SCIHUB_URLS_DEFAULT = [
'https://www.sci-hub.se',
'https://sci-hub.ren',
'https://www.sci-hub.ru',
'https://sci-hub.se',
'https://sci-hub.st',
'https://sci-hub.ru',
]

NETWORK_TIMEOUT_KEY = 'Network/Timeout'
Expand All @@ -37,7 +37,7 @@
NETWORK_USER_AGENT_DEFAULT = (
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' +
'AppleWebKit/537.36 (KHTML, like Gecko) ' +
'Chrome/121.0.0.0 ' +
'Chrome/124.0.0.0 ' +
'Safari/537.36'
)

Expand Down
2 changes: 1 addition & 1 deletion scihub_eva/globals/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
ORGANIZATION_NAME = 'LeoVan'
ORGANIZATION_DOMAIN = 'leovan.tech'
APPLICATION_NAME = 'SciHubEVA'
APPLICATION_VERSION = 'v6.2.5'
APPLICATION_VERSION = 'v6.3.0'
19 changes: 18 additions & 1 deletion scihub_eva/ui/scihub_eva.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def __init__(self):
self._query_list = None
self._query_list_length = 0
self._captcha_img_file_path = None
self._failed_queries = set()

self._save_to_dir = Preferences.get_or_default(
FILE_SAVE_TO_DIR_KEY, FILE_SAVE_TO_DIR_DEFAULT)
Expand All @@ -72,6 +73,7 @@ def _connect(self):
self._window.systemOpenLogFile.connect(self.system_open_log_file)
self._window.systemOpenLogDirectory.connect(
self.system_open_log_directory)
self._window.exportFailedQueries.connect(self.export_failed_queries)
self._window.rampage.connect(self.rampage)

self.set_save_to_dir.connect(self._window.setSaveToDir)
Expand Down Expand Up @@ -103,6 +105,14 @@ def system_open_log_file(self):
def system_open_log_directory(self):
open_directory(DEFAULT_LOG_DIRECTORY)

@Slot(str)
def export_failed_queries(self, path):
with open(path, 'wt') as f:
for failed_query in self._failed_queries:
f.write(failed_query + '\n')

self._failed_queries.clear()

@Slot(str)
def rampage(self, raw_query):
scihub_url = Preferences.get_or_default(
Expand Down Expand Up @@ -166,7 +176,14 @@ def rampage_with_typed_captcha(self, captcha_answer):
self.before_rampage.emit()
self._scihub_api.start()

def rampage_callback(self, res, err):
def rampage_callback(self, raw_query, res, err):
if (err == SciHubAPIError.UNKNOWN or
err == SciHubAPIError.WRONG_CAPTCHA or
err == SciHubAPIError.NO_VALID_PDF):
self._failed_queries.add(raw_query)
elif err is None:
self._failed_queries.discard(raw_query)

if err == SciHubAPIError.BLOCKED_BY_CAPTCHA:
self.show_captcha(res)
elif self._query_list:
Expand Down
32 changes: 30 additions & 2 deletions ui/SciHubEVA.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ApplicationWindow {
signal showUIPreference()
signal systemOpenLogFile()
signal systemOpenLogDirectory()
signal exportFailedQueries(string path)
signal rampage(string query)

function setSaveToDir(directory) {
Expand Down Expand Up @@ -112,6 +113,28 @@ ApplicationWindow {
}
}

Platform.FileDialog {
id: fileDialogExportFailedQueries

fileMode: Platform.FileDialog.SaveFile
defaultSuffix: "txt"

onAccepted: {
var failedQueriesURI = fileDialogExportFailedQueries.file.toString()

switch (Qt.platform.os) {
case "windows":
failedQueriesURI = failedQueriesURI.replace(/^(file:\/{3})/, "")
break
default:
failedQueriesURI = failedQueriesURI.replace(/^(file:\/{2})/, "")
break
}

exportFailedQueries(failedQueriesURI)
}
}

background: Image {
source: {
switch(Material.theme) {
Expand Down Expand Up @@ -308,14 +331,19 @@ ApplicationWindow {
id: menuLogs

Platform.MenuItem {
text: qsTr("Open Log File")
text: qsTr("Open log file")
onTriggered: systemOpenLogFile()
}

Platform.MenuItem {
text: qsTr("Open Log Directory")
text: qsTr("Open log directory")
onTriggered: systemOpenLogDirectory()
}

Platform.MenuItem {
text: qsTr("Export failed queries")
onTriggered: fileDialogExportFailedQueries.open()
}
}
}
}
Expand Down

0 comments on commit 364d86e

Please sign in to comment.