inyutin-maxim / vknet.audiobypass Goto Github PK
View Code? Open in Web Editor NEWОбход закрытия методов audio и messages для VkNet
License: MIT License
Обход закрытия методов audio и messages для VkNet
License: MIT License
Здравствуйте, все методы из расширения помечены как устаревшие и не работают, будет ли доступна возможность скачивания в ближайшее время?
System.InvalidOperationException: GetReceipt bad response: PHONE_REGISTRATION_ERROR System.Net.Http.FormUrlEncodedContent at VkNet.AudioBypassService.Utils.FakeSafetyNetClient.GetReceipt(AndroidCheckinResponse credentials) at VkNet.AudioBypassService.Utils.ReceiptParser.GetReceipt() at VkNet.AudioBypassService.Utils.VkAndroidAuthorization.AuthorizeAsync() at VkNet.VkApi.BaseAuthorize(IApiAuthParams authParams) at VkNet.VkApi.AuthorizeWithAntiCaptcha(IApiAuthParams authParams) at VkNet.VkApi.Authorize(IApiAuthParams params) at VkNet.VkApi.<>c__DisplayClass47_0.<AuthorizeAsync>b__0() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at MusConv.Lib.VkMusic.VkMusicApi.AuthorizationAsync(IApiAuthParams authParams) in F:\musconv\musconv-avalonia\MusConv.Models\MusConv.Lib.VkMusic\VkMusicApi.cs:line 155 at MusConv.Lib.VkMusic.VkMusicApi.AuthorizationAsync(String login, String password, String twoFactorCode) in F:\musconv\musconv-avalonia\MusConv.Models\MusConv.Lib.VkMusic\VkMusicApi.cs:line 102 at MusConv.ViewModels.Models.MusicService.VKModel.AuthorizeCredAsync(String login, String password) in F:\musconv\musconv-avalonia\MusConv.ViewModels\Models\MusicService\VKModel.cs:line 36 at MusConv.ViewModels.ViewModels.SectionViewModels.VKViewModel.AuthorizeWithLoginAndPassword(String login, String password) in F:\musconv\musconv-avalonia\MusConv.ViewModels\ViewModels\SectionViewModels\VKViewModel.cs:line 193 at MusConv.ViewModels.ViewModels.SectionViewModels.VKViewModel.Web_NavigatingAsync(Object s, Object t) in F:\musconv\musconv-avalonia\MusConv.ViewModels\ViewModels\SectionViewModels\VKViewModel.cs:line 256a
При попытке авторизоваться выбрасывается исключение: MissingMethodException
System.MissingMethodException: Метод не найден: "VkNet.Utils.HttpResponse`1<!0>
VkNet.Utils.HttpResponse`1.Success(System.Net.HttpStatusCode, !0, System.String)".
at в VkNet.AudioBypassService.Utils.RestClientWithUserAgent.<CallAsync>d__14.MoveNext()
at в System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at в VkNet.AudioBypassService.Utils.RestClientWithUserAgent.CallAsync(Func`1 method)
at в VkNet.AudioBypassService.Utils.RestClientWithUserAgent.PostAsync(Uri uri, IEnumerable`1 parameters)
at в VkNet.AudioBypassService.Utils.VkApiInvoker.<InvokeAsyncInternal>d__8.MoveNext()
at в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at в System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at в VkNet.AudioBypassService.Utils.VkApiInvoker.<CallAsync>d__5.MoveNext()
at в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at в System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at в VkNet.AudioBypassService.Utils.VkApiInvoker.<CallAsync>d__4`1.MoveNext()
at в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at в System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at в VkNet.AudioBypassService.Utils.VkAndroidAuthorization.<BaseAuthAsync>d__9.MoveNext()
at в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at в System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at в VkNet.AudioBypassService.Utils.VkAndroidAuthorization.<AuthorizeAsync>d__7.MoveNext()
at в System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at в System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at в VkNet.VkApi.BaseAuthorize(IApiAuthParams authParams)
at в VkNet.VkApi.<>c__DisplayClass247_0.<AuthorizeWithAntiCaptcha>b__0(Nullable`1 sid, String key)
at в VkNet.Utils.CaptchaHandler.Perform[T](Func`3 action)
at в VkNet.VkApi.AuthorizeWithAntiCaptcha(IApiAuthParams authParams)
at в VkNet.VkApi.Authorize(IApiAuthParams params)
Судя по всему причиной тому стал этот коммит в VkNet
VkNet.Exception.UnknownMethodException: Unknown method passed
?, in void VkErrors.IfErrorThrowException(string json)
?, in string VkApi.Invoke(string methodName, IDictionary<string, string> parameters, bool skipAuthorization)
?, in string VkApi.CallBase(string methodName, VkParameters parameters, bool skipAuthorization)
?, in T VkApi.Call<T>(string methodName, VkParameters parameters, bool skipAuthorization, params JsonConverter[] jsonConverters)
?, in VkCollection<AudioPlaylist> AudioCategory.GetPlaylists(long ownerId, uint? count, uint? offset)
?, in Task<VkCollection<AudioPlaylist>> AudioCategory.GetPlaylistsAsync(long ownerId, uint? count, uint? offset)+() => { }
Может кто-то сталкивался с подобным ?
При вызове метода Authorize появляется исключение: Метод не найден: "Void VkNet.Utils.VkErrors.IfErrorThrowException(System.String)"
Версия 1.6.0
При авторизации выкидывает следующее:
VkNet.Exception.VkApiException: Form element not found.
at VkNet.Utils.WebForm.GetFormNode()
at VkNet.Utils.WebForm.ParseInputs()
at VkNet.Utils.WebForm..ctor(WebCallResult result)
at VkNet.Utils.WebForm.From(WebCallResult result)
at VkNet.Utils.Browser.FilledLoginFormAsync(String email, String password, WebCallResult authorizeUrlResult)
at VkNet.Utils.Browser.NextStepAsync(WebCallResult formResult)
at VkNet.Utils.Browser.AuthorizeAsync()
at VkNet.VkApi.BaseAuthorize(IApiAuthParams authParams)
at VkNet.VkApi.AuthorizeWithAntiCaptcha(IApiAuthParams authParams)
at VkNet.VkApi.Authorize(IApiAuthParams params)
at VkNet.VkApi.Authorize(ApiAuthParams params)
https://github.com/hikiblade/VkNet.AudioBypass/blob/80662996b1d676b832cd7119eb7fbdd247092d01/VkNet.AudioBypassService/ReceiptParser.cs#L24-L29
Предлагаю дать возможность указать его вручную или оживить!
Как вариант - форкнуть получение receipt's от гугла из https://github.com/Rast1234/VOffline/tree/master/VOffline/Services/Token
После авторизации метод api.Audio.Search
стал выдавать исключение "Client version deprecated"
api.Authorize(new ApiAuthParams
{
Login ="799999999999",
Password = "myVKpassword"
});
var audios = api.Audio.Search(new AudioSearchParams
{
Autocomplete = false,
Query = "Kino - Gruppa",
Count = 1,
SearchOwn = false,
Sort = AudioSort.AddedDate
});
{VkNet.Infrastructure.VkApiVersionManager}: VkApiVersion = 5.126
.net5.0
VkNet v.1.69.0
VkNet.AudioBypassService v.1.7.3
Здравствуйте. Если я правильно понял, этот метод для скачивания аудио. Можете, пожалуйста, дать пример входного параметра "this IAudioCategoryAsync audioCategory", с другими двумя я смог разобраться, а вот 1ый совсем не понимаю(новичок)
var serviceCollection = new ServiceCollection();
serviceCollection.AddAudioBypass();
var api = new VkApi(serviceCollection);
api.Authorize(new ApiAuthParams {
Login = Environment.GetEnvironmentVariable("LOGIN"),
Password = Environment.GetEnvironmentVariable("PASSWORD")
});
Log($"Auth success, userId is {api.UserId}");
В этом коде на строчке var api = new VkApi(serviceCollection);
бросает System.TypeLoadException
:
System.TypeLoadException: Не удалось загрузить тип "VkNet.Abstractions.IVkApiVersionManager" из сборки "VkNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null".
в System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
в System.Signature..ctor(IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
в System.Reflection.RuntimeConstructorInfo.get_Signature()
в System.Reflection.RuntimeConstructorInfo.GetParametersNoCopy()
в System.Reflection.RuntimeConstructorInfo.GetParameters()
в Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(Type serviceType, Type implementationType, CallSiteChain callSiteChain)
в Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain)
в Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, CallSiteChain callSiteChain)
в Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain)
в Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.CreateServiceAccessor(Type serviceType)
в System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
в Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
в Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
в Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
в Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
в Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
в VkNet.VkApi.Initialization(IServiceProvider serviceProvider)
в VkNet.VkApi..ctor(IServiceCollection serviceCollection)
в VkAudioTest.MainWindow.ButtonStart_OnClick(Object sender, RoutedEventArgs e) в C:\Users\saber-nyan\Documents\Workspace\Development\Workspaces\C#\VkAudioTest\MainWindow.xaml.cs:строка 25
В коммите vknet/vk@377ea2c файл VkNet/Abstractions/IVkApiVersionManager.cs
и несколько других были перемещены в VkNet/Abstractions/Core/IVkApiVersionManager.cs
Выбрасывает exception
, если требуется двухфакторная авторизация, но нет обработчика TwoFactorAuthorization
.
Ошибка появилась сама собой. Не знаю, это проблема на моей стороне, или VK опять что-то поменяли, из-за чего расширение сломалось. Объект VkApi даже не успевает создастся, сразу вылетает.
Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger`1[VkNet.Utils.RestClient]' while attempting to activate 'VkNet.AudioBypassService.Utils.RestClientWithUserAgent'.
В последней версии, которая выложена в Nuget, выдается ошибка:
System.InvalidOperationException: Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger`1[VkNet.Utils.RestClient]' while attempting to activate 'VkNet.AudioBypassService.Utils.RestClientWithUserAgent'.
Был похожий issue, который сейчас закрыт:
#33
По нему, кажется, были сделаны исправления, но в Nuget так и осталась старая версия.
Если я прав, и текущая версия в репозитории рабочая, то выложите, пожалуйста, новую версию в Nuget.
После выполнения строки из документации services.AddAudioBypass();
возникает ошибка в версиях 1.7.3. и 1.7.4:
System.TypeLoadException: Method 'AuthorizeAsync' in type 'VkNet.AudioBypassService.VkAndroidAuthorization' from assembly 'VkNet.AudioBypassService, Version=1.7.3.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at VkNet.AudioBypassService.Extensions.AudioBypassServiceCollection.AddAudioBypass(IServiceCollection services)
Newtonsoft.Json.JsonReaderException
HResult=0x80131500
Сообщение = Unexpected character encountered while parsing value: E. Path '', line 0, position 0.
Источник = Newtonsoft.Json
Трассировка стека:
в Newtonsoft.Json.JsonTextReader.ParseValue()
в Newtonsoft.Json.JsonTextReader.Read()
в Newtonsoft.Json.JsonWriter.WriteToken(JsonReader reader, Boolean writeChildren, Boolean writeDateConstructorAsDate, Boolean writeComments)
в Newtonsoft.Json.JsonWriter.WriteToken(JsonReader reader, Boolean writeChildren)
в VkNet.Utils.Utilities.PrettyPrintJson(String json)
в VkNet.AudioBypassService.Utils.RestClientWithUserAgent.<CallAsync>d__14.MoveNext() в C:\Users\bladee\source\VkNet.AudioBypass-r-1.4.0\VkNet.AudioBypassService\Utils\RestClientWithUserAgent.cs:строка 91
content = "ERROR"
Доброго времени суток.
Взял ваш пример консольного приложения и дописал туда такие строки кода:
var groupId = await GetGroupByName(_api, "pochtanovaya");
var messages = _api.Messages.GetHistory(new MessagesGetHistoryParams
{
GroupId = groupId,
Count = 200,
Offset = 0,
Reversed = true
});
Но он пишет исключение:
VkNet.Exception.CannotBlacklistYourselfException: Access denied
Получается обход больше не работает?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.