diff --git a/ShareX.UploadersLib/Enums.cs b/ShareX.UploadersLib/Enums.cs index 7ae080702..c27c20dc7 100644 --- a/ShareX.UploadersLib/Enums.cs +++ b/ShareX.UploadersLib/Enums.cs @@ -132,6 +132,8 @@ public enum FileDestination Up1, [Description("Seafile")] Seafile, + [Description("Streamable")] + Streamable, SharedFolder, // Localized Email, // Localized CustomFileUploader // Localized @@ -322,4 +324,4 @@ public enum OAuthLoginStatus LoginSuccessful, LoginFailed } -} \ No newline at end of file +} diff --git a/ShareX.UploadersLib/FileUploaders/Streamable.cs b/ShareX.UploadersLib/FileUploaders/Streamable.cs new file mode 100644 index 000000000..089b895eb --- /dev/null +++ b/ShareX.UploadersLib/FileUploaders/Streamable.cs @@ -0,0 +1,133 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2015 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 . +*/ + +#endregion License Information (GPL v3) + + +using Newtonsoft.Json; +using ShareX.HelpersLib; +using ShareX.UploadersLib.HelperClasses; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; +using System.Threading; + +namespace ShareX.UploadersLib.FileUploaders +{ + public class Streamable : FileUploader + { + const string Host = "https://api.streamable.com"; + string Email; + string Password; + public Streamable(string email, string password) + { + Email = email; + Password = password; + } + + public override UploadResult Upload(Stream stream, string fileName) + { + Dictionary args = new Dictionary(); + NameValueCollection headers = new NameValueCollection(); + if (Email != "" && Password != "") { + headers.Add("Authorization", "Basic " + System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(Email + ":" + Password))); + } + + UploadResult result = UploadData(stream, Host + "/upload", fileName, "file", args, headers); + TranscodeFile(result); + return result; + } + + private void GetShortcode() + { + + } + + private void TranscodeFile(UploadResult result) + { + StreamableTranscodeResponse transcodeResponse = JsonConvert.DeserializeObject(result.Response); + + if (transcodeResponse.Shortcode != null) + { + ProgressManager progress = new ProgressManager(100); + + if (AllowReportProgress) + { + OnProgressChanged(progress); + } + + while (!StopUploadRequested) + { + string statusJson = SendRequest(HttpMethod.GET, Host + "/videos/" + transcodeResponse.Shortcode); + StreamableStatusResponse response = JsonConvert.DeserializeObject(statusJson); + + if (response.Status > 2) + { + result.Errors.Add(response.Message); + result.IsSuccess = false; + break; + } + else if (response.Status == 2) + { + if (AllowReportProgress) + { + long delta = 100 - progress.Position; + progress.UpdateProgress(delta); + OnProgressChanged(progress); + } + + result.IsSuccess = true; + result.URL = "https://streamable.com/" + transcodeResponse.Shortcode; + break; + } + + if (AllowReportProgress) + { + long delta = response.Percent - progress.Position; + progress.UpdateProgress(delta); + OnProgressChanged(progress); + } + + Thread.Sleep(100); + } + } + else + { + result.Errors.Add("Could not create video"); + result.IsSuccess = false; + } + } + } + + public class StreamableTranscodeResponse + { + public string Shortcode { get; set; } + public int Status { get; set; } + } + public class StreamableStatusResponse + { + public int Status { get; set; } + public string Message { get; set; } + public long Percent { get; set; } + } +} \ No newline at end of file diff --git a/ShareX.UploadersLib/Properties/Resources.Designer.cs b/ShareX.UploadersLib/Properties/Resources.Designer.cs index 79fe05ed8..b0e715a31 100644 --- a/ShareX.UploadersLib/Properties/Resources.Designer.cs +++ b/ShareX.UploadersLib/Properties/Resources.Designer.cs @@ -10,8 +10,8 @@ namespace ShareX.UploadersLib.Properties { using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace ShareX.UploadersLib.Properties { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -45,7 +45,7 @@ internal Resources() { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -59,7 +59,7 @@ internal Resources() { resourceCulture = value; } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -69,7 +69,7 @@ internal static System.Drawing.Icon AdFly { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -79,7 +79,7 @@ internal static System.Drawing.Icon AmazonS3 { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -89,7 +89,7 @@ internal static System.Drawing.Icon Bitly { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -99,7 +99,7 @@ internal static System.Drawing.Icon Box { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized string similar to Browse for a certificate file.... /// @@ -108,7 +108,7 @@ internal static string CertFileNameEditor_EditValue_Browse_for_a_certificate_fil return ResourceManager.GetString("CertFileNameEditor_EditValue_Browse_for_a_certificate_file___", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -118,7 +118,7 @@ internal static System.Drawing.Bitmap Chevereto { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -128,7 +128,7 @@ internal static System.Drawing.Icon CoinURL { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -138,7 +138,7 @@ internal static System.Drawing.Icon Copy { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -148,7 +148,7 @@ internal static System.Drawing.Icon Dropbox { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized string similar to Path not exist:. /// @@ -157,7 +157,7 @@ internal static string DropboxFilesForm_OpenDirectory_Path_not_exist_ { return ResourceManager.GetString("DropboxFilesForm_OpenDirectory_Path_not_exist_", resourceCulture); } } - + /// /// Looks up a localized string similar to Directory name to create. /// @@ -166,7 +166,7 @@ internal static string DropboxFilesForm_tsmiCreateDirectory_Click_Directory_name return ResourceManager.GetString("DropboxFilesForm_tsmiCreateDirectory_Click_Directory_name_to_create", resourceCulture); } } - + /// /// Looks up a localized string similar to Are you sure you want to delete "{0}" from your Dropbox?. /// @@ -176,7 +176,7 @@ internal static string DropboxFilesForm_tsmiDelete_Click_Are_you_sure_you_want_t "_Dropbox_", resourceCulture); } } - + /// /// Looks up a localized string similar to Delete file?. /// @@ -185,7 +185,7 @@ internal static string DropboxFilesForm_tsmiDelete_Click_Delete_file_ { return ResourceManager.GetString("DropboxFilesForm_tsmiDelete_Click_Delete_file_", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -195,7 +195,7 @@ internal static System.Drawing.Icon Flickr { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -205,7 +205,7 @@ internal static System.Drawing.Bitmap folder { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -215,7 +215,7 @@ internal static System.Drawing.Bitmap folder_gray { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -225,7 +225,7 @@ internal static System.Drawing.Bitmap folder_network { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -235,7 +235,7 @@ internal static System.Drawing.Bitmap folder_photos { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -245,7 +245,7 @@ internal static System.Drawing.Bitmap folder_public { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -255,7 +255,7 @@ internal static System.Drawing.Bitmap folder_star { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -265,7 +265,7 @@ internal static System.Drawing.Bitmap folder_user { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized string similar to Connecting to {0}. /// @@ -274,7 +274,7 @@ internal static string FTPClientForm_FTPClientForm_Connecting_to__0_ { return ResourceManager.GetString("FTPClientForm_FTPClientForm_Connecting_to__0_", resourceCulture); } } - + /// /// Looks up a localized string similar to ShareX FTP client. /// @@ -283,7 +283,7 @@ internal static string FTPClientForm_FTPClientForm_ShareX_FTP_client { return ResourceManager.GetString("FTPClientForm_FTPClientForm_ShareX_FTP_client", resourceCulture); } } - + /// /// Looks up a localized string similar to Directory name to create. /// @@ -292,7 +292,7 @@ internal static string FTPClientForm_FTPCreateDirectory_Directory_name_to_create return ResourceManager.GetString("FTPClientForm_FTPCreateDirectory_Directory_name_to_create", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -302,7 +302,7 @@ internal static System.Drawing.Icon Gett { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -312,7 +312,7 @@ internal static System.Drawing.Icon GitHub { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -322,7 +322,7 @@ internal static System.Drawing.Bitmap globe_network { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -332,7 +332,7 @@ internal static System.Drawing.Icon Google { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -342,7 +342,7 @@ internal static System.Drawing.Icon GoogleDrive { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -352,7 +352,7 @@ internal static System.Drawing.Bitmap Hastebin { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -362,7 +362,7 @@ internal static System.Drawing.Icon Hostr { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -372,7 +372,7 @@ internal static System.Drawing.Icon ImageShack { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -382,7 +382,7 @@ internal static System.Drawing.Icon Imgur { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -392,7 +392,7 @@ internal static System.Drawing.Bitmap jira { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized string similar to Issue not found. /// @@ -401,7 +401,7 @@ internal static string JiraUpload_ValidateIssueId_Issue_not_found { return ResourceManager.GetString("JiraUpload_ValidateIssueId_Issue_not_found", resourceCulture); } } - + /// /// Looks up a localized string similar to Browse for a key file.... /// @@ -410,7 +410,7 @@ internal static string KeyFileNameEditor_EditValue_Browse_for_a_key_file___ { return ResourceManager.GetString("KeyFileNameEditor_EditValue_Browse_for_a_key_file___", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -420,7 +420,7 @@ internal static System.Drawing.Icon Lambda { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -430,7 +430,7 @@ internal static System.Drawing.Bitmap mail { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -440,7 +440,7 @@ internal static System.Drawing.Icon MediaFire { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -450,7 +450,7 @@ internal static System.Drawing.Icon Mega { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -460,7 +460,7 @@ internal static System.Drawing.Icon Minus { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized string similar to Status: Logged in.. /// @@ -469,7 +469,7 @@ internal static string OAuthControl_Status_Status__Logged_in_ { return ResourceManager.GetString("OAuthControl_Status_Status__Logged_in_", resourceCulture); } } - + /// /// Looks up a localized string similar to Status: Login failed.. /// @@ -478,7 +478,7 @@ internal static string OAuthControl_Status_Status__Login_failed_ { return ResourceManager.GetString("OAuthControl_Status_Status__Login_failed_", resourceCulture); } } - + /// /// Looks up a localized string similar to Status: Not logged in.. /// @@ -487,7 +487,7 @@ internal static string OAuthControl_Status_Status__Not_logged_in_ { return ResourceManager.GetString("OAuthControl_Status_Status__Not_logged_in_", resourceCulture); } } - + /// /// Looks up a localized string similar to New account. /// @@ -496,7 +496,7 @@ internal static string OAuthInfo_OAuthInfo_New_account { return ResourceManager.GetString("OAuthInfo_OAuthInfo_New_account", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -506,7 +506,7 @@ internal static System.Drawing.Icon OneDrive { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized string similar to Root folder. /// @@ -515,7 +515,7 @@ internal static string OneDrive_RootFolder_Root_folder { return ResourceManager.GetString("OneDrive_RootFolder_Root_folder", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -525,7 +525,7 @@ internal static System.Drawing.Icon OneTimeSecret { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -535,7 +535,7 @@ internal static System.Drawing.Bitmap OwnCloud { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -545,7 +545,7 @@ internal static System.Drawing.Bitmap package { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -555,7 +555,7 @@ internal static System.Drawing.Bitmap page_white { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -565,7 +565,7 @@ internal static System.Drawing.Bitmap page_white_acrobat { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -575,7 +575,7 @@ internal static System.Drawing.Bitmap page_white_actionscript { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -585,7 +585,7 @@ internal static System.Drawing.Bitmap page_white_c { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -595,7 +595,7 @@ internal static System.Drawing.Bitmap page_white_code { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -605,7 +605,7 @@ internal static System.Drawing.Bitmap page_white_compressed { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -615,7 +615,7 @@ internal static System.Drawing.Bitmap page_white_cplusplus { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -625,7 +625,7 @@ internal static System.Drawing.Bitmap page_white_csharp { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -635,7 +635,7 @@ internal static System.Drawing.Bitmap page_white_cup { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -645,7 +645,7 @@ internal static System.Drawing.Bitmap page_white_dvd { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -655,7 +655,7 @@ internal static System.Drawing.Bitmap page_white_excel { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -665,7 +665,7 @@ internal static System.Drawing.Bitmap page_white_film { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -675,7 +675,7 @@ internal static System.Drawing.Bitmap page_white_flash { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -685,7 +685,7 @@ internal static System.Drawing.Bitmap page_white_gear { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -695,7 +695,7 @@ internal static System.Drawing.Bitmap page_white_paint { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -705,7 +705,7 @@ internal static System.Drawing.Bitmap page_white_php { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -715,7 +715,7 @@ internal static System.Drawing.Bitmap page_white_picture { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -725,7 +725,7 @@ internal static System.Drawing.Bitmap page_white_powerpoint { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -735,7 +735,7 @@ internal static System.Drawing.Bitmap page_white_ruby { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -745,7 +745,7 @@ internal static System.Drawing.Bitmap page_white_sound { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -755,7 +755,7 @@ internal static System.Drawing.Bitmap page_white_text { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -765,7 +765,7 @@ internal static System.Drawing.Bitmap page_white_tux { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -775,7 +775,7 @@ internal static System.Drawing.Bitmap page_white_vector { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -785,7 +785,7 @@ internal static System.Drawing.Bitmap page_white_visualstudio { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -795,7 +795,7 @@ internal static System.Drawing.Bitmap page_white_word { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -805,7 +805,7 @@ internal static System.Drawing.Icon Pastebin { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -815,7 +815,7 @@ internal static System.Drawing.Icon Photobucket { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -825,7 +825,7 @@ internal static System.Drawing.Icon Picasa { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -835,7 +835,7 @@ internal static System.Drawing.Icon Polr { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -845,7 +845,7 @@ internal static System.Drawing.Icon Pomf { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized string similar to Please select one of the Pomf uploaders from "Destination settings window -> Pomf tab".. /// @@ -855,7 +855,7 @@ internal static string Pomf_Upload_Please_select_one_of_the_Pomf_uploaders_from_ "ndow____Pomf_tab__", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -865,7 +865,7 @@ internal static System.Drawing.Icon Pushbullet { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -875,7 +875,17 @@ internal static System.Drawing.Bitmap Seafile { return ((System.Drawing.Bitmap)(obj)); } } - + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon Streamable { + get { + object obj = ResourceManager.GetObject("Streamable", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -885,7 +895,7 @@ internal static System.Drawing.Icon SendSpace { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -895,7 +905,7 @@ internal static System.Drawing.Bitmap server_network { return ((System.Drawing.Bitmap)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -905,7 +915,7 @@ internal static System.Drawing.Icon TinyPic { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -915,7 +925,7 @@ internal static System.Drawing.Icon Twitter { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized string similar to Tweet error. /// @@ -924,7 +934,7 @@ internal static string TwitterTweetForm_SendTweet_Tweet_error { return ResourceManager.GetString("TwitterTweetForm_SendTweet_Tweet_error", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -934,7 +944,7 @@ internal static System.Drawing.Icon Up1 { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// @@ -944,7 +954,7 @@ internal static System.Drawing.Icon Upaste { return ((System.Drawing.Icon)(obj)); } } - + /// /// Looks up a localized string similar to Box refresh folders list failed. /// @@ -953,7 +963,7 @@ internal static string UploadersConfigForm_BoxListFolders_Box_refresh_folders_li return ResourceManager.GetString("UploadersConfigForm_BoxListFolders_Box_refresh_folders_list_failed", resourceCulture); } } - + /// /// Looks up a localized string similar to Login successful but getting account info failed.. /// @@ -963,7 +973,7 @@ internal static string UploadersConfigForm_DropboxAuthComplete_Login_successful_ "_failed_", resourceCulture); } } - + /// /// Looks up a localized string similar to Error. /// @@ -972,7 +982,7 @@ internal static string UploadersConfigForm_Error { return ResourceManager.GetString("UploadersConfigForm_Error", resourceCulture); } } - + /// /// Looks up a localized string similar to FTP client only supports FTP or FTPS.. /// @@ -981,7 +991,7 @@ internal static string UploadersConfigForm_FTPOpenClient_FTP_client_only_support return ResourceManager.GetString("UploadersConfigForm_FTPOpenClient_FTP_client_only_supports_FTP_or_FTPS_", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to find valid FTP account.. /// @@ -990,7 +1000,7 @@ internal static string UploadersConfigForm_FTPOpenClient_Unable_to_find_valid_FT return ResourceManager.GetString("UploadersConfigForm_FTPOpenClient_Unable_to_find_valid_FTP_account_", resourceCulture); } } - + /// /// Looks up a localized string similar to Hubic refresh folders list failed. /// @@ -999,7 +1009,7 @@ internal static string UploadersConfigForm_HubicListFolders_Hubic_refresh_folder return ResourceManager.GetString("UploadersConfigForm_HubicListFolders_Hubic_refresh_folders_list_failed", resourceCulture); } } - + /// /// Looks up a localized string similar to Authentication required.. /// @@ -1008,7 +1018,7 @@ internal static string UploadersConfigForm_ListFolders_Authentication_required_ return ResourceManager.GetString("UploadersConfigForm_ListFolders_Authentication_required_", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid device name. /// @@ -1017,7 +1027,7 @@ internal static string UploadersConfigForm_LoadSettings_Invalid_device_name { return ResourceManager.GetString("UploadersConfigForm_LoadSettings_Invalid_device_name", resourceCulture); } } - + /// /// Looks up a localized string similar to Parent album path e.g.. /// @@ -1026,7 +1036,7 @@ internal static string UploadersConfigForm_LoadSettings_Parent_album_path_e_g_ { return ResourceManager.GetString("UploadersConfigForm_LoadSettings_Parent_album_path_e_g_", resourceCulture); } } - + /// /// Looks up a localized string similar to Selected folder:. /// @@ -1035,7 +1045,7 @@ internal static string UploadersConfigForm_LoadSettings_Selected_folder_ { return ResourceManager.GetString("UploadersConfigForm_LoadSettings_Selected_folder_", resourceCulture); } } - + /// /// Looks up a localized string similar to Login failed.. /// @@ -1044,7 +1054,7 @@ internal static string UploadersConfigForm_Login_failed { return ResourceManager.GetString("UploadersConfigForm_Login_failed", resourceCulture); } } - + /// /// Looks up a localized string similar to Login successful.. /// @@ -1053,7 +1063,7 @@ internal static string UploadersConfigForm_Login_successful { return ResourceManager.GetString("UploadersConfigForm_Login_successful", resourceCulture); } } - + /// /// Looks up a localized string similar to Click refresh button. /// @@ -1062,7 +1072,7 @@ internal static string UploadersConfigForm_MegaConfigureTab_Click_refresh_button return ResourceManager.GetString("UploadersConfigForm_MegaConfigureTab_Click_refresh_button", resourceCulture); } } - + /// /// Looks up a localized string similar to Configured. /// @@ -1071,7 +1081,7 @@ internal static string UploadersConfigForm_MegaConfigureTab_Configured { return ResourceManager.GetString("UploadersConfigForm_MegaConfigureTab_Configured", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid authentication. /// @@ -1080,7 +1090,7 @@ internal static string UploadersConfigForm_MegaConfigureTab_Invalid_authenticati return ResourceManager.GetString("UploadersConfigForm_MegaConfigureTab_Invalid_authentication", resourceCulture); } } - + /// /// Looks up a localized string similar to Not configured. /// @@ -1089,7 +1099,7 @@ internal static string UploadersConfigForm_MegaConfigureTab_Not_configured { return ResourceManager.GetString("UploadersConfigForm_MegaConfigureTab_Not_configured", resourceCulture); } } - + /// /// Looks up a localized string similar to Logged in as {0}.. /// @@ -1098,7 +1108,7 @@ internal static string UploadersConfigForm_MinusUpdateControls_Logged_in_as__0__ return ResourceManager.GetString("UploadersConfigForm_MinusUpdateControls_Logged_in_as__0__", resourceCulture); } } - + /// /// Looks up a localized string similar to Not logged in.. /// @@ -1107,7 +1117,7 @@ internal static string UploadersConfigForm_MinusUpdateControls_Not_logged_in_ { return ResourceManager.GetString("UploadersConfigForm_MinusUpdateControls_Not_logged_in_", resourceCulture); } } - + /// /// Looks up a localized string similar to Refresh authorization is not supported.. /// @@ -1117,7 +1127,7 @@ internal static string UploadersConfigForm_oAuthJira_RefreshButtonClicked_Refres "upported_", resourceCulture); } } - + /// /// Looks up a localized string similar to Querying folders.... /// @@ -1126,7 +1136,7 @@ internal static string UploadersConfigForm_OneDriveAddFolder_Querying_folders___ return ResourceManager.GetString("UploadersConfigForm_OneDriveAddFolder_Querying_folders___", resourceCulture); } } - + /// /// Looks up a localized string similar to {0} successfully created.. /// @@ -1135,7 +1145,7 @@ internal static string UploadersConfigForm_PhotobucketCreateAlbum__0__successful return ResourceManager.GetString("UploadersConfigForm_PhotobucketCreateAlbum__0__successfully_created_", resourceCulture); } } - + /// /// Looks up a localized string similar to SendSpace registration. /// @@ -1144,7 +1154,7 @@ internal static string UploadersConfigForm_SendSpaceRegister_SendSpace_Registrat return ResourceManager.GetString("UploadersConfigForm_SendSpaceRegister_SendSpace_Registration___", resourceCulture); } } - + /// /// Looks up a localized string similar to Error: Result is empty.. /// @@ -1153,7 +1163,7 @@ internal static string UploadersConfigForm_TestCustomUploader_Error__Result_is_e return ResourceManager.GetString("UploadersConfigForm_TestCustomUploader_Error__Result_is_empty_", resourceCulture); } } - + /// /// Looks up a localized string similar to Connected!. /// @@ -1162,7 +1172,7 @@ internal static string UploadersConfigForm_TestFTPAccount_Connected_ { return ResourceManager.GetString("UploadersConfigForm_TestFTPAccount_Connected_", resourceCulture); } } - + /// /// Looks up a localized string similar to Connected! ///Created folders:. @@ -1172,7 +1182,7 @@ internal static string UploadersConfigForm_TestFTPAccount_Connected_Created_fold return ResourceManager.GetString("UploadersConfigForm_TestFTPAccount_Connected_Created_folders", resourceCulture); } } - + /// /// Looks up a localized string similar to Download path:. /// @@ -1181,7 +1191,7 @@ internal static string UploadersConfigForm_UpdateDropboxStatus_Download_path_ { return ResourceManager.GetString("UploadersConfigForm_UpdateDropboxStatus_Download_path_", resourceCulture); } } - + /// /// Looks up a localized string similar to Email:. /// @@ -1190,7 +1200,7 @@ internal static string UploadersConfigForm_UpdateDropboxStatus_Email_ { return ResourceManager.GetString("UploadersConfigForm_UpdateDropboxStatus_Email_", resourceCulture); } } - + /// /// Looks up a localized string similar to Name:. /// @@ -1199,7 +1209,7 @@ internal static string UploadersConfigForm_UpdateDropboxStatus_Name_ { return ResourceManager.GetString("UploadersConfigForm_UpdateDropboxStatus_Name_", resourceCulture); } } - + /// /// Looks up a localized string similar to Upload path:. /// @@ -1208,7 +1218,7 @@ internal static string UploadersConfigForm_UpdateDropboxStatus_Upload_path_ { return ResourceManager.GetString("UploadersConfigForm_UpdateDropboxStatus_Upload_path_", resourceCulture); } } - + /// /// Looks up a localized string similar to User ID:. /// @@ -1217,7 +1227,7 @@ internal static string UploadersConfigForm_UpdateDropboxStatus_User_ID_ { return ResourceManager.GetString("UploadersConfigForm_UpdateDropboxStatus_User_ID_", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// diff --git a/ShareX.UploadersLib/Properties/Resources.resx b/ShareX.UploadersLib/Properties/Resources.resx index 227d2a8db..244699855 100644 --- a/ShareX.UploadersLib/Properties/Resources.resx +++ b/ShareX.UploadersLib/Properties/Resources.resx @@ -1,17 +1,17 @@  - @@ -482,4 +482,7 @@ Created folders: ..\Favicons\Seafile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file + + ..\Favicons\Streamable.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + diff --git a/ShareX.UploadersLib/ShareX.UploadersLib.csproj b/ShareX.UploadersLib/ShareX.UploadersLib.csproj index c1bfe2cd4..68fe70c9a 100644 --- a/ShareX.UploadersLib/ShareX.UploadersLib.csproj +++ b/ShareX.UploadersLib/ShareX.UploadersLib.csproj @@ -136,6 +136,7 @@ + @@ -888,11 +889,11 @@ if not exist APIKeysLocal.cs ( type nul > APIKeysLocal.cs ) - - \ No newline at end of file + diff --git a/ShareX.UploadersLib/UploadersConfig.cs b/ShareX.UploadersLib/UploadersConfig.cs index 27b682568..8f73f1385 100644 --- a/ShareX.UploadersLib/UploadersConfig.cs +++ b/ShareX.UploadersLib/UploadersConfig.cs @@ -269,6 +269,12 @@ public class UploadersConfig : SettingsBase public string SeafileAccInfoEmail = ""; public string SeafileAccInfoUsage = ""; + // Streamable + + public string StreamableUsername = ""; + public string StreamablePassword = ""; + public bool StreamableAnonymous = true; + #endregion File uploaders #region URL shorteners @@ -520,4 +526,4 @@ public int GetLocalhostIndex(EDataType dataType) #endregion Helper Methods } -} \ No newline at end of file +} diff --git a/ShareX/WorkerTask.cs b/ShareX/WorkerTask.cs index 0b67b1b98..cc86ee7fc 100644 --- a/ShareX/WorkerTask.cs +++ b/ShareX/WorkerTask.cs @@ -1120,6 +1120,16 @@ public UploadResult UploadFile(Stream stream, string fileName) IgnoreInvalidCert = Program.UploadersConfig.SeafileIgnoreInvalidCert }; break; + case FileDestination.Streamable: + string user = ""; + string password = ""; + if (!Program.UploadersConfig.StreamableAnonymous) { + user = Program.UploadersConfig.StreamableUsername; + password = Program.UploadersConfig.StreamablePassword; + } + + fileUploader = new Streamable(user, password); + break; } if (fileUploader != null) @@ -1490,4 +1500,4 @@ public void Dispose() } } } -} \ No newline at end of file +}