remove vk audio

This commit is contained in:
bakatrouble 2020-05-06 18:54:19 +03:00
parent 34851d219d
commit ccd7368acf
2 changed files with 6 additions and 4 deletions

View File

@ -45,10 +45,10 @@ class VKFeedModuleConfig(FeedModuleConfig):
bot.send_photo(chat_id, photos[0])
elif len(photos) > 1:
bot.send_media_group(chat_id, [InputMediaPhoto(photo) for photo in photos])
for a in post['attachments']:
if 'audio' in a:
f = get_vk_audio(vk_audio.get_audio_by_id(a['audio']['owner_id'], a['audio']['id']))
bot.send_audio(chat_id, f, None, a['audio'].get('artist'), a['audio'].get('title'))
# for a in post['attachments']:
# if 'audio' in a:
# f = get_vk_audio(vk_audio.get_audio_by_id(a['audio']['owner_id'], a['audio']['id']))
# bot.send_audio(chat_id, f, None, a['audio'].get('artist'), a['audio'].get('title'))
if self.send_links:
bot.send_message(chat_id, f"https://vk.com/wall{post['owner_id']}_{post['id']}",
disable_web_page_preview=True)

View File

@ -27,6 +27,8 @@ class VKMusicFeedModuleConfig(FeedModuleConfig):
if last_id is None:
last_id = 0
raise StopIteration()
vk_session = VkApi(login=config.vk_username, password=config.vk_password, config=DatabaseConfig,
api_version='5.60', captcha_handler=captcha_handler)
if config.russian_proxy_string: