Skip to content

Commit e433a32

Browse files
committed
some more fixes to howdy.music.music, and remove LXML warnings in howdy_tv_excludes. Changing requirements to use fabric without version restrictions.
1 parent 046ecbb commit e433a32

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

howdy/music/music.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def get_artist_direct_search_MBID_ALL( cls, artist_name ):
211211
def get_artist_datas_LL(
212212
cls, artist_name, min_score = 100,
213213
do_strict = True, artist_mbid = None, do_direct = False ):
214-
"""
214+
r"""
215215
:param str artist_name: the artist over which to search.
216216
:param int min_score: optional argument. Filter on this minimum score on artist name matches to ``artist_name``. 0 :math:`\le` ``min_score`` :math:`\le 100`. Default is ``100``.
217217
:param bool do_strict: optional argument. If ``True``, performs a strict search using the :py:meth:`musicbrainzngs search_artists <musicbrainz.search_artists>` method. Default is ``True``.
@@ -346,7 +346,10 @@ def get_album_info( cls, album ):
346346
"""
347347
time0 = time.perf_counter( )
348348
rgid = album['id']
349-
rgdate = album['first-release-date']
349+
#
350+
## guard code, if do NOT have a release date
351+
try: rgdate = album['first-release-date']
352+
except: rgdate = 1900
350353
rtitle = album['title']
351354
rgdate_date = None
352355
for fmt in ( '%Y-%m-%d', '%Y-%m', '%Y' ):
@@ -427,7 +430,7 @@ def __init__( self, artist_name, artist_mbid = None, do_direct = False ):
427430
len( self.alltrackdata ), artist_name, time.perf_counter( ) - time0 ) )
428431

429432
def get_music_metadatas_album( self, album_name, min_criterion_score = 95 ):
430-
"""
433+
r"""
431434
:param str album_name: a studio album released by this artist.
432435
:param int min_criterion_score: the minimum score to accept for a string similarity comparison between ``album_name`` and any studio album created by this artist. ``70`` :math:`\le` ``min_criterion_score`` :math:`\le` ``100``, and the default is ``95``. The :py:meth:`get_maximum_matchval <howdy.core.get_maximum_matchval>` performs the string comparison. If no album matches ``album_name``, then return album data for the album whose name is closest (while having a similarity score :math:`\ge` ``min_criterion_score``) to ``album_name`` is returned.
433436
:returns: a two-element :py:class:`tuple`, whose first element is a :py:class:`list` of summary information on tracks for this album, and whose second element is the string ``"SUCCESS"``. The elements in this list are ordered by first song track to last song track. An example first song for the `Moon Safari`_ album released by Air_ is,
@@ -496,7 +499,7 @@ def get_album_image( self, album_name ):
496499
return filename, 'SUCCESS'
497500

498501
def get_music_metadata( self, song_name, min_criterion_score = 85 ):
499-
"""
502+
r"""
500503
:param str song_name: name of the song.
501504
:param int min_criterion_score: the minimum score to accept for a string similarity comparison between ``song_name`` and any track created by this artist. ``70`` :math:`\le` ``min_criterion_score`` :math:`\le` ``100``, and the default is ``85``. The :py:meth:`get_maximum_matchval <howdy.core.get_maximum_matchval>` performs the string comparison. If no track matches ``song_name``, then track data for a track that is the closest match (while having a similarity score :math:`\ge` ``min_criterion_score``) to ``song_name`` is returned.
502505
:returns: if successful, a two element :py:class:`tuple`. First element is a :py:class:`dict` of information on the song, and the second element is the string ``"SUCCESS"``. For example, for the Air_ song `Kelly Watch the Stars`_ in `Moon Safari`_, the closest match is ``Kelly, Watch the Stars!``.
@@ -941,7 +944,7 @@ def get_youtube_file( youtube_URL, outputfile, use_aria2c = True ):
941944
os.remove( tmpfile )
942945

943946
def youtube_search(youtube, query, max_results = 10):
944-
"""
947+
r"""
945948
Performs a string query to search through YouTube_ clips, and returns list of valid YouTube_ URLs.
946949
947950
:param Resource youtube: a `googleapiclient Resource`_ object that allows for the access to the `YouTube Google API`_.

howdy/tv/cli/howdy_tv_excludes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
from howdy import signal_handler
33
signal.signal( signal.SIGINT, signal_handler )
44
#
5+
import warnings
6+
from bs4.builder import XMLParsedAsHTMLWarning
57
from howdy.tv import tv
68
from howdy.core import core, return_error_raw
79
from itertools import chain
810
from argparse import ArgumentParser
11+
#
12+
## suppress these XML warnings
13+
warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)
914

1015
def try_continue( ):
1116
val = str(input( 'PERFORM OPERATION (must choose one) [y/n]:')).lower( )

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiclient
22
beautifulsoup4
33
cfscrape
4-
fabric<3.0.0
4+
fabric
55
ffmpeg_normalize
66
gdata
77
geoip2

0 commit comments

Comments
 (0)