fixed #6715: Removed Teknik uploader

This commit is contained in:
Jaex 2023-08-07 08:24:07 +03:00
parent 11d2c358db
commit 9e63193d0a
13 changed files with 37 additions and 1222 deletions

View file

@ -55,8 +55,6 @@ internal static partial class APIKeys
public static readonly string OneDriveClientSecret = "";
public static readonly string GfycatClientID = "";
public static readonly string GfycatClientSecret = "";
public static readonly string TeknikClientID = "";
public static readonly string TeknikClientSecret = "";
// URL shorteners
public static readonly string BitlyClientID = "";

View file

@ -64,8 +64,6 @@ public enum TextDestination
Paste_ee,
[Description("GitHub Gist")]
Gist,
[Description("Teknik")]
Teknik,
[Description("uPaste")]
Upaste,
[Description("Hastebin")]
@ -119,8 +117,6 @@ public enum FileDestination
Jira,
[Description("Lambda")]
Lambda,
[Description("Teknik")]
Teknik,
[Description("Pomf")]
Pomf,
[Description("Uguu")]
@ -165,8 +161,6 @@ public enum UrlShortenerType
AdFly,
[Description("qr.net")]
QRnet,
[Description("tknk.io")]
Teknik,
[Description("vurl.com")]
VURL,
[Description("2.gp")]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -1,276 +0,0 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2023 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using Newtonsoft.Json;
using ShareX.HelpersLib;
using ShareX.UploadersLib.Properties;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
namespace ShareX.UploadersLib.FileUploaders
{
public class TeknikFileUploaderService : FileUploaderService
{
public override FileDestination EnumValue { get; } = FileDestination.Teknik;
public override Icon ServiceIcon => Resources.Teknik;
public override bool CheckConfig(UploadersConfig config)
{
return !string.IsNullOrEmpty(config.TeknikUploadAPIUrl) &&
!string.IsNullOrEmpty(config.TeknikAuthUrl) &&
OAuth2Info.CheckOAuth(config.TeknikOAuth2Info);
}
public override GenericUploader CreateUploader(UploadersConfig config, TaskReferenceHelper taskInfo)
{
return new TeknikUploader(config.TeknikOAuth2Info, config.TeknikAuthUrl)
{
APIUrl = config.TeknikUploadAPIUrl,
ExpirationUnit = config.TeknikExpirationUnit,
ExpirationLength = config.TeknikExpirationLength,
Encryption = config.TeknikEncryption,
GenerateDeletionKey = config.TeknikGenerateDeletionKey
};
}
public override TabPage GetUploadersConfigTabPage(UploadersConfigForm form) => form.tpTeknik;
}
public enum TeknikExpirationUnit
{
Never,
Views,
Minutes,
Hours,
Days,
Months,
Years
}
public class Teknik : Uploader, IOAuth2
{
public const string DefaultUploadAPIURL = "https://api.teknik.io/v1/Upload";
public const string DefaultPasteAPIURL = "https://api.teknik.io/v1/Paste";
public const string DefaultUrlShortenerAPIURL = "https://api.teknik.io/v1/Shorten";
public const string DefaultAuthURL = "https://auth.teknik.io";
public OAuth2Info AuthInfo { get; set; }
public string AuthUrl { get; set; }
public Teknik(OAuth2Info oauth, string authUrl)
{
AuthInfo = oauth;
AuthUrl = authUrl;
}
public bool RefreshAccessToken()
{
if (OAuth2Info.CheckOAuth(AuthInfo) && !string.IsNullOrEmpty(AuthInfo.Token.refresh_token))
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("refresh_token", AuthInfo.Token.refresh_token);
args.Add("client_id", AuthInfo.Client_ID);
args.Add("client_secret", AuthInfo.Client_Secret);
args.Add("grant_type", "refresh_token");
string response = SendRequestURLEncoded(HttpMethod.POST, AuthUrl + "/connect/token", args);
if (!string.IsNullOrEmpty(response))
{
OAuth2Token token = JsonConvert.DeserializeObject<OAuth2Token>(response);
if (token != null && !string.IsNullOrEmpty(token.access_token))
{
token.UpdateExpireDate();
AuthInfo.Token = token;
return true;
}
}
}
return false;
}
public bool CheckAuthorization()
{
if (OAuth2Info.CheckOAuth(AuthInfo))
{
if (AuthInfo.Token.IsExpired && !RefreshAccessToken())
{
Errors.Add("Refresh access token failed.");
return false;
}
}
else
{
Errors.Add("Teknik login is required.");
return false;
}
return true;
}
public bool GetAccessToken(string code)
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("client_id", AuthInfo.Client_ID);
args.Add("client_secret", AuthInfo.Client_Secret);
args.Add("grant_type", "authorization_code");
args.Add("redirect_uri", Links.Callback);
args.Add("code", code);
string response = SendRequestURLEncoded(HttpMethod.POST, AuthUrl + "/connect/token", args);
if (!string.IsNullOrEmpty(response))
{
OAuth2Token token = JsonConvert.DeserializeObject<OAuth2Token>(response);
if (token != null && !string.IsNullOrEmpty(token.access_token))
{
AuthInfo.Token = token;
return true;
}
}
return false;
}
public string GetAuthorizationURL()
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("response_type", "code");
args.Add("redirect_uri", Links.Callback);
args.Add("scope", "openid teknik-api.write offline_access");
args.Add("client_id", AuthInfo.Client_ID);
return URLHelpers.CreateQueryString(AuthUrl + "/connect/authorize", args);
}
public NameValueCollection GetAuthHeaders()
{
if (OAuth2Info.CheckOAuth(AuthInfo))
{
NameValueCollection headers = new NameValueCollection();
headers.Add("Authorization", "Bearer " + AuthInfo.Token.access_token);
return headers;
}
return null;
}
}
public sealed class TeknikUploader : FileUploader, IOAuth2
{
public OAuth2Info AuthInfo { get; set; }
public string APIUrl { get; set; }
public TeknikExpirationUnit ExpirationUnit { get; set; }
public int ExpirationLength { get; set; }
public bool Encryption { get; set; }
public bool GenerateDeletionKey { get; set; }
private Teknik teknik;
public TeknikUploader(OAuth2Info oauth, string authUrl)
{
teknik = new Teknik(oauth, authUrl);
AuthInfo = teknik.AuthInfo;
}
public override UploadResult Upload(Stream stream, string fileName)
{
if (!CheckAuthorization()) return null;
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("encrypt", (!Encryption).ToString());
args.Add("expirationUnit", ExpirationUnit.ToString());
args.Add("expirationLength", ExpirationLength.ToString());
args.Add("saveKey", (!Encryption).ToString());
args.Add("keySize", "256");
args.Add("blockSize", "128");
args.Add("genDeletionKey", GenerateDeletionKey.ToString());
UploadResult result = SendRequestFile(APIUrl, stream, fileName, "file", args, teknik.GetAuthHeaders());
if (result.IsSuccess)
{
TeknikUploadResponseWrapper response = JsonConvert.DeserializeObject<TeknikUploadResponseWrapper>(result.Response);
if (response.Result != null && response.Error == null)
{
result.URL = response.Result.Url;
}
}
return result;
}
public string GetAuthorizationURL()
{
return teknik.GetAuthorizationURL();
}
public bool GetAccessToken(string code)
{
return teknik.GetAccessToken(code);
}
public bool RefreshAccessToken()
{
return teknik.RefreshAccessToken();
}
public bool CheckAuthorization()
{
return teknik.CheckAuthorization();
}
}
public class TeknikErrorResponse
{
public string Message { get; set; }
}
public class TeknikUploadResponseWrapper
{
public TeknikUploadResponse Result { get; set; }
public TeknikErrorResponse Error { get; set; }
}
public class TeknikUploadResponse
{
public string Url { get; set; }
public string Filename { get; set; }
public string ContentType { get; set; }
public long ContentLength { get; set; }
public string Key { get; set; }
public int KeySize { get; set; }
public string IV { get; set; }
public int BlockSize { get; set; }
public string DeletionKey { get; set; }
}
}

View file

@ -377,21 +377,6 @@ private void InitializeComponent()
this.txtLambdaApiKey = new System.Windows.Forms.TextBox();
this.lblLambdaUploadURL = new System.Windows.Forms.Label();
this.cbLambdaUploadURL = new System.Windows.Forms.ComboBox();
this.tpTeknik = new System.Windows.Forms.TabPage();
this.nudTeknikExpirationLength = new System.Windows.Forms.NumericUpDown();
this.cbTeknikExpirationUnit = new System.Windows.Forms.ComboBox();
this.lblTeknikExpiration = new System.Windows.Forms.Label();
this.lblTeknikUrlShortenerAPIUrl = new System.Windows.Forms.Label();
this.tbTeknikUrlShortenerAPIUrl = new System.Windows.Forms.TextBox();
this.lblTeknikPasteAPIUrl = new System.Windows.Forms.Label();
this.tbTeknikPasteAPIUrl = new System.Windows.Forms.TextBox();
this.lblTeknikAuthUrl = new System.Windows.Forms.Label();
this.tbTeknikAuthUrl = new System.Windows.Forms.TextBox();
this.cbTeknikGenDeleteKey = new System.Windows.Forms.CheckBox();
this.cbTeknikEncrypt = new System.Windows.Forms.CheckBox();
this.lblTeknikUploadAPIUrl = new System.Windows.Forms.Label();
this.tbTeknikUploadAPIUrl = new System.Windows.Forms.TextBox();
this.oauthTeknik = new ShareX.UploadersLib.OAuthControl();
this.tpPomf = new System.Windows.Forms.TabPage();
this.txtPomfResultURL = new System.Windows.Forms.TextBox();
this.txtPomfUploadURL = new System.Windows.Forms.TextBox();
@ -676,8 +661,6 @@ private void InitializeComponent()
this.tpJira.SuspendLayout();
this.gbJiraServer.SuspendLayout();
this.tpLambda.SuspendLayout();
this.tpTeknik.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudTeknikExpirationLength)).BeginInit();
this.tpPomf.SuspendLayout();
this.tpSeafile.SuspendLayout();
this.grpSeafileShareSettings.SuspendLayout();
@ -1258,7 +1241,6 @@ private void InitializeComponent()
this.tcFileUploaders.Controls.Add(this.tpHostr);
this.tcFileUploaders.Controls.Add(this.tpJira);
this.tcFileUploaders.Controls.Add(this.tpLambda);
this.tcFileUploaders.Controls.Add(this.tpTeknik);
this.tcFileUploaders.Controls.Add(this.tpPomf);
this.tcFileUploaders.Controls.Add(this.tpSeafile);
this.tcFileUploaders.Controls.Add(this.tpStreamable);
@ -3082,118 +3064,6 @@ private void InitializeComponent()
this.cbLambdaUploadURL.Name = "cbLambdaUploadURL";
this.cbLambdaUploadURL.SelectedIndexChanged += new System.EventHandler(this.cbLambdaUploadURL_SelectedIndexChanged);
//
// tpTeknik
//
this.tpTeknik.BackColor = System.Drawing.SystemColors.Window;
this.tpTeknik.Controls.Add(this.nudTeknikExpirationLength);
this.tpTeknik.Controls.Add(this.cbTeknikExpirationUnit);
this.tpTeknik.Controls.Add(this.lblTeknikExpiration);
this.tpTeknik.Controls.Add(this.lblTeknikUrlShortenerAPIUrl);
this.tpTeknik.Controls.Add(this.tbTeknikUrlShortenerAPIUrl);
this.tpTeknik.Controls.Add(this.lblTeknikPasteAPIUrl);
this.tpTeknik.Controls.Add(this.tbTeknikPasteAPIUrl);
this.tpTeknik.Controls.Add(this.lblTeknikAuthUrl);
this.tpTeknik.Controls.Add(this.tbTeknikAuthUrl);
this.tpTeknik.Controls.Add(this.cbTeknikGenDeleteKey);
this.tpTeknik.Controls.Add(this.cbTeknikEncrypt);
this.tpTeknik.Controls.Add(this.lblTeknikUploadAPIUrl);
this.tpTeknik.Controls.Add(this.tbTeknikUploadAPIUrl);
this.tpTeknik.Controls.Add(this.oauthTeknik);
resources.ApplyResources(this.tpTeknik, "tpTeknik");
this.tpTeknik.Name = "tpTeknik";
//
// nudTeknikExpirationLength
//
resources.ApplyResources(this.nudTeknikExpirationLength, "nudTeknikExpirationLength");
this.nudTeknikExpirationLength.Maximum = new decimal(new int[] {
10000,
0,
0,
0});
this.nudTeknikExpirationLength.Name = "nudTeknikExpirationLength";
this.nudTeknikExpirationLength.ValueChanged += new System.EventHandler(this.nudTeknikExpirationLength_ValueChanged);
//
// cbTeknikExpirationUnit
//
this.cbTeknikExpirationUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbTeknikExpirationUnit.FormattingEnabled = true;
resources.ApplyResources(this.cbTeknikExpirationUnit, "cbTeknikExpirationUnit");
this.cbTeknikExpirationUnit.Name = "cbTeknikExpirationUnit";
this.cbTeknikExpirationUnit.SelectedIndexChanged += new System.EventHandler(this.cbTeknikExpirationUnit_SelectedIndexChanged);
//
// lblTeknikExpiration
//
resources.ApplyResources(this.lblTeknikExpiration, "lblTeknikExpiration");
this.lblTeknikExpiration.Name = "lblTeknikExpiration";
//
// lblTeknikUrlShortenerAPIUrl
//
resources.ApplyResources(this.lblTeknikUrlShortenerAPIUrl, "lblTeknikUrlShortenerAPIUrl");
this.lblTeknikUrlShortenerAPIUrl.Name = "lblTeknikUrlShortenerAPIUrl";
//
// tbTeknikUrlShortenerAPIUrl
//
resources.ApplyResources(this.tbTeknikUrlShortenerAPIUrl, "tbTeknikUrlShortenerAPIUrl");
this.tbTeknikUrlShortenerAPIUrl.Name = "tbTeknikUrlShortenerAPIUrl";
this.tbTeknikUrlShortenerAPIUrl.TextChanged += new System.EventHandler(this.tbTeknikUrlShortenerAPIUrl_TextChanged);
//
// lblTeknikPasteAPIUrl
//
resources.ApplyResources(this.lblTeknikPasteAPIUrl, "lblTeknikPasteAPIUrl");
this.lblTeknikPasteAPIUrl.Name = "lblTeknikPasteAPIUrl";
//
// tbTeknikPasteAPIUrl
//
resources.ApplyResources(this.tbTeknikPasteAPIUrl, "tbTeknikPasteAPIUrl");
this.tbTeknikPasteAPIUrl.Name = "tbTeknikPasteAPIUrl";
this.tbTeknikPasteAPIUrl.TextChanged += new System.EventHandler(this.tbTeknikPasteAPIUrl_TextChanged);
//
// lblTeknikAuthUrl
//
resources.ApplyResources(this.lblTeknikAuthUrl, "lblTeknikAuthUrl");
this.lblTeknikAuthUrl.Name = "lblTeknikAuthUrl";
//
// tbTeknikAuthUrl
//
resources.ApplyResources(this.tbTeknikAuthUrl, "tbTeknikAuthUrl");
this.tbTeknikAuthUrl.Name = "tbTeknikAuthUrl";
this.tbTeknikAuthUrl.TextChanged += new System.EventHandler(this.tbTeknikAuthUrl_TextChanged);
//
// cbTeknikGenDeleteKey
//
resources.ApplyResources(this.cbTeknikGenDeleteKey, "cbTeknikGenDeleteKey");
this.cbTeknikGenDeleteKey.Name = "cbTeknikGenDeleteKey";
this.cbTeknikGenDeleteKey.UseVisualStyleBackColor = true;
this.cbTeknikGenDeleteKey.CheckedChanged += new System.EventHandler(this.cbTeknikGenDeleteKey_CheckedChanged);
//
// cbTeknikEncrypt
//
resources.ApplyResources(this.cbTeknikEncrypt, "cbTeknikEncrypt");
this.cbTeknikEncrypt.Name = "cbTeknikEncrypt";
this.cbTeknikEncrypt.UseVisualStyleBackColor = true;
this.cbTeknikEncrypt.CheckedChanged += new System.EventHandler(this.cbTeknikEncrypt_CheckedChanged);
//
// lblTeknikUploadAPIUrl
//
resources.ApplyResources(this.lblTeknikUploadAPIUrl, "lblTeknikUploadAPIUrl");
this.lblTeknikUploadAPIUrl.Name = "lblTeknikUploadAPIUrl";
//
// tbTeknikUploadAPIUrl
//
resources.ApplyResources(this.tbTeknikUploadAPIUrl, "tbTeknikUploadAPIUrl");
this.tbTeknikUploadAPIUrl.Name = "tbTeknikUploadAPIUrl";
this.tbTeknikUploadAPIUrl.TextChanged += new System.EventHandler(this.tbTeknikUploadAPIUrl_TextChanged);
//
// oauthTeknik
//
resources.ApplyResources(this.oauthTeknik, "oauthTeknik");
this.oauthTeknik.Name = "oauthTeknik";
this.oauthTeknik.UserInfo = null;
this.oauthTeknik.OpenButtonClicked += new ShareX.UploadersLib.OAuthControl.OpenButtonClickedEventHandler(this.oauthTeknik_OpenButtonClicked);
this.oauthTeknik.CompleteButtonClicked += new ShareX.UploadersLib.OAuthControl.CompleteButtonClickedEventHandler(this.oauthTeknik_CompleteButtonClicked);
this.oauthTeknik.ClearButtonClicked += new ShareX.UploadersLib.OAuthControl.ClearButtonclickedEventHandler(this.oauthTeknik_ClearButtonClicked);
this.oauthTeknik.RefreshButtonClicked += new ShareX.UploadersLib.OAuthControl.RefreshButtonClickedEventHandler(this.oauthTeknik_RefreshButtonClicked);
//
// tpPomf
//
this.tpPomf.BackColor = System.Drawing.SystemColors.Window;
@ -5050,9 +4920,6 @@ private void InitializeComponent()
this.gbJiraServer.PerformLayout();
this.tpLambda.ResumeLayout(false);
this.tpLambda.PerformLayout();
this.tpTeknik.ResumeLayout(false);
this.tpTeknik.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudTeknikExpirationLength)).EndInit();
this.tpPomf.ResumeLayout(false);
this.tpPomf.PerformLayout();
this.tpSeafile.ResumeLayout(false);
@ -5661,21 +5528,6 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblGooglePhotosCreateAlbumName;
private System.Windows.Forms.TextBox txtGooglePhotosCreateAlbumName;
private System.Windows.Forms.Button btnGooglePhotosCreateAlbum;
private System.Windows.Forms.CheckBox cbTeknikGenDeleteKey;
private System.Windows.Forms.CheckBox cbTeknikEncrypt;
private System.Windows.Forms.Label lblTeknikUploadAPIUrl;
private System.Windows.Forms.TextBox tbTeknikUploadAPIUrl;
private OAuthControl oauthTeknik;
private System.Windows.Forms.Label lblTeknikAuthUrl;
private System.Windows.Forms.TextBox tbTeknikAuthUrl;
internal System.Windows.Forms.TabPage tpTeknik;
private System.Windows.Forms.Label lblTeknikPasteAPIUrl;
private System.Windows.Forms.TextBox tbTeknikPasteAPIUrl;
private System.Windows.Forms.Label lblTeknikUrlShortenerAPIUrl;
private System.Windows.Forms.TextBox tbTeknikUrlShortenerAPIUrl;
private System.Windows.Forms.Label lblTeknikExpiration;
private System.Windows.Forms.ComboBox cbTeknikExpirationUnit;
private System.Windows.Forms.NumericUpDown nudTeknikExpirationLength;
private System.Windows.Forms.CheckBox cbGfycatKeepAudio;
private System.Windows.Forms.GroupBox gbGoogleCloudStorageAdvanced;
private System.Windows.Forms.Label lblGoogleCloudStorageStripExtension;

View file

@ -601,26 +601,6 @@ private void LoadFileUploaderSettings()
#endregion
#region Teknik
if (OAuth2Info.CheckOAuth(Config.TeknikOAuth2Info))
{
oauthTeknik.Status = OAuthLoginStatus.LoginSuccessful;
}
tbTeknikUploadAPIUrl.Text = Config.TeknikUploadAPIUrl;
tbTeknikPasteAPIUrl.Text = Config.TeknikPasteAPIUrl;
tbTeknikUrlShortenerAPIUrl.Text = Config.TeknikUrlShortenerAPIUrl;
tbTeknikAuthUrl.Text = Config.TeknikAuthUrl;
cbTeknikEncrypt.Checked = Config.TeknikEncryption;
cbTeknikGenDeleteKey.Checked = Config.TeknikGenerateDeletionKey;
cbTeknikExpirationUnit.Items.AddRange(Enum.GetNames(typeof(TeknikExpirationUnit)));
cbTeknikExpirationUnit.SelectedIndex = (int)Config.TeknikExpirationUnit;
nudTeknikExpirationLength.SetValue(Config.TeknikExpirationLength);
nudTeknikExpirationLength.Visible = Config.TeknikExpirationUnit != TeknikExpirationUnit.Never;
#endregion Teknik
#region Pomf
if (Config.PomfUploader == null) Config.PomfUploader = new PomfUploader();
@ -2421,72 +2401,6 @@ private void cbLambdaUploadURL_SelectedIndexChanged(object sender, EventArgs e)
#endregion Lambda
#region Teknik
private void oauthTeknik_OpenButtonClicked()
{
OAuth2Info oauth = new OAuth2Info(APIKeys.TeknikClientID, APIKeys.TeknikClientSecret);
Config.TeknikOAuth2Info = OAuth2Open(new TeknikUploader(oauth, Config.TeknikAuthUrl));
}
private void oauthTeknik_CompleteButtonClicked(string code)
{
OAuth2Complete(new TeknikUploader(Config.TeknikOAuth2Info, Config.TeknikAuthUrl), code, oauthTeknik);
}
private void oauthTeknik_ClearButtonClicked()
{
Config.TeknikOAuth2Info = null;
}
private void oauthTeknik_RefreshButtonClicked()
{
OAuth2Refresh(new TeknikUploader(Config.TeknikOAuth2Info, Config.TeknikAuthUrl), oauthTeknik);
}
private void tbTeknikAuthUrl_TextChanged(object sender, EventArgs e)
{
Config.TeknikAuthUrl = tbTeknikAuthUrl.Text;
}
private void tbTeknikUploadAPIUrl_TextChanged(object sender, EventArgs e)
{
Config.TeknikUploadAPIUrl = tbTeknikUploadAPIUrl.Text;
}
private void tbTeknikPasteAPIUrl_TextChanged(object sender, EventArgs e)
{
Config.TeknikPasteAPIUrl = tbTeknikPasteAPIUrl.Text;
}
private void tbTeknikUrlShortenerAPIUrl_TextChanged(object sender, EventArgs e)
{
Config.TeknikUrlShortenerAPIUrl = tbTeknikUrlShortenerAPIUrl.Text;
}
private void cbTeknikEncrypt_CheckedChanged(object sender, EventArgs e)
{
Config.TeknikEncryption = cbTeknikEncrypt.Checked;
}
private void cbTeknikGenDeleteKey_CheckedChanged(object sender, EventArgs e)
{
Config.TeknikGenerateDeletionKey = cbTeknikGenDeleteKey.Checked;
}
private void cbTeknikExpirationUnit_SelectedIndexChanged(object sender, EventArgs e)
{
Config.TeknikExpirationUnit = (TeknikExpirationUnit)cbTeknikExpirationUnit.SelectedIndex;
nudTeknikExpirationLength.Visible = Config.TeknikExpirationUnit != TeknikExpirationUnit.Never;
}
private void nudTeknikExpirationLength_ValueChanged(object sender, EventArgs e)
{
Config.TeknikExpirationLength = (int)nudTeknikExpirationLength.Value;
}
#endregion Teknik
#region Pomf
private void txtPomfUploadURL_TextChanged(object sender, EventArgs e)

View file

@ -459,7 +459,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oauthTwitter</value>
</data>
<data name="&gt;&gt;oauthTwitter.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauthTwitter.Parent" xml:space="preserve">
<value>tpTwitter</value>
@ -714,7 +714,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oauth2Bitly</value>
</data>
<data name="&gt;&gt;oauth2Bitly.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2Bitly.Parent" xml:space="preserve">
<value>tpBitly</value>
@ -2349,7 +2349,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>eiFTP</value>
</data>
<data name="&gt;&gt;eiFTP.Type" xml:space="preserve">
<value>ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;eiFTP.Parent" xml:space="preserve">
<value>gbFTPAccount</value>
@ -3555,7 +3555,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oauth2Dropbox</value>
</data>
<data name="&gt;&gt;oauth2Dropbox.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2Dropbox.Parent" xml:space="preserve">
<value>tpDropbox</value>
@ -3687,7 +3687,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oAuth2OneDrive</value>
</data>
<data name="&gt;&gt;oAuth2OneDrive.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oAuth2OneDrive.Parent" xml:space="preserve">
<value>tpOneDrive</value>
@ -3735,7 +3735,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oauth2GoogleDrive</value>
</data>
<data name="&gt;&gt;oauth2GoogleDrive.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2GoogleDrive.Parent" xml:space="preserve">
<value>tpGoogleDrive</value>
@ -3900,7 +3900,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>lvGoogleDriveFoldersList</value>
</data>
<data name="&gt;&gt;lvGoogleDriveFoldersList.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvGoogleDriveFoldersList.Parent" xml:space="preserve">
<value>tpGoogleDrive</value>
@ -4365,7 +4365,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>lvBoxFolders</value>
</data>
<data name="&gt;&gt;lvBoxFolders.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvBoxFolders.Parent" xml:space="preserve">
<value>tpBox</value>
@ -4446,7 +4446,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oauth2Box</value>
</data>
<data name="&gt;&gt;oauth2Box.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2Box.Parent" xml:space="preserve">
<value>tpBox</value>
@ -5325,7 +5325,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oauth2GoogleCloudStorage</value>
</data>
<data name="&gt;&gt;oauth2GoogleCloudStorage.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2GoogleCloudStorage.Parent" xml:space="preserve">
<value>tpGoogleCloudStorage</value>
@ -6210,13 +6210,13 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>16</value>
</data>
<data name="tpAzureStorage.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 58</value>
<value>4, 220</value>
</data>
<data name="tpAzureStorage.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tpAzureStorage.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 507</value>
<value>178, 0</value>
</data>
<data name="tpAzureStorage.TabIndex" type="System.Int32, mscorlib">
<value>28</value>
@ -6597,7 +6597,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>atcGfycatAccountType</value>
</data>
<data name="&gt;&gt;atcGfycatAccountType.Type" xml:space="preserve">
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;atcGfycatAccountType.Parent" xml:space="preserve">
<value>tpGfycat</value>
@ -6618,7 +6618,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oauth2Gfycat</value>
</data>
<data name="&gt;&gt;oauth2Gfycat.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2Gfycat.Parent" xml:space="preserve">
<value>tpGfycat</value>
@ -7977,7 +7977,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>atcSendSpaceAccountType</value>
</data>
<data name="&gt;&gt;atcSendSpaceAccountType.Type" xml:space="preserve">
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;atcSendSpaceAccountType.Parent" xml:space="preserve">
<value>tpSendSpace</value>
@ -8346,7 +8346,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>oAuthJira</value>
</data>
<data name="&gt;&gt;oAuthJira.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oAuthJira.Parent" xml:space="preserve">
<value>tpJira</value>
@ -8537,393 +8537,6 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<data name="&gt;&gt;tpLambda.ZOrder" xml:space="preserve">
<value>18</value>
</data>
<data name="nudTeknikExpirationLength.Location" type="System.Drawing.Point, System.Drawing">
<value>144, 320</value>
</data>
<data name="nudTeknikExpirationLength.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 20</value>
</data>
<data name="nudTeknikExpirationLength.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="nudTeknikExpirationLength.TextAlign" type="System.Windows.Forms.HorizontalAlignment, System.Windows.Forms">
<value>Center</value>
</data>
<data name="&gt;&gt;nudTeknikExpirationLength.Name" xml:space="preserve">
<value>nudTeknikExpirationLength</value>
</data>
<data name="&gt;&gt;nudTeknikExpirationLength.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;nudTeknikExpirationLength.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;nudTeknikExpirationLength.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cbTeknikExpirationUnit.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 320</value>
</data>
<data name="cbTeknikExpirationUnit.Size" type="System.Drawing.Size, System.Drawing">
<value>121, 21</value>
</data>
<data name="cbTeknikExpirationUnit.TabIndex" type="System.Int32, mscorlib">
<value>33</value>
</data>
<data name="&gt;&gt;cbTeknikExpirationUnit.Name" xml:space="preserve">
<value>cbTeknikExpirationUnit</value>
</data>
<data name="&gt;&gt;cbTeknikExpirationUnit.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbTeknikExpirationUnit.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;cbTeknikExpirationUnit.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="lblTeknikExpiration.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblTeknikExpiration.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblTeknikExpiration.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 304</value>
</data>
<data name="lblTeknikExpiration.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 13</value>
</data>
<data name="lblTeknikExpiration.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="lblTeknikExpiration.Text" xml:space="preserve">
<value>Expiration:</value>
</data>
<data name="&gt;&gt;lblTeknikExpiration.Name" xml:space="preserve">
<value>lblTeknikExpiration</value>
</data>
<data name="&gt;&gt;lblTeknikExpiration.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblTeknikExpiration.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;lblTeknikExpiration.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="lblTeknikUrlShortenerAPIUrl.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblTeknikUrlShortenerAPIUrl.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblTeknikUrlShortenerAPIUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>357, 160</value>
</data>
<data name="lblTeknikUrlShortenerAPIUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>126, 13</value>
</data>
<data name="lblTeknikUrlShortenerAPIUrl.TabIndex" type="System.Int32, mscorlib">
<value>30</value>
</data>
<data name="lblTeknikUrlShortenerAPIUrl.Text" xml:space="preserve">
<value>URL Shortener API URL:</value>
</data>
<data name="&gt;&gt;lblTeknikUrlShortenerAPIUrl.Name" xml:space="preserve">
<value>lblTeknikUrlShortenerAPIUrl</value>
</data>
<data name="&gt;&gt;lblTeknikUrlShortenerAPIUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblTeknikUrlShortenerAPIUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;lblTeknikUrlShortenerAPIUrl.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="tbTeknikUrlShortenerAPIUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>360, 176</value>
</data>
<data name="tbTeknikUrlShortenerAPIUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 20</value>
</data>
<data name="tbTeknikUrlShortenerAPIUrl.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="&gt;&gt;tbTeknikUrlShortenerAPIUrl.Name" xml:space="preserve">
<value>tbTeknikUrlShortenerAPIUrl</value>
</data>
<data name="&gt;&gt;tbTeknikUrlShortenerAPIUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tbTeknikUrlShortenerAPIUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;tbTeknikUrlShortenerAPIUrl.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="lblTeknikPasteAPIUrl.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblTeknikPasteAPIUrl.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblTeknikPasteAPIUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>357, 112</value>
</data>
<data name="lblTeknikPasteAPIUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>82, 13</value>
</data>
<data name="lblTeknikPasteAPIUrl.TabIndex" type="System.Int32, mscorlib">
<value>28</value>
</data>
<data name="lblTeknikPasteAPIUrl.Text" xml:space="preserve">
<value>Paste API URL:</value>
</data>
<data name="&gt;&gt;lblTeknikPasteAPIUrl.Name" xml:space="preserve">
<value>lblTeknikPasteAPIUrl</value>
</data>
<data name="&gt;&gt;lblTeknikPasteAPIUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblTeknikPasteAPIUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;lblTeknikPasteAPIUrl.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="tbTeknikPasteAPIUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>360, 128</value>
</data>
<data name="tbTeknikPasteAPIUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 20</value>
</data>
<data name="tbTeknikPasteAPIUrl.TabIndex" type="System.Int32, mscorlib">
<value>29</value>
</data>
<data name="&gt;&gt;tbTeknikPasteAPIUrl.Name" xml:space="preserve">
<value>tbTeknikPasteAPIUrl</value>
</data>
<data name="&gt;&gt;tbTeknikPasteAPIUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tbTeknikPasteAPIUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;tbTeknikPasteAPIUrl.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="lblTeknikAuthUrl.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblTeknikAuthUrl.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblTeknikAuthUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>357, 16</value>
</data>
<data name="lblTeknikAuthUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>103, 13</value>
</data>
<data name="lblTeknikAuthUrl.TabIndex" type="System.Int32, mscorlib">
<value>26</value>
</data>
<data name="lblTeknikAuthUrl.Text" xml:space="preserve">
<value>Authentication URL:</value>
</data>
<data name="&gt;&gt;lblTeknikAuthUrl.Name" xml:space="preserve">
<value>lblTeknikAuthUrl</value>
</data>
<data name="&gt;&gt;lblTeknikAuthUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblTeknikAuthUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;lblTeknikAuthUrl.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="tbTeknikAuthUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>360, 32</value>
</data>
<data name="tbTeknikAuthUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 20</value>
</data>
<data name="tbTeknikAuthUrl.TabIndex" type="System.Int32, mscorlib">
<value>27</value>
</data>
<data name="&gt;&gt;tbTeknikAuthUrl.Name" xml:space="preserve">
<value>tbTeknikAuthUrl</value>
</data>
<data name="&gt;&gt;tbTeknikAuthUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tbTeknikAuthUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;tbTeknikAuthUrl.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="cbTeknikGenDeleteKey.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cbTeknikGenDeleteKey.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cbTeknikGenDeleteKey.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 280</value>
</data>
<data name="cbTeknikGenDeleteKey.Size" type="System.Drawing.Size, System.Drawing">
<value>130, 17</value>
</data>
<data name="cbTeknikGenDeleteKey.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
</data>
<data name="cbTeknikGenDeleteKey.Text" xml:space="preserve">
<value>Generate deletion key</value>
</data>
<data name="&gt;&gt;cbTeknikGenDeleteKey.Name" xml:space="preserve">
<value>cbTeknikGenDeleteKey</value>
</data>
<data name="&gt;&gt;cbTeknikGenDeleteKey.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbTeknikGenDeleteKey.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;cbTeknikGenDeleteKey.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="cbTeknikEncrypt.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cbTeknikEncrypt.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cbTeknikEncrypt.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 256</value>
</data>
<data name="cbTeknikEncrypt.Size" type="System.Drawing.Size, System.Drawing">
<value>126, 17</value>
</data>
<data name="cbTeknikEncrypt.TabIndex" type="System.Int32, mscorlib">
<value>24</value>
</data>
<data name="cbTeknikEncrypt.Text" xml:space="preserve">
<value>Client side encryption</value>
</data>
<data name="&gt;&gt;cbTeknikEncrypt.Name" xml:space="preserve">
<value>cbTeknikEncrypt</value>
</data>
<data name="&gt;&gt;cbTeknikEncrypt.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbTeknikEncrypt.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;cbTeknikEncrypt.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="lblTeknikUploadAPIUrl.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblTeknikUploadAPIUrl.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblTeknikUploadAPIUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>357, 64</value>
</data>
<data name="lblTeknikUploadAPIUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 13</value>
</data>
<data name="lblTeknikUploadAPIUrl.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="lblTeknikUploadAPIUrl.Text" xml:space="preserve">
<value>Upload API URL:</value>
</data>
<data name="&gt;&gt;lblTeknikUploadAPIUrl.Name" xml:space="preserve">
<value>lblTeknikUploadAPIUrl</value>
</data>
<data name="&gt;&gt;lblTeknikUploadAPIUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblTeknikUploadAPIUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;lblTeknikUploadAPIUrl.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="tbTeknikUploadAPIUrl.Location" type="System.Drawing.Point, System.Drawing">
<value>360, 80</value>
</data>
<data name="tbTeknikUploadAPIUrl.Size" type="System.Drawing.Size, System.Drawing">
<value>320, 20</value>
</data>
<data name="tbTeknikUploadAPIUrl.TabIndex" type="System.Int32, mscorlib">
<value>23</value>
</data>
<data name="&gt;&gt;tbTeknikUploadAPIUrl.Name" xml:space="preserve">
<value>tbTeknikUploadAPIUrl</value>
</data>
<data name="&gt;&gt;tbTeknikUploadAPIUrl.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tbTeknikUploadAPIUrl.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;tbTeknikUploadAPIUrl.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="oauthTeknik.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 16</value>
</data>
<data name="oauthTeknik.Size" type="System.Drawing.Size, System.Drawing">
<value>328, 232</value>
</data>
<data name="oauthTeknik.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
</data>
<data name="&gt;&gt;oauthTeknik.Name" xml:space="preserve">
<value>oauthTeknik</value>
</data>
<data name="&gt;&gt;oauthTeknik.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauthTeknik.Parent" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;oauthTeknik.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="tpTeknik.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 220</value>
</data>
<data name="tpTeknik.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="tpTeknik.Size" type="System.Drawing.Size, System.Drawing">
<value>178, 0</value>
</data>
<data name="tpTeknik.TabIndex" type="System.Int32, mscorlib">
<value>34</value>
</data>
<data name="tpTeknik.Text" xml:space="preserve">
<value>Teknik</value>
</data>
<data name="&gt;&gt;tpTeknik.Name" xml:space="preserve">
<value>tpTeknik</value>
</data>
<data name="&gt;&gt;tpTeknik.Type" xml:space="preserve">
<value>System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tpTeknik.Parent" xml:space="preserve">
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpTeknik.ZOrder" xml:space="preserve">
<value>19</value>
</data>
<data name="txtPomfResultURL.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 80</value>
</data>
@ -9051,7 +8664,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpPomf.ZOrder" xml:space="preserve">
<value>20</value>
<value>19</value>
</data>
<data name="cbSeafileAPIURL.Items" xml:space="preserve">
<value>https://seacloud.cc/api2/</value>
@ -9312,7 +8925,7 @@ For example, if your bucket is called "bucket.example.com" then URL will be "htt
<value>lvSeafileLibraries</value>
</data>
<data name="&gt;&gt;lvSeafileLibraries.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvSeafileLibraries.Parent" xml:space="preserve">
<value>tpSeafile</value>
@ -10042,7 +9655,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpSeafile.ZOrder" xml:space="preserve">
<value>21</value>
<value>20</value>
</data>
<data name="cbStreamableUseDirectURL.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -10210,7 +9823,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpStreamable.ZOrder" xml:space="preserve">
<value>22</value>
<value>21</value>
</data>
<data name="btnSulGetAPIKey.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -10315,7 +9928,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpSul.ZOrder" xml:space="preserve">
<value>23</value>
<value>22</value>
</data>
<data name="btnLithiioFetchAPIKey.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -10549,7 +10162,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpLithiio.ZOrder" xml:space="preserve">
<value>24</value>
<value>23</value>
</data>
<data name="cbPlikOneShot.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -11056,7 +10669,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpPlik.ZOrder" xml:space="preserve">
<value>25</value>
<value>24</value>
</data>
<data name="oauth2YouTube.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 8</value>
@ -11071,7 +10684,7 @@ Using an encrypted library disables sharing.</value>
<value>oauth2YouTube</value>
</data>
<data name="&gt;&gt;oauth2YouTube.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2YouTube.Parent" xml:space="preserve">
<value>tpYouTube</value>
@ -11251,10 +10864,10 @@ Using an encrypted library disables sharing.</value>
<value>6</value>
</data>
<data name="tpYouTube.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 58</value>
<value>4, 220</value>
</data>
<data name="tpYouTube.Size" type="System.Drawing.Size, System.Drawing">
<value>803, 507</value>
<value>178, 0</value>
</data>
<data name="tpYouTube.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
@ -11272,7 +10885,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpYouTube.ZOrder" xml:space="preserve">
<value>26</value>
<value>25</value>
</data>
<data name="lbSharedFolderAccounts.IntegralHeight" type="System.Boolean, mscorlib">
<value>False</value>
@ -11578,7 +11191,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpSharedFolder.ZOrder" xml:space="preserve">
<value>27</value>
<value>26</value>
</data>
<data name="txtEmailAutomaticSendTo.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 408</value>
@ -11998,7 +11611,7 @@ Using an encrypted library disables sharing.</value>
<value>tcFileUploaders</value>
</data>
<data name="&gt;&gt;tpEmail.ZOrder" xml:space="preserve">
<value>28</value>
<value>27</value>
</data>
<data name="tcFileUploaders.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -12805,7 +12418,7 @@ Using an encrypted library disables sharing.</value>
<value>oAuth2Gist</value>
</data>
<data name="&gt;&gt;oAuth2Gist.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oAuth2Gist.Parent" xml:space="preserve">
<value>tpGist</value>
@ -13444,7 +13057,7 @@ Using an encrypted library disables sharing.</value>
<value>atcImgurAccountType</value>
</data>
<data name="&gt;&gt;atcImgurAccountType.Type" xml:space="preserve">
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;atcImgurAccountType.Parent" xml:space="preserve">
<value>tpImgur</value>
@ -13465,7 +13078,7 @@ Using an encrypted library disables sharing.</value>
<value>oauth2Imgur</value>
</data>
<data name="&gt;&gt;oauth2Imgur.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2Imgur.Parent" xml:space="preserve">
<value>tpImgur</value>
@ -13501,7 +13114,7 @@ Using an encrypted library disables sharing.</value>
<value>lvImgurAlbumList</value>
</data>
<data name="&gt;&gt;lvImgurAlbumList.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvImgurAlbumList.Parent" xml:space="preserve">
<value>tpImgur</value>
@ -13900,7 +13513,7 @@ Using an encrypted library disables sharing.</value>
<value>oauthFlickr</value>
</data>
<data name="&gt;&gt;oauthFlickr.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauthFlickr.Parent" xml:space="preserve">
<value>tpFlickr</value>
@ -14437,7 +14050,7 @@ Using an encrypted library disables sharing.</value>
<value>oauth2GooglePhotos</value>
</data>
<data name="&gt;&gt;oauth2GooglePhotos.Type" xml:space="preserve">
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.OAuthLoopbackControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;oauth2GooglePhotos.Parent" xml:space="preserve">
<value>tpGooglePhotos</value>
@ -15097,7 +14710,7 @@ Using an encrypted library disables sharing.</value>
<value>tttvMain</value>
</data>
<data name="&gt;&gt;tttvMain.Type" xml:space="preserve">
<value>ShareX.HelpersLib.TabToTreeView, ShareX.HelpersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.TabToTreeView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;tttvMain.Parent" xml:space="preserve">
<value>$this</value>
@ -15118,7 +14731,7 @@ Using an encrypted library disables sharing.</value>
<value>actRapidShareAccountType</value>
</data>
<data name="&gt;&gt;actRapidShareAccountType.Type" xml:space="preserve">
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=14.1.4.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.UploadersLib.AccountTypeControl, ShareX.UploadersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>

View file

@ -802,16 +802,6 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon Teknik {
get {
object obj = ResourceManager.GetObject("Teknik", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to Thumbnail URL.
/// </summary>

View file

@ -386,9 +386,6 @@ Created folders:</value>
<data name="Dropbox" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Favicons\Dropbox.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Teknik" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Favicons\Teknik.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="DuplicateNameNotAllowed" xml:space="preserve">
<value>Duplicate name not allowed.</value>
</data>

View file

@ -174,7 +174,6 @@
<Compile Include="FileUploaders\PomfUploader.cs" />
<Compile Include="FileUploaders\SFTP.cs" />
<Compile Include="FileUploaders\SharedFolderUploader.cs" />
<Compile Include="FileUploaders\Teknik.cs" />
<Compile Include="FileUploaders\Transfersh.cs" />
<Compile Include="FileUploaders\Uguu.cs" />
<Compile Include="FileUploaders\Vault_ooo.cs" />
@ -299,7 +298,6 @@
<Compile Include="Helpers\TaskReferenceHelper.cs" />
<Compile Include="BaseServices\TextUploaderService.cs" />
<Compile Include="TextUploaders\Pastie.cs" />
<Compile Include="TextUploaders\TeknikPastebin.cs" />
<Compile Include="Helpers\UploaderErrorInfo.cs" />
<Compile Include="UploaderFactory.cs" />
<Compile Include="ImageUploaders\Chevereto.cs" />
@ -382,7 +380,6 @@
<Compile Include="URLShorteners\FirebaseDynamicLinksURLShortener.cs" />
<Compile Include="URLShorteners\KuttURLShortener.cs" />
<Compile Include="URLShorteners\PolrURLShortener.cs" />
<Compile Include="URLShorteners\TeknikURLShortener.cs" />
<Compile Include="URLShorteners\TwoGPURLShortener.cs" />
<Compile Include="URLShorteners\AdFlyURLShortener.cs" />
<Compile Include="URLShorteners\BitlyURLShortener.cs" />
@ -1274,9 +1271,6 @@
<ItemGroup>
<None Include="Favicons\Kutt.png" />
</ItemGroup>
<ItemGroup>
<None Include="Favicons\Teknik.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\navigation-270-button-white.png" />
</ItemGroup>

View file

@ -1,128 +0,0 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2023 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using Newtonsoft.Json;
using ShareX.UploadersLib.FileUploaders;
using ShareX.UploadersLib.Properties;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace ShareX.UploadersLib.TextUploaders
{
public class TeknikTextUploaderService : TextUploaderService
{
public override TextDestination EnumValue { get; } = TextDestination.Teknik;
public override Icon ServiceIcon => Resources.Teknik;
public override bool CheckConfig(UploadersConfig config)
{
return !string.IsNullOrEmpty(config.TeknikPasteAPIUrl) && !string.IsNullOrEmpty(config.TeknikAuthUrl);
}
public override GenericUploader CreateUploader(UploadersConfig config, TaskReferenceHelper taskInfo)
{
return new TeknikPaster(config.TeknikOAuth2Info, config.TeknikAuthUrl)
{
APIUrl = config.TeknikPasteAPIUrl,
ExpirationUnit = config.TeknikExpirationUnit,
ExpirationLength = config.TeknikExpirationLength
};
}
public override TabPage GetUploadersConfigTabPage(UploadersConfigForm form) => form.tpTeknik;
}
public sealed class TeknikPaster : TextUploader, IOAuth2
{
public OAuth2Info AuthInfo { get; set; }
public string APIUrl { get; set; }
public TeknikExpirationUnit ExpirationUnit { get; set; }
public int ExpirationLength { get; set; }
private Teknik teknik;
public TeknikPaster(OAuth2Info oauth, string authUrl)
{
teknik = new Teknik(oauth, authUrl);
AuthInfo = teknik.AuthInfo;
}
public bool GetAccessToken(string code)
{
return teknik.GetAccessToken(code);
}
public string GetAuthorizationURL()
{
return teknik.GetAuthorizationURL();
}
public bool RefreshAccessToken()
{
return teknik.RefreshAccessToken();
}
public bool CheckAuthorization()
{
return teknik.CheckAuthorization();
}
public override UploadResult UploadText(string text, string fileName)
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("code", text);
args.Add("expirationUnit", ExpirationUnit.ToString());
args.Add("expirationLength", ExpirationLength.ToString());
string response = SendRequestMultiPart(APIUrl, args, teknik.GetAuthHeaders());
TeknikPasteResponseWrapper apiResponse = JsonConvert.DeserializeObject<TeknikPasteResponseWrapper>(response);
UploadResult ur = new UploadResult();
if (apiResponse.Result != null && apiResponse.Error == null)
{
ur.URL = apiResponse.Result.Url;
}
return ur;
}
}
public class TeknikPasteResponseWrapper
{
public TeknikPasteResponse Result { get; set; }
public TeknikErrorResponse Error { get; set; }
}
public class TeknikPasteResponse
{
public string Id { get; set; }
public string Url { get; set; }
public string Title { get; set; }
public string Syntax { get; set; }
public string Password { get; set; }
}
}

View file

@ -1,119 +0,0 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2023 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using Newtonsoft.Json;
using ShareX.UploadersLib.FileUploaders;
using ShareX.UploadersLib.Properties;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace ShareX.UploadersLib.URLShorteners
{
public class TeknikUrlShortenerService : URLShortenerService
{
public override UrlShortenerType EnumValue { get; } = UrlShortenerType.Teknik;
public override Icon ServiceIcon => Resources.Teknik;
public override bool CheckConfig(UploadersConfig config)
{
return !string.IsNullOrEmpty(config.TeknikUrlShortenerAPIUrl) && !string.IsNullOrEmpty(config.TeknikAuthUrl);
}
public override URLShortener CreateShortener(UploadersConfig config, TaskReferenceHelper taskInfo)
{
return new TeknikUrlShortener(config.TeknikOAuth2Info, config.TeknikAuthUrl)
{
APIUrl = config.TeknikUrlShortenerAPIUrl
};
}
public override TabPage GetUploadersConfigTabPage(UploadersConfigForm form) => form.tpTeknik;
}
public sealed class TeknikUrlShortener : URLShortener, IOAuth2
{
public OAuth2Info AuthInfo { get; set; }
public string APIUrl { get; set; }
private Teknik teknik;
public TeknikUrlShortener(OAuth2Info oauth, string authUrl)
{
teknik = new Teknik(oauth, authUrl);
AuthInfo = teknik.AuthInfo;
}
public bool GetAccessToken(string code)
{
return teknik.GetAccessToken(code);
}
public string GetAuthorizationURL()
{
return teknik.GetAuthorizationURL();
}
public override UploadResult ShortenURL(string url)
{
Dictionary<string, string> args = new Dictionary<string, string>();
args.Add("url", url);
string response = SendRequestMultiPart(APIUrl, args, teknik.GetAuthHeaders());
TeknikUrlShortenerResponseWrapper apiResponse = JsonConvert.DeserializeObject<TeknikUrlShortenerResponseWrapper>(response);
UploadResult ur = new UploadResult();
if (apiResponse.Result != null && apiResponse.Error == null)
{
ur.ShortenedURL = apiResponse.Result.shortUrl;
}
return ur;
}
public bool RefreshAccessToken()
{
return teknik.RefreshAccessToken();
}
public bool CheckAuthorization()
{
return teknik.CheckAuthorization();
}
}
public class TeknikUrlShortenerResponseWrapper
{
public TeknikUrlShortenerResponse Result { get; set; }
public TeknikErrorResponse Error { get; set; }
}
public class TeknikUrlShortenerResponse
{
public string shortUrl { get; set; }
public string originalUrl { get; set; }
}
}

View file

@ -329,20 +329,6 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
#endregion
#region Teknik
public OAuth2Info TeknikOAuth2Info { get; set; } = null;
public string TeknikUploadAPIUrl { get; set; } = Teknik.DefaultUploadAPIURL;
public string TeknikPasteAPIUrl { get; set; } = Teknik.DefaultPasteAPIURL;
public string TeknikUrlShortenerAPIUrl { get; set; } = Teknik.DefaultUrlShortenerAPIURL;
public string TeknikAuthUrl { get; set; } = Teknik.DefaultAuthURL;
public TeknikExpirationUnit TeknikExpirationUnit { get; set; } = TeknikExpirationUnit.Never;
public int TeknikExpirationLength { get; set; } = 1;
public bool TeknikEncryption { get; set; } = false;
public bool TeknikGenerateDeletionKey { get; set; } = false;
#endregion Teknik
#region Pomf
public PomfUploader PomfUploader { get; set; } = new PomfUploader();