From db7de2c6448b8040717b8ec4bd72e15ce2971f15 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 12 Mar 2018 09:25:04 -0600 Subject: [PATCH] Allow searches in VK with spaces --- src/extractors/vk.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/extractors/vk.py b/src/extractors/vk.py index 9c99da1..dedb3a0 100644 --- a/src/extractors/vk.py +++ b/src/extractors/vk.py @@ -1,6 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals # at top of module import requests +try: + import urllib.parse as urlparse +except ImportError: + import urllib as urlparse from .import baseFile from update.utils import seconds_to_string @@ -15,7 +19,8 @@ class interface(object): def search(self, text, page=1): self.results = [] - search_results = requests.get("{0}/search?q={1}&page={2}".format(api_endpoint, text, page)) + url = "{0}/search?q={1}".format(api_endpoint, text) + search_results = requests.get(url) search_results = search_results.json()["data"] for i in search_results: s = baseFile.song(self)