mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-05 20:54:31 +13:00
Merge branch 'master' of git://github.com/jevanpipitone/ShareX into jevanpipitone-master
This commit is contained in:
commit
63b3008f3c
10 changed files with 1470 additions and 1205 deletions
BIN
ShareX.UploadersLib/Favicons/SomeImage.png
Normal file
BIN
ShareX.UploadersLib/Favicons/SomeImage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
2043
ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs
generated
2043
ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -23,6 +23,12 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using CG.Web.MegaApiClient;
|
||||
using ShareX.HelpersLib;
|
||||
using ShareX.UploadersLib.FileUploaders;
|
||||
|
@ -30,12 +36,6 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.UploadersLib.ImageUploaders;
|
||||
using ShareX.UploadersLib.Properties;
|
||||
using ShareX.UploadersLib.TextUploaders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX.UploadersLib
|
||||
{
|
||||
|
@ -112,6 +112,7 @@ private void FormSettings()
|
|||
AddIconToTab(tpSeafile, Resources.Seafile);
|
||||
AddIconToTab(tpSendSpace, Resources.SendSpace);
|
||||
AddIconToTab(tpSharedFolder, Resources.server_network);
|
||||
AddIconToTab(tpSomeImage, Resources.SomeImage);
|
||||
AddIconToTab(tpStreamable, Resources.Streamable);
|
||||
AddIconToTab(tpSul, Resources.Sul);
|
||||
AddIconToTab(tpTinyPic, Resources.TinyPic);
|
||||
|
@ -242,6 +243,11 @@ public void LoadSettings()
|
|||
txtCheveretoAPIKey.Text = Config.CheveretoAPIKey;
|
||||
cbCheveretoDirectURL.Checked = Config.CheveretoDirectURL;
|
||||
|
||||
// SomeImage
|
||||
|
||||
txtSomeImageAPIKey.Text = Config.SomeImageAPIKey;
|
||||
cbSomeImageDirectURL.Checked = Config.SomeImageDirectURL;
|
||||
|
||||
// vgy.me
|
||||
|
||||
txtVgymeUserKey.Text = Config.VgymeUserKey;
|
||||
|
@ -998,6 +1004,25 @@ private void cbCheveretoDirectURL_CheckedChanged(object sender, EventArgs e)
|
|||
|
||||
#endregion Chevereto
|
||||
|
||||
#region SomeImage
|
||||
|
||||
private void txtSomeImageAPIKey_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
Config.SomeImageAPIKey = txtSomeImageAPIKey.Text;
|
||||
}
|
||||
|
||||
private void cbSomeImageDirectURL_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Config.SomeImageDirectURL = cbSomeImageDirectURL.Checked;
|
||||
}
|
||||
|
||||
private void linkLblSomeImageAPIKey_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://someimage.com/api");
|
||||
}
|
||||
|
||||
#endregion SomeImage
|
||||
|
||||
#region vgy.me
|
||||
|
||||
private void txtVgymeUserKey_TextChanged(object sender, EventArgs e)
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
|
@ -26,36 +26,36 @@
|
|||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
@ -12706,6 +12706,141 @@ Using an encrypted library disables sharing.</value>
|
|||
<data name=">>tpChevereto.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="linkLblSomeImageAPIKey.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="linkLblSomeImageAPIKey.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>376, 46</value>
|
||||
</data>
|
||||
<data name="linkLblSomeImageAPIKey.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>300, 17</value>
|
||||
</data>
|
||||
<data name="linkLblSomeImageAPIKey.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="linkLblSomeImageAPIKey.Text" xml:space="preserve">
|
||||
<value>To get API key visit https://someimage.com/api</value>
|
||||
</data>
|
||||
<data name=">>linkLblSomeImageAPIKey.Name" xml:space="preserve">
|
||||
<value>linkLblSomeImageAPIKey</value>
|
||||
</data>
|
||||
<data name=">>linkLblSomeImageAPIKey.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>linkLblSomeImageAPIKey.Parent" xml:space="preserve">
|
||||
<value>tpSomeImage</value>
|
||||
</data>
|
||||
<data name=">>linkLblSomeImageAPIKey.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="txtSomeImageAPIKey.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>25, 43</value>
|
||||
</data>
|
||||
<data name="txtSomeImageAPIKey.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>319, 22</value>
|
||||
</data>
|
||||
<data name="txtSomeImageAPIKey.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name=">>txtSomeImageAPIKey.Name" xml:space="preserve">
|
||||
<value>txtSomeImageAPIKey</value>
|
||||
</data>
|
||||
<data name=">>txtSomeImageAPIKey.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=">>txtSomeImageAPIKey.Parent" xml:space="preserve">
|
||||
<value>tpSomeImage</value>
|
||||
</data>
|
||||
<data name=">>txtSomeImageAPIKey.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="lblSomeImageAPIKey.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="lblSomeImageAPIKey.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>22, 23</value>
|
||||
</data>
|
||||
<data name="lblSomeImageAPIKey.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>59, 17</value>
|
||||
</data>
|
||||
<data name="lblSomeImageAPIKey.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="lblSomeImageAPIKey.Text" xml:space="preserve">
|
||||
<value>API key:</value>
|
||||
</data>
|
||||
<data name=">>lblSomeImageAPIKey.Name" xml:space="preserve">
|
||||
<value>lblSomeImageAPIKey</value>
|
||||
</data>
|
||||
<data name=">>lblSomeImageAPIKey.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=">>lblSomeImageAPIKey.Parent" xml:space="preserve">
|
||||
<value>tpSomeImage</value>
|
||||
</data>
|
||||
<data name=">>lblSomeImageAPIKey.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="cbSomeImageDirectURL.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="cbSomeImageDirectURL.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>25, 88</value>
|
||||
</data>
|
||||
<data name="cbSomeImageDirectURL.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 4, 4, 4</value>
|
||||
</data>
|
||||
<data name="cbSomeImageDirectURL.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>99, 21</value>
|
||||
</data>
|
||||
<data name="cbSomeImageDirectURL.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="cbSomeImageDirectURL.Text" xml:space="preserve">
|
||||
<value>Direct URL</value>
|
||||
</data>
|
||||
<data name=">>cbSomeImageDirectURL.Name" xml:space="preserve">
|
||||
<value>cbSomeImageDirectURL</value>
|
||||
</data>
|
||||
<data name=">>cbSomeImageDirectURL.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=">>cbSomeImageDirectURL.Parent" xml:space="preserve">
|
||||
<value>tpSomeImage</value>
|
||||
</data>
|
||||
<data name=">>cbSomeImageDirectURL.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="tpSomeImage.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>4, 25</value>
|
||||
</data>
|
||||
<data name="tpSomeImage.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 4, 4, 4</value>
|
||||
</data>
|
||||
<data name="tpSomeImage.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>4, 4, 4, 4</value>
|
||||
</data>
|
||||
<data name="tpSomeImage.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>1301, 612</value>
|
||||
</data>
|
||||
<data name="tpSomeImage.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="tpSomeImage.Text" xml:space="preserve">
|
||||
<value>SomeImage</value>
|
||||
</data>
|
||||
<data name=">>tpSomeImage.Name" xml:space="preserve">
|
||||
<value>tpSomeImage</value>
|
||||
</data>
|
||||
<data name=">>tpSomeImage.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=">>tpSomeImage.Parent" xml:space="preserve">
|
||||
<value>tcImageUploaders</value>
|
||||
</data>
|
||||
<data name=">>tpSomeImage.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="llVgymeAccountDetailsPage.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
|
@ -13102,4 +13237,4 @@ Using an encrypted library disables sharing.</value>
|
|||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
|
|
@ -25,9 +25,10 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
// Credits: https://github.com/DanielMcAssey
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ShareX.UploadersLib.ImageUploaders
|
||||
{
|
||||
|
@ -35,6 +36,8 @@ public sealed class SomeImage : ImageUploader
|
|||
{
|
||||
private const string API_ENDPOINT = "https://someimage.com/api/2/image/upload";
|
||||
|
||||
public bool DirectURL { get; set; }
|
||||
|
||||
private string API_KEY = "";
|
||||
|
||||
public SomeImage(string apiKey)
|
||||
|
@ -58,7 +61,31 @@ public override UploadResult Upload(Stream stream, string fileName)
|
|||
|
||||
if (jsonResponse != null)
|
||||
{
|
||||
result.URL = jsonResponse.imagelink;
|
||||
if (DirectURL)
|
||||
{
|
||||
if (jsonResponse.imagelink == null)
|
||||
{
|
||||
result.URL = null;
|
||||
}
|
||||
else {
|
||||
Uri responseUri = new Uri(jsonResponse.imagelink); // http://someimage.com/asdf
|
||||
string host = responseUri.Host; // someimage.com
|
||||
string filename = Path.GetFileName(responseUri.AbsolutePath); // /asdf
|
||||
if (filename.StartsWith("/"))
|
||||
{
|
||||
filename = filename.Remove(0, 1); // asdf
|
||||
}
|
||||
if (host.StartsWith("www."))
|
||||
{
|
||||
host = host.Remove(0, 4);
|
||||
}
|
||||
result.URL = "https://i1." + host + "/" + filename + ".jpg";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result.URL = jsonResponse.imagelink;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
274
ShareX.UploadersLib/Properties/Resources.Designer.cs
generated
274
ShareX.UploadersLib/Properties/Resources.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
|
@ -26,36 +26,36 @@
|
|||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
@ -440,6 +440,9 @@ Created folders:</value>
|
|||
<data name="Chevereto" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Favicons\Chevereto.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="SomeImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Favicons\SomeImage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="AmazonS3" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Favicons\AmazonS3.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
|
@ -494,4 +497,4 @@ Created folders:</value>
|
|||
<data name="Vgyme" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\favicons\vgyme.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
|
|
@ -884,6 +884,7 @@
|
|||
<None Include="Resources\question-button.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Favicons\SomeImage.png" />
|
||||
<Content Include="Favicons\Streamable.ico" />
|
||||
<Content Include="Favicons\Sul.png" />
|
||||
<Content Include="Favicons\Vgyme.ico" />
|
||||
|
@ -907,4 +908,4 @@ if not exist APIKeysLocal.cs (
|
|||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -23,14 +23,14 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CG.Web.MegaApiClient;
|
||||
using ShareX.HelpersLib;
|
||||
using ShareX.UploadersLib.FileUploaders;
|
||||
using ShareX.UploadersLib.HelperClasses;
|
||||
using ShareX.UploadersLib.ImageUploaders;
|
||||
using ShareX.UploadersLib.TextUploaders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ShareX.UploadersLib
|
||||
{
|
||||
|
@ -82,6 +82,11 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
|
|||
public string CheveretoAPIKey = string.Empty;
|
||||
public bool CheveretoDirectURL = true;
|
||||
|
||||
// SomeImage
|
||||
|
||||
public string SomeImageAPIKey = string.Empty;
|
||||
public bool SomeImageDirectURL = true;
|
||||
|
||||
// vgy.me
|
||||
|
||||
public string VgymeUserKey = string.Empty;
|
||||
|
@ -392,6 +397,8 @@ public bool IsValid(ImageDestination destination)
|
|||
return TwitterOAuthInfoList != null && TwitterOAuthInfoList.IsValidIndex(TwitterSelectedAccount) && OAuthInfo.CheckOAuth(TwitterOAuthInfoList[TwitterSelectedAccount]);
|
||||
case ImageDestination.Chevereto:
|
||||
return !string.IsNullOrEmpty(CheveretoWebsite) && !string.IsNullOrEmpty(CheveretoAPIKey);
|
||||
case ImageDestination.SomeImage:
|
||||
return !string.IsNullOrEmpty(SomeImageAPIKey);
|
||||
case ImageDestination.CustomImageUploader:
|
||||
return CustomUploadersList != null && CustomUploadersList.IsValidIndex(CustomImageUploaderSelected);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,14 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using ShareX.HelpersLib;
|
||||
using ShareX.Properties;
|
||||
using ShareX.UploadersLib;
|
||||
|
@ -32,14 +40,6 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.UploadersLib.ImageUploaders;
|
||||
using ShareX.UploadersLib.TextUploaders;
|
||||
using ShareX.UploadersLib.URLShorteners;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShareX
|
||||
{
|
||||
|
@ -827,7 +827,15 @@ public UploadResult UploadImage(Stream stream, string fileName)
|
|||
};
|
||||
break;
|
||||
case ImageDestination.SomeImage:
|
||||
imageUploader = new SomeImage(APIKeys.SomeImageKey);
|
||||
String someImageAPIKey = Program.UploadersConfig.SomeImageAPIKey;
|
||||
if (someImageAPIKey == "")
|
||||
{
|
||||
someImageAPIKey = APIKeys.SomeImageKey;
|
||||
}
|
||||
imageUploader = new SomeImage(someImageAPIKey)
|
||||
{
|
||||
DirectURL = Program.UploadersConfig.SomeImageDirectURL
|
||||
};
|
||||
break;
|
||||
case ImageDestination.CustomImageUploader:
|
||||
CustomUploaderItem customUploader = GetCustomUploader(Program.UploadersConfig.CustomImageUploaderSelected);
|
||||
|
|
Loading…
Reference in a new issue