I hoped this fixes video uploading but nope
This commit is contained in:
parent
5d528b2435
commit
cb45fff054
@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><p style="vertical-align:middle;"><img src=":/icons/icon.svg" width="50"/><span style="font-weight:600;"> KShare</span> - The open source and cross platform screen sharing software</p><p>Version %0<br>Links: <a href="https://github.com/ArsenArsen/KShare">Source code</a>, <a href="https://github.com/ArsenArsen/KShare/issues">Issue tracker</a>, <a href="http://kshare.arsenarsen.com">Website</a>, <a href="https://patreon.com/arsen">Patreon</a></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/icons/icon.svg" width="50" style="vertical-align: middle;"/><span style=" font-weight:600; vertical-align:middle;"> KShare</span><span style=" vertical-align:middle;"> - The free and open source and cross platform screen sharing software</span></p><p>Version %0<br/>Links: <a href="https://github.com/ArsenArsen/KShare"><span style=" text-decoration: underline; color:#007af4;">Source code</span></a>, <a href="https://github.com/ArsenArsen/KShare/issues"><span style=" text-decoration: underline; color:#007af4;">Issue tracker</span></a>, <a href="http://kshare.arsenarsen.com"><span style=" text-decoration: underline; color:#007af4;">Website</span></a>, <a href="https://patreon.com/arsen"><span style=" text-decoration: underline; color:#007af4;">Patreon</span></a></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -3,18 +3,24 @@
|
||||
#include <QBuffer>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <formats.hpp>
|
||||
#include <io/ioutils.hpp>
|
||||
#include <notifications.hpp>
|
||||
#include <screenshotutil.hpp>
|
||||
|
||||
void ImgurUploader::doUpload(QByteArray byteArray, QString) {
|
||||
void ImgurUploader::doUpload(QByteArray byteArray, QString format) {
|
||||
if (byteArray.size() > 1e+7) {
|
||||
notifications::notify("KShare imgur Uploader ", "Failed upload! Image too big");
|
||||
return;
|
||||
}
|
||||
QString mime;
|
||||
if (formats::normalFormatFromName(format) != formats::Normal::None)
|
||||
mime = formats::normalFormatMIME(formats::normalFormatFromName(format));
|
||||
else
|
||||
mime = formats::recordingFormatMIME(formats::recordingFormatFromName(format));
|
||||
ioutils::postJson(QUrl("https://api.imgur.com/3/image"),
|
||||
QList<QPair<QString, QString>>()
|
||||
<< QPair<QString, QString>("Content-Type", "application/x-www-form-urlencoded")
|
||||
<< QPair<QString, QString>("Content-Type", mime.toLatin1())
|
||||
<< QPair<QString, QString>("Authorization", "Client-ID 8a98f183fc895da"),
|
||||
byteArray, [](QJsonDocument res, QByteArray, QNetworkReply *) {
|
||||
QString result = res.object()["data"].toObject()["link"].toString();
|
||||
|
Loading…
Reference in New Issue
Block a user