From cbdc6daa7a8eb4c64a5373e352cb01a2b88c4380 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Fri, 22 Jun 2018 08:26:32 -0500 Subject: [PATCH] Removed VK temporarily --- src/extractors/__init__.py | 2 +- src/extractors/vk.py | 44 -------------------------------------- 2 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 src/extractors/vk.py diff --git a/src/extractors/__init__.py b/src/extractors/__init__.py index 0bc898b..45ed0ed 100644 --- a/src/extractors/__init__.py +++ b/src/extractors/__init__.py @@ -1,3 +1,3 @@ #!/usr/bin/env python # -*- coding: UTF-8 -*- -from . import mailru, vk, youtube, zaycev \ No newline at end of file +from . import mailru, youtube, zaycev \ No newline at end of file diff --git a/src/extractors/vk.py b/src/extractors/vk.py deleted file mode 100644 index 9208fe1..0000000 --- a/src/extractors/vk.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -""" this package Uses Alashow's Datmusic API, read more at https://github.com/alashow/datmusic-api""" -import requests -import logging -try: - import urllib.parse as urlparse -except ImportError: - import urllib as urlparse -from .import baseFile -from update.utils import seconds_to_string - -api_endpoint = "http://datmusicapiendpoint.com" -log = logging.getLogger("extractors.vk.com") - -class interface(object): - name = "vk" - - def __init__(self): - self.results = [] - self.needs_transcode = False - log.debug("started extraction service for {0}".format(self.name,)) - - def search(self, text, page=1): - self.results = [] - url = "{0}/search?q={1}".format(api_endpoint, text) - log.debug("Retrieving data from {0}...".format(url,)) - search_results = requests.get(url) - search_results = search_results.json()["data"] - for i in search_results: - s = baseFile.song(self) - s.title = i["title"] - s.artist = i["artist"] - # URRL is not needed here as download_url is already provided. So let's skip that part. - s.duration = seconds_to_string(i["duration"]) - s.download_url = i["stream"] - self.results.append(s) - log.debug("{0} results found.".format(len(self.results))) - - def get_download_url(self, url): - log.debug("This function has been called but does not apply to this module.") - return None - - def format_track(self, item): - return "{0}. {1}".format(item.artist, item.title) \ No newline at end of file