DeQmaTech.YandexDiskSDK
3.3.0
.NET Core 2.1
.NET Standard 2.0
.NET Framework 4.5.2
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 |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net452 net46 net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
Compatible target framework(s)
Additional computed target framework(s)
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.