Issue with Spotify-url and --no-metadata #452 (#454)

* Applied a check on null result in case of no youtube search

* Allow fetch metadata from spotify upon searching spotify-url and no-metadata

* updated changes.md

* Updated CHANGES.md as per suggestion

* removed unnecessary bool hit

Co-Authored-By: Amit-L <amit.lawanghare@gmail.com>

* removed unnecessary bool hit, anti PEP 8

Co-Authored-By: Amit-L <amit.lawanghare@gmail.com>

* resolved conflicts

* Error shown no videos found

* Dont to show any manual option for no result
This commit is contained in:
Amit Lawanghare
2018-12-29 00:35:24 -08:00
committed by Ritiek Malhotra
parent 51b01fc448
commit 1cf421960c
2 changed files with 10 additions and 1 deletions

View File

@@ -50,8 +50,10 @@ def match_video_and_metadata(track, force_pafy=True):
if not const.args.no_metadata:
meta_tags = spotify_tools.generate_metadata(track)
else:
if not const.args.no_metadata:
# Let it generate metadata, youtube doesn't know spotify slang
if not const.args.no_metadata or internals.is_spotify(track):
meta_tags = spotify_tools.generate_metadata(track)
if force_pafy:
content = go_pafy(track, meta_tags)
else:
@@ -172,6 +174,10 @@ class GenerateYouTubeURL:
)
def _best_match(self, videos):
if not videos:
log.error("No videos found on YouTube for a given search")
return None
""" Select the best matching video from a list of videos. """
if const.args.manual:
log.info(self.raw_song)