mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
De-clutter metadata search
This commit is contained in:
@@ -108,10 +108,6 @@ class YouTubeSearch:
|
||||
logger.debug('Fetching YouTube results for "{}".'.format(search_url))
|
||||
html = self._fetch_response_html(search_url)
|
||||
videos = self._fetch_search_results(html)
|
||||
# print(html)
|
||||
# print("")
|
||||
# print(videos)
|
||||
# exit()
|
||||
return YouTubeVideos(videos)
|
||||
|
||||
|
||||
@@ -198,7 +194,7 @@ class YouTubeStreams(StreamsBase):
|
||||
|
||||
class ProviderYouTube(ProviderBase):
|
||||
def from_query(self, query):
|
||||
watch_urls = YouTubeSearch().search(query)
|
||||
watch_urls = self.search(query)
|
||||
if not watch_urls:
|
||||
raise YouTubeMetadataNotFoundError(
|
||||
'YouTube returned nothing for the given search '
|
||||
@@ -214,6 +210,9 @@ class ProviderYouTube(ProviderBase):
|
||||
def from_pytube_object(self, content):
|
||||
return self.metadata_to_standard_form(content)
|
||||
|
||||
def search(self, query):
|
||||
return YouTubeSearch().search(query)
|
||||
|
||||
def _fetch_publish_date(self, content):
|
||||
# FIXME: This needs to be supported in PyTube itself
|
||||
# See https://github.com/nficano/pytube/issues/595
|
||||
|
||||
Reference in New Issue
Block a user