diff --git a/irs/ripper.py b/irs/ripper.py index 7603a41..1b3b3cb 100644 --- a/irs/ripper.py +++ b/irs/ripper.py @@ -1,3 +1,5 @@ +# _*_ coding:utf-8 _*_ + # System import sys import os @@ -141,8 +143,8 @@ class Ripper: raise ValueError("Must specify song_title/artist in `args` with \ init, or in method arguments.") - search_terms = str(song) + " " + str(artist - ) + " " + str(additional_search) + search_terms = song + " " + artist + " " + additional_search + query_string = urlencode({"search_query": ( search_terms.encode('utf-8'))}) link = "http://www.youtube.com/results?" + query_string @@ -376,7 +378,7 @@ init, or in method arguments.") video_url, video_title = self.find_yt_url(song, artist) - print(self.args["hook-text"].get("song").format(song, artist)) + print(self.args["hook-text"].get("song").decode().format(song, artist)) file_name = data["file_prefix"] + ObjManip.blank(song, False) + ".mp3" diff --git a/irs/utils.py b/irs/utils.py index f5a0c8a..fc8e56b 100644 --- a/irs/utils.py +++ b/irs/utils.py @@ -1,4 +1,5 @@ -# -*- coding: UTF-8 -*- +# _*_ coding:utf-8 _*_ + # ======= # Imports @@ -97,10 +98,10 @@ class ObjManip: # Object Manipulation def blank(string, downcase=True): import re regex = re.compile('[^a-zA-Z0-9\ ]') - string = regex.sub('', str(string)) + string = regex.sub('', string.encode("utf8")) if downcase: string = string.lower() - return ' '.join(string.split()) + return ' '.join(string.decode().split()) def blank_include(this, includes_this): this = ObjManip.blank(this)