vkwave icon indicating copy to clipboard operation
vkwave copied to clipboard

Implement VK audio methods

Open prostomarkeloff opened this issue 4 years ago • 3 comments

prostomarkeloff avatar May 14 '20 20:05 prostomarkeloff

https://github.com/fscdev/vkwave/blob/master/vkwave/api/methods/audio.py work here

prostomarkeloff avatar Jul 29 '20 16:07 prostomarkeloff

I reverse engineered VK mobile application and found that methods, but you need to get access token via direct authorization client_id and client_secret you can find here

catalog.getVideoSearch
    ref = [str] (optional)
    q = [str]
    start_from = [str]
    count = [int]
    adult = [str] // "0" or "1"
    hd = [str] // "0" or "1"
    sort = [str] // by date - 0, by duration - 1, by relevance - 2
    func_v = 2
    shorter = [int] (optional) // shorter than N seconds
    longer = [int] (optional) // longer than N seconds
    date = [int] (optional) // upload date < N seconds ago
    need_blocks = 1

catalog.reorderBlockItems
    block_id = [str]
    replacement_ids = [str]

catalog.consumeBanner
    id = [str]
    reason = [str]
    ref = [str]

catalog.getBlockItems
    block_id = [str]
    start_from = [str] (optional)
    count = [int] (optional)
    purchase_for = [int] (optional)

catalog.getGroupsSearch
    q = [str]
    start_from = [str]
    count = [int]
    need_blocks = 1

catalog.getSection
    section_id = [str]
    start_from = [str] (optional)
    force_refresh = [bool] (optional)
    purchase_for = [int] (optional)
    count = [int] (optional)

catalog.replaceBlocks
    replacement_ids = [str] (max_len(list) = 62)

catalog.replaceSections
    replacement_id = [str]

catalog.getGroups
    owner_id = [int]
    ref = [str]
    need_blocks = 1
    url = [str]

catalog.getFriends
    owner_id = [int] (optional)
    need_blocks = [int] // 0 or 1
    ref = [str] (optional)

catalog.getSection
    section_id = [str]
    force_refresh = [bool] (optional)
    start_from = [str] (optional)
    count = 20 // if start_from is null

catalog.getAudio
    need_params = 1
    owner_id = [int] (optional)
    url = [str]
    ref = [str]

catalog.getAudioArtist
    need_blocks = [int] // 0 or 1
    artist_id = [str]
    url = [str]

catalog.getAudioCurator
    need_blocks = [int] // 0 or 1
    curator_id = [str]
    url = [str] (optional)
    ref = [str] (optional)

catalog.getAudioPlayer
    need_blocks = [int] // 0 or 1
    artist_id = [str] 

catalog.getAudioSearch
    need_blocks = 1
    query = [str]
    context = [str]

catalog.getAudioClips
    need_blocks = [int] // 0 or 1
    owner_id = [int] (optional)

catalog.getAudioClipsSearch
    ref = [str] (optional)
    query = [str] 
    start_from = [str]
    need_blocks = 1

catalog.getAudioStory
    need_blocks = [int] // 0 or 1
    owner_id = [int] (optional)

catalog.getAudioStorySearch
    ref = [str] (optional)
    query = [str] 
    start_from = [str]
    need_blocks = 1

catalog.getPodcasts
    need_blocks = 1
    ref = [str]
    category_id = [str] (optional)
    owner_id = [int] (optional)

catalog.getPodcastsSearch
    need_blocks = true
    query = [str]
    context = [str]

catalog.getDebug
    need_blocks = 1

catalog.getMarket
    need_blocks = 1
    query = [str] (optional)
    section_id = [str] (optional)
    category_id = [int] (optional)

catalog.getMarketUserProducts
    need_blocks = 1

catalog.getShopping

catalog.getStickers
    need_blocks = [int] // 0 or 1
    url = [str] (optional)
    owner_id = [int] (optional)
    purchase_for = [int] (optional)
    ref = [str] (optional)

catalog.getShortVideoTop
    need_blocks = [int] // 0 or 1
    owner_id = [int] (optional)

InspectorDue avatar Feb 23 '21 14:02 InspectorDue

у всего есть lang, https, device_id, но кому это надо? вероятно у всего есть extended с fields, где видел - написал

audio.getById
        audios: str  -- ownerId_audio_id, чекнуть мб массив можно пихнуть 

audio.get             
        offset: int 
        owner_id: int 
        count: int 
        shuffle_seed: int
        shuffle: bool   
        extended: bool     
        fields: str -- вероятно есть, потомушо extended

audio.getPlaylists
        offset: int 
        owner_id: int 
        count: int 
        extended: bool     
        fields: str
        
audio.getHeadphoneMessages - каво, на такую срань апи call? респонс сами гляньте

audio.getCatalog;
        ref: str  -- видел пока recommendations, че-то еще искать - надо тыкаться
        start_from: str -- возвращается в респонсе, потом можно сюда подсунуть, зачем - не тестил
        count: int
        offset: - не тестил, должен быть
        extended: bool
        fileds: str

А теперь на сладенькое, с каких-то пор у вк появился новый тип ссылок для аудио (owner_id < 0), для них не получится склеить direct mp3 link, чекайте issue https://github.com/python273/vk_api/issues/298

Я выкачивал в tmpfs, расшифровывал и клеил ffmpeg ом, как вероятно сейчас и вк делает на мобилках (ffmpeg я там точно видел)

Saoqq avatar Aug 26 '21 23:08 Saoqq

I reverse engineered VK mobile application and found that methods, but you need to get access token via direct authorization client_id and client_secret you can find here

catalog.getVideoSearch
    ref = [str] (optional)
    q = [str]
    start_from = [str]
    count = [int]
    adult = [str] // "0" or "1"
    hd = [str] // "0" or "1"
    sort = [str] // by date - 0, by duration - 1, by relevance - 2
    func_v = 2
    shorter = [int] (optional) // shorter than N seconds
    longer = [int] (optional) // longer than N seconds
    date = [int] (optional) // upload date < N seconds ago
    need_blocks = 1

catalog.reorderBlockItems
    block_id = [str]
    replacement_ids = [str]

catalog.consumeBanner
    id = [str]
    reason = [str]
    ref = [str]

catalog.getBlockItems
    block_id = [str]
    start_from = [str] (optional)
    count = [int] (optional)
    purchase_for = [int] (optional)

catalog.getGroupsSearch
    q = [str]
    start_from = [str]
    count = [int]
    need_blocks = 1

catalog.getSection
    section_id = [str]
    start_from = [str] (optional)
    force_refresh = [bool] (optional)
    purchase_for = [int] (optional)
    count = [int] (optional)

catalog.replaceBlocks
    replacement_ids = [str] (max_len(list) = 62)

catalog.replaceSections
    replacement_id = [str]

catalog.getGroups
    owner_id = [int]
    ref = [str]
    need_blocks = 1
    url = [str]

catalog.getFriends
    owner_id = [int] (optional)
    need_blocks = [int] // 0 or 1
    ref = [str] (optional)

catalog.getSection
    section_id = [str]
    force_refresh = [bool] (optional)
    start_from = [str] (optional)
    count = 20 // if start_from is null

catalog.getAudio
    need_params = 1
    owner_id = [int] (optional)
    url = [str]
    ref = [str]

catalog.getAudioArtist
    need_blocks = [int] // 0 or 1
    artist_id = [str]
    url = [str]

catalog.getAudioCurator
    need_blocks = [int] // 0 or 1
    curator_id = [str]
    url = [str] (optional)
    ref = [str] (optional)

catalog.getAudioPlayer
    need_blocks = [int] // 0 or 1
    artist_id = [str] 

catalog.getAudioSearch
    need_blocks = 1
    query = [str]
    context = [str]

catalog.getAudioClips
    need_blocks = [int] // 0 or 1
    owner_id = [int] (optional)

catalog.getAudioClipsSearch
    ref = [str] (optional)
    query = [str] 
    start_from = [str]
    need_blocks = 1

catalog.getAudioStory
    need_blocks = [int] // 0 or 1
    owner_id = [int] (optional)

catalog.getAudioStorySearch
    ref = [str] (optional)
    query = [str] 
    start_from = [str]
    need_blocks = 1

catalog.getPodcasts
    need_blocks = 1
    ref = [str]
    category_id = [str] (optional)
    owner_id = [int] (optional)

catalog.getPodcastsSearch
    need_blocks = true
    query = [str]
    context = [str]

catalog.getDebug
    need_blocks = 1

catalog.getMarket
    need_blocks = 1
    query = [str] (optional)
    section_id = [str] (optional)
    category_id = [int] (optional)

catalog.getMarketUserProducts
    need_blocks = 1

catalog.getShopping

catalog.getStickers
    need_blocks = [int] // 0 or 1
    url = [str] (optional)
    owner_id = [int] (optional)
    purchase_for = [int] (optional)
    ref = [str] (optional)

catalog.getShortVideoTop
    need_blocks = [int] // 0 or 1
    owner_id = [int] (optional)

In this scheme, unfortunately not available schemas of responses methods. Please, if you have these information, reopen this issues with adding information

ZeN220 avatar Nov 01 '22 21:11 ZeN220

у всего есть lang, https, device_id, но кому это надо? вероятно у всего есть extended с fields, где видел - написал

audio.getById
        audios: str  -- ownerId_audio_id, чекнуть мб массив можно пихнуть 

audio.get             
        offset: int 
        owner_id: int 
        count: int 
        shuffle_seed: int
        shuffle: bool   
        extended: bool     
        fields: str -- вероятно есть, потомушо extended

audio.getPlaylists
        offset: int 
        owner_id: int 
        count: int 
        extended: bool     
        fields: str
        
audio.getHeadphoneMessages - каво, на такую срань апи call? респонс сами гляньте

audio.getCatalog;
        ref: str  -- видел пока recommendations, че-то еще искать - надо тыкаться
        start_from: str -- возвращается в респонсе, потом можно сюда подсунуть, зачем - не тестил
        count: int
        offset: - не тестил, должен быть
        extended: bool
        fileds: str

А теперь на сладенькое, с каких-то пор у вк появился новый тип ссылок для аудио (owner_id < 0), для них не получится склеить direct mp3 link, чекайте issue python273/vk_api#298

Я выкачивал в tmpfs, расшифровывал и клеил ffmpeg ом, как вероятно сейчас и вк делает на мобилках (ffmpeg я там точно видел)

в этой схеме отсутствуют структуры ответов этих методов, поэтому на основе этой информации их не получиться интегрировать в фреймворк. если у вас есть более подробная схема, откройте это ишью и приложите дополнительную информацию

ZeN220 avatar Nov 01 '22 21:11 ZeN220