DeQmaTech.YandexDiskSDK
3.3.0
.NET Core 2.1
This package targets .NET Core 2.1. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.5.2
This package targets .NET Framework 4.5.2. The package is compatible with this framework or higher.
dotnet add package DeQmaTech.YandexDiskSDK --version 3.3.0
NuGet\Install-Package DeQmaTech.YandexDiskSDK -Version 3.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DeQmaTech.YandexDiskSDK" Version="3.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DeQmaTech.YandexDiskSDK --version 3.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DeQmaTech.YandexDiskSDK, 3.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DeQmaTech.YandexDiskSDK as a Cake Addin #addin nuget:?package=DeQmaTech.YandexDiskSDK&version=3.3.0 // Install DeQmaTech.YandexDiskSDK as a Cake Tool #tool nuget:?package=DeQmaTech.YandexDiskSDK&version=3.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Features
- Assemblies for .NET 4.5.2 and .NET Standard 2.0
- Just one external reference (Newtonsoft.Json)
- Easy installation using NuGet
- Upload/Download tracking support
- Proxy Support
- Upload/Download cancellation support
List of functions:
Token
- OneYearToken
- GetTokenFromCode
Mine
- UserInfo
- CheckOperationStatus
- ListLatestUploadedFiles
Items
- ListAllFiles
- List
- FD_Move
- FD_Copy
- FD_Rename
- FD_Trash
- FD_Delete
- D_Create
- F_GetDownloadUrl
- FD_Privacy
- FD_Metadata
- F_Download
- F_DownloadLarge
- F_DownloadAsStream
- D_DownloadAsZip
- Upload
- UploadRemotely
- FD_Exists
- GetThumbnail
- FD_AddTag
RecycleBin
- List
- EmptyTrashBin
- Restore
Sharing
- ListAllSharedLinks
- PublicFolderContents
- GetDownloadUrlOfFileInPublicFolder
- PublicUrlToPublicKey
- Metadata
- PublicUrlToDirectUrl
- DownloadPublicFile
CodeMap:
Code simple:
Async Function AllTasks() As Task
'first get auth token (one time only)
Dim tokn = YandexDiskSDK.GetToken.OneYearToken(YandexDiskSDK.utilitiez.ResponseType.token, "yourclientid")
'OR
Dim cod = YandexDiskSDK.GetToken.OneYearToken(YandexDiskSDK.utilitiez.ResponseType.code, "yourclientid")
Dim exchanecodewithtoken = YandexDiskSDK.GetToken.GetTokenFromCode("yourclientid", cod, "yourAppSectretKey")
''set proxy and connection options
Dim con As New YandexDiskSDK.ConnectionSettings With {.CloseConnection = True, .TimeOut = TimeSpan.FromMinutes(30), .Proxy = New YandexDiskSDK.ProxyConfig With {.SetProxy = True, .ProxyIP = "127.0.0.1", .ProxyPort = 8888, .ProxyUsername = "user", .ProxyPassword = "pass"}}
''set api client
Dim CLNT As YandexDiskSDK.IClient = New YandexDiskSDK.YClient("xxxxxtokenxxxxx", con)
''general
Await CLNT.UserInfo()
Await CLNT.CheckOperationStatus("")
Await CLNT.ListLatestUploadedFiles()
''singleitem
'' [D_] = dir
'' [F_] = file
'' [FD_] = file & dir
Await CLNT.Item("folder_path").D_Create("new folder")
Dim cts As New Threading.CancellationTokenSource()
Dim _ReportCls As New Progress(Of YandexDiskSDK.ReportStatus)(Sub(ReportClass As YandexDiskSDK.ReportStatus) Console.WriteLine(String.Format("{0} - {1}% - {2}", String.Format("{0}/{1}", (ReportClass.BytesTransferred), (ReportClass.TotalBytes)), CInt(ReportClass.ProgressPercentage), ReportClass.TextStatus)))
Await CLNT.Item("folder_path").D_DownloadAsZip("c:\\downloads", _ReportCls, cts.Token)
Await CLNT.Item("file_path OR folder_path").FD_AddTag("{""foo"":1, ""bar"":2}")
Await CLNT.Item("file_path OR folder_path").FD_Copy("folder_path", Nothing, False)
Await CLNT.Item("file_path OR folder_path").FD_Delete
Await CLNT.Item("file_path OR folder_path").FD_Move("folder_path", Nothing, False)
Await CLNT.Item("file_path OR folder_path").FD_Exists
Await CLNT.Item("file_path OR folder_path").FD_Metadata(True, PreviewSizeEnum.S_300)
Await CLNT.Item("file_path OR folder_path").FD_Privacy(PrivacyEnum.Public)
Await CLNT.Item("file_path OR folder_path").FD_Rename("newname.jpg")
Await CLNT.Item("file_path OR folder_path").FD_Trash
Await CLNT.Item("file_path").F_Download("c:\\downloads", _ReportCls, cts.Token)
Await CLNT.Item("file_path").F_DownloadAsStream(_ReportCls, cts.Token)
Await CLNT.Item("file_path").F_DownloadLarge("c:\\downloads", _ReportCls, cts.Token)
Await CLNT.Item("file_path").F_GetDownloadUrl()
Await CLNT.Item("file_path").F_GetThumbnail(New Uri("preview_url"), _ReportCls, cts.Token)
Await CLNT.Item("root_path OR folder_path").D_List(False, PreviewSizeEnum.S_500, SortEnum.created, 20, 0)
Await CLNT.Item("root_path OR folder_path").D_ListAllFiles(New List(Of FilterEnum) From {FilterEnum.audio, FilterEnum.video}, True, PreviewSizeEnum.S_150, SortEnum.path, 20, 0)
Await CLNT.Item("folder_path").D_Upload("c:\\VIDO.mp4", UploadTypes.FilePath, "VIDO.mp4", True, _ReportCls, cts.Token)
Await CLNT.Item("folder_path").D_UploadRemotely(New Uri("https://domain.com/watch.mp4"), "watch.mp4", False)
''RecycleBin
Await CLNT.RecycleBin(CLNT.RootPath(DestinationType.trash)).EmptyTrashBin
Await CLNT.RecycleBin("trashroot_path OR trashfolder_path").List(False, PreviewSizeEnum.S_150, SortEnum.size, 20, 0)
Await CLNT.RecycleBin("trashfile_path OR trashfolder_path").Restore
''root
Dim root = CLNT.RootPath(DestinationType.disk)
''Sharing
Await CLNT.Sharing.DownloadPublicFile(New Uri("https://yadi.sk/i/xxxxx"), "c:\\downloads", _ReportCls, cts.Token)
Await CLNT.Sharing.GetDownloadUrlOfFileInPublicFolder("https://yadi.sk/d/xxxxx", "/img.jpg")
Await CLNT.Sharing.ListAllSharedLinks(ItemTypeEnum.file, Fields.name, Nothing, 20, 0)
Await CLNT.Sharing.Metadata(New Uri("https://yadi.sk/i/xxxxx"))
Await CLNT.Sharing.PublicFolderContents("https://yadi.sk/d/xxxxx", Nothing, SortEnum.path, False, PreviewSizeEnum.S_1024, 20, 0)
Await CLNT.Sharing.PublicUrlToDirectUrl(New Uri("https://yadi.sk/i/xxxxx"))
Await CLNT.Sharing.PublicUrlToPublicKey(New Uri("https://yadi.sk/d/xxxxx"))
End Function
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 2.1
- Microsoft.AspNet.WebApi.Client (>= 5.2.3)
- Newtonsoft.Json (>= 11.0.2)
-
.NETFramework 4.5.2
- Microsoft.AspNet.WebApi.Client (>= 5.2.3)
- Newtonsoft.Json (>= 11.0.2)
-
.NETStandard 2.0
- Microsoft.AspNet.WebApi.Client (>= 5.2.3)
- Newtonsoft.Json (>= 11.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.