Skip to content

Commit

Permalink
Fixed pylint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
remi1111 committed Mar 30, 2024
1 parent 635217e commit 3145f24
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ def main():
""" Main function. """
load_dotenv() # Load .env file
try:
opts, args = getopt.getopt(sys.argv[1:], "hFLDv", ["help","to-file","to-list", "--to-dict", "--verbose"])
opts, args = getopt.getopt(sys.argv[1:],
"hFLDv",
["help","to-file","to-list", "--to-dict", "--verbose"])
except getopt.GetoptError as err:
# print help information and exit:
print(err, file=sys.stderr) # will print something like "option -a not recognized"
Expand Down
30 changes: 16 additions & 14 deletions src/get_avs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,27 @@ def get_dict_spotify(mydict, verbose=False):
print(f"Artists: {count_artists}")

for artist in set_artists:
# artist =
songlist = analyze.get_clean_songlist_artist(mydict, artist)
spotify_dict = analyze.get_dict_artist(mydict, artist)
songlist = analyze.get_clean_songlist_artist(mydict, artist)
spotify_dict = analyze.get_dict_artist(mydict, artist)

artistchannel = artist + " - Topic"
channelid = yt_api.search_channel(artistchannel, verbose)
# channelid =
artistchannel = artist + " - Topic"
channelid = yt_api.search_channel(artistchannel, verbose)

yt_data = analyze.get_videoid_dict_per_artist(channelid, songlist, spotify_dict, artist, verbose)
yt_data = analyze.get_videoid_dict_per_artist(channelid,
songlist,
spotify_dict,
artist,
verbose)

not_found_list = analyze.songs_not_found(songlist, yt_data)
not_found_list = analyze.songs_not_found(songlist, yt_data)

count = len(songlist)
found = len(songlist) - len(not_found_list)
count = len(songlist)
found = len(songlist) - len(not_found_list)


if verbose:
print(f"Artist: {artist}")
print("count = " + str(count) + ", found = " + str(found))
print("not found:", not_found_list)
if verbose:
print(f"Artist: {artist}")
print("count = " + str(count) + ", found = " + str(found))
print("not found:", not_found_list)

return yt_data
3 changes: 3 additions & 0 deletions src/yt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def take_topic(json_data, verbose=False):
print(channel_name)
if "Topic" in channel_name:
return item['id']['channelId']
print("Could not find topic channel", file=sys.stderr)
sys.exit(10)


def search_channel(channel_name, verbose=False):
""" Returns the channel ID of the first result. """
Expand Down

0 comments on commit 3145f24

Please sign in to comment.