Skip to content

Commit b8880b8

Browse files
committed
Fix
1 parent 6df123d commit b8880b8

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

vk_api/audio.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import re
44
from .exceptions import AccessDenied
55

6+
RE_AUDIO = re.compile(r'audio\d+_\d+_audios\d+')
7+
68

79
class VkAudio:
810
def __init__(self, vk):
@@ -54,12 +56,12 @@ def search_user(self, owner_id, q=''):
5456
owner_id
5557
)
5658
)
57-
58-
if re.search(r'audio\d+_\d+_audios\d+', response.text):
59-
return [data for data in scrap_data(response.text) if not re.search(r'audio\d+_\d+_search\d+', data['id'])]
6059

61-
return []
62-
60+
return [
61+
i for i in scrap_data(response.text)
62+
if RE_AUDIO.search(i['id'])
63+
]
64+
6365
def search(self, q='', offset=0):
6466
""" Поиск аудиозаписей
6567

0 commit comments

Comments
 (0)