Apparently it was just some wierd apostrophe in a unicode format

This commit is contained in:
Kepoor Hampond 2017-06-10 18:28:26 -07:00
parent 573bc7c656
commit f01fd21ef9
2 changed files with 9 additions and 6 deletions

View file

@ -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"

View file

@ -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)