Many thanks but unfortunately it did not work. Nevermind I will continue with Arena.
I was just interested to see if it worked with my Certabo board.
Banksia GUI released
Moderators: hgm, Rebel, chrisw
-
- Posts: 430
- Joined: Mon Apr 03, 2006 10:10 am
- Location: England
Re: Banksia GUI released
What's my next move? - to the fridge for another beer !!
-
- Posts: 853
- Joined: Thu Mar 09, 2006 4:50 pm
- Location: Austria
-
- Posts: 6340
- Joined: Mon Mar 13, 2006 2:34 pm
- Location: Acworth, GA
Re: Banksia GUI released
Live URLs do not appear to be working in Banksia. When I open a Live URL nothing happens. I tested it using PGN Mentor (Android App) using this URL from 'TheWeekInChess' : https://theweekinchess.com/assets/files ... agpa20.pgn
It works there, what it does is give me a PGN database of games from the event. I select the game I want to watch, and it updates the board with the current move as they are played.
However in Banksia when I input the URL nothing happens. It does not even appear to download the PGN file. I was wondering if I am doing something wrong.
Here is an example of live urls working in PGN Mentor. Click image for larger view.
Here is another example using Hiarcs Chess Explorer:
It works there, what it does is give me a PGN database of games from the event. I select the game I want to watch, and it updates the board with the current move as they are played.
However in Banksia when I input the URL nothing happens. It does not even appear to download the PGN file. I was wondering if I am doing something wrong.
Here is an example of live urls working in PGN Mentor. Click image for larger view.
Here is another example using Hiarcs Chess Explorer:
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
__________________________________________________________________
Ted Summers
-
- Posts: 6340
- Joined: Mon Mar 13, 2006 2:34 pm
- Location: Acworth, GA
Re: Banksia GUI released
I am sorry, I mean Chess PGN Master not MentorAdminX wrote: ↑Fri Jan 24, 2020 3:59 pm Live URLs do not appear to be working in Banksia. When I open a Live URL nothing happens. I tested it using PGN Mentor (Android App) using this URL from 'TheWeekInChess' : https://theweekinchess.com/assets/files ... agpa20.pgn
It works there, what it does is give me a PGN database of games from the event. I select the game I want to watch, and it updates the board with the current move as they are played.
However in Banksia when I input the URL nothing happens. It does not even appear to download the PGN file. I was wondering if I am doing something wrong.
Here is an example of live urls working in PGN Mentor. Click image for larger view.
Here is another example using Hiarcs Chess Explorer:
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
__________________________________________________________________
Ted Summers
-
- Posts: 1434
- Joined: Wed Apr 21, 2010 4:58 am
- Location: Australia
- Full name: Nguyen Hong Pham
Re: Banksia GUI released
Thanks a lot for the report. I have been working on this bug.AdminX wrote: ↑Fri Jan 24, 2020 3:59 pm Live URLs do not appear to be working in Banksia. When I open a Live URL nothing happens. I tested it using PGN Mentor (Android App) using this URL from 'TheWeekInChess' : https://theweekinchess.com/assets/files ... agpa20.pgn
==============================
OT:
This PGN file is strange/hard to download for me even I have tried many ways. I use QT QNetworkAccessManager to download. Usually, it works well with URLs, including SSL URLs. However, I can't download the above link. Program prints error: QNetworkReply::UnknownContentError and then "Not Acceptable".
Does anyone have experience/solution? I have tried to download it manually via web browsers, wget, curl... all work well but not my code
Thanks in advance.
The simplified code as below:
Code: Select all
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
public slots:
void downloadPgnUrlFinished(QNetworkReply *);
void downloadError(QNetworkReply::NetworkError);
void downloadPgnUrl(const QString&);
private:
QNetworkAccessManager manager;
};
////////////
MainWindow::MainWindow(QWidget *parent) :
ConnectWindow(parent)
{
connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(downloadPgnUrlFinished(QNetworkReply*)));
}
void MainWindow::downloadPgnUrl(const QString& urlString)
{
auto url = QUrl(urlString);
QNetworkRequest request(url);
if (urlString.startsWith("https")) {
auto sslConfig = QSslConfiguration::defaultConfiguration();
sslConfig.setProtocol(QSsl::AnyProtocol);
sslConfig.setPeerVerifyMode (QSslSocket::VerifyNone);
request.setSslConfiguration(sslConfig);
}
auto networkReply = manager.get(request);
connect(networkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(downloadError(QNetworkReply::NetworkError)));
}
void MainWindow::downloadError(QNetworkReply::NetworkError error)
{
qDebug() << "Error: " << error; // <- QNetworkReply::UnknownContentError
}
void MainWindow::downloadPgnUrlFinished(QNetworkReply *reply)
{
if (reply->error()) {
qDebug() << "Error: " << reply->errorString(); // <- "Not Acceptable"
} else {
auto text = QString::fromLocal8Bit(reply->readAll());
qDebug() << "Downloaded text: " << text;
}
delete reply;
}
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
The most features chess GUI, based on opensource Banksia - the chess tournament manager
-
- Posts: 560
- Joined: Sun Nov 08, 2015 11:10 pm
Re: Banksia GUI released
The link gives the following in response: "content-type: application/x-chess-pgn".
How does your library handle such uncommon MIME type? From the error message, it seems paranoid about it and you may want to find a way to handle it as "text/plain".
How does your library handle such uncommon MIME type? From the error message, it seems paranoid about it and you may want to find a way to handle it as "text/plain".
-
- Posts: 1434
- Joined: Wed Apr 21, 2010 4:58 am
- Location: Australia
- Full name: Nguyen Hong Pham
Re: Banksia GUI released
Thanks for the prompt help.noobpwnftw wrote: ↑Sun Jan 26, 2020 3:13 pm The link gives the following in response: "content-type: application/x-chess-pgn".
How does your library handle such uncommon MIME type? From the error message, it seems paranoid about it and you may want to find a way to handle it as "text/plain".
I have tried several ways but all didn't work with the same error (I commented out all code I have tried as below).
I think I use almost a low-level library thus I can control /read any data. If I use the wrong content type, I should not get the error.
Code: Select all
...
// request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("text/plain"));
// request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-chess-pgn"));
// request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded"));
request.setRawHeader("content-type", "text/plain");
// request.setRawHeader("Accept", "*/*");
auto networkReply = manager.get(request);
...
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
The most features chess GUI, based on opensource Banksia - the chess tournament manager
-
- Posts: 560
- Joined: Sun Nov 08, 2015 11:10 pm
Re: Banksia GUI released
If this is HTTP code 406 from the server, then you might want to add more "Accept-???" headers as per curl or wget sends in your request.
-
- Posts: 1434
- Joined: Wed Apr 21, 2010 4:58 am
- Location: Australia
- Full name: Nguyen Hong Pham
Re: Banksia GUI released
It didn't work, same error.noobpwnftw wrote: ↑Sun Jan 26, 2020 3:44 pm If this is HTTP code 406 from the server, then you might want to add more "Accept-???" headers as per curl or wget sends in your request.
It is strange that when I copied the PGN file to my website, using SSL too, my download code works very well with any header.
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
The most features chess GUI, based on opensource Banksia - the chess tournament manager
-
- Posts: 6340
- Joined: Mon Mar 13, 2006 2:34 pm
- Location: Acworth, GA
Re: Banksia GUI released
I am sure you probably have seen this documentation already, if not it might help.
https://doc.qt.io/qt-5/qnetworkaccessmanager.html
https://doc.qt.io/qt-5/qnetworkaccessmanager.html
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
__________________________________________________________________
Ted Summers