diff --git a/GUI.py b/GUI.py index b177c64..4baf408 100755 --- a/GUI.py +++ b/GUI.py @@ -44,6 +44,7 @@ def search(self): """ This function initiates a new search based on the text entered in the search bar. """ + self.b1=Button(self, text='Search', command=self.search) search_string = self.search_var.get() print(search_string) self.populate_Similar_Songs(search_string) diff --git a/crawler.py b/crawler.py index 90a50b8..fd2ad75 100644 --- a/crawler.py +++ b/crawler.py @@ -38,11 +38,11 @@ def init(base_url): Example Dictionary: -{'Link': '/watch?v=ZynacUXphI4', +{'Link': 'https://watch?v=ZynacUXphI4', 'UploadDate': '3 months ago', 'Title': 'halsey - bad at love (lyrics)', 'Verified': False, -'Duration': '3:10', +'Duration': '00:03:10', 'Channel': 'hopeless', 'View': '202,583'} ''' @@ -156,7 +156,7 @@ def getMetaData(soup, noOfRecords): #To remove advertisement tags if len(video.contents) > 1: - s = video.contents[1].span + s = video.contents[0].span if(s != None): if(s.has_attr('aria-label')): continue @@ -178,8 +178,8 @@ def getMetaData(soup, noOfRecords): #String manipulation for time format time = durationData.contents[0] - time = time.split(' ')[-1] - time = time.split('.')[0] + time = time.split(' ')[0] + time = time.split(' ')[0] d['Duration'] = time #Second child of yt-lockup-content division diff --git a/song_finder.py b/song_finder.py index a3040ad..267d549 100755 --- a/song_finder.py +++ b/song_finder.py @@ -11,7 +11,7 @@ def getArtists(cursor, search): #print(row[0]) artists.append(row[0]) - return artists + return artists; def compareArtists(artists, search): for artist in artists: