From 07a2ae8b3cd2f3fd0373ccb75ef48be1c84fab22 Mon Sep 17 00:00:00 2001 From: Rohan Mayya Date: Sat, 16 Sep 2017 09:54:09 +0000 Subject: [PATCH 1/7] lbox padding fix --- GUI.py | 2 +- crawler.pyc | Bin 4276 -> 4254 bytes main.pyc | Bin 1898 -> 1883 bytes 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/GUI.py b/GUI.py index b177c64..b155510 100755 --- a/GUI.py +++ b/GUI.py @@ -84,7 +84,7 @@ def widgets(self): self.lbox.bind("", self.onDouble) self.lbox2 = Listbox(self, width=45, height=15) - self.lbox2.grid(row=2, column=1, columnspan=6,sticky=W, padx=2000, pady=10) + self.lbox2.grid(row=2, column=1, columnspan=6,sticky=W, padx=20, pady=10) """ diff --git a/crawler.pyc b/crawler.pyc index ef88d48d466f4dac34499d68707aed8b57c0bb92..b50f833111afe786bf37c7a9a6b3267dc53547fb 100644 GIT binary patch delta 375 zcmdm@I8Tv{`7dP*xWlrS;WFflYUGNdpuWHT`oC4smpj0}>KOL!e) zI~Yn>8ERP=3Ohh3yoQCLgc+=?6r?PRk)eheq?fURXtj>)h2C4nTXKr%kBwhQP20O7!8 AlmGw# delta 416 zcmbQIxJ8kT`7OmN8}$ucx>SLkSZ@4HH8%BSQ)kLpBpbQ5=XnIfd6T zvW209m7$h}p|Ayn!fRLmSE!eT(o!zjWe#K_Dj R#K Date: Sat, 16 Sep 2017 10:05:30 +0000 Subject: [PATCH 2/7] last letter of artist --- song_finder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/song_finder.py b/song_finder.py index a3040ad..269079b 100755 --- a/song_finder.py +++ b/song_finder.py @@ -21,7 +21,7 @@ def compareArtists(artists, search): def searchStringLogic(cursor, search_string): words = search_string.split(' ') for i in range(len(words) - 1): - artist = '-'.join(words[0:i]) + artist = '-'.join(words[0:i+1]) song = '-'.join(words[i+1:]) print('Artist', artist) print('Song', song) From d0b47361bac711cbbe59dc3ca3bfea63b5195e96 Mon Sep 17 00:00:00 2001 From: Rohan Mayya Date: Sat, 16 Sep 2017 10:31:18 +0000 Subject: [PATCH 3/7] -1 view count fixed --- crawler.py | 2 +- downloader.py | 2 +- song_finder.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crawler.py b/crawler.py index 90a50b8..f00fcee 100644 --- a/crawler.py +++ b/crawler.py @@ -214,7 +214,7 @@ def toNumber(string): try: return int(number) except: - return -1 + return 0 #Function that filters out the most relevant Youtube video def getMostRelevant(metaData, searchWord): diff --git a/downloader.py b/downloader.py index e349c38..775acba 100644 --- a/downloader.py +++ b/downloader.py @@ -60,6 +60,6 @@ def download_video(url, filename): response = requests.get(url, headers=headers) print(response) - file = open(filename, 'wb') + file = open(filename, 'mp4') file.write(response.content) file.close() diff --git a/song_finder.py b/song_finder.py index 269079b..f83985d 100755 --- a/song_finder.py +++ b/song_finder.py @@ -32,7 +32,7 @@ def searchStringLogic(cursor, search_string): print(artist_result) return (artist_result, song) - return (None, None) + return (song, artist_result) # test required def getAllSongs(cursor, artist, song): songs = [] From b498646768f57ef9f2dbcd639b09d1b1ce0d847e Mon Sep 17 00:00:00 2001 From: Rohan Mayya Date: Sat, 16 Sep 2017 10:34:26 +0000 Subject: [PATCH 4/7] Issue 7 crawler.py 191 --- crawler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/crawler.py b/crawler.py index f00fcee..9825a05 100644 --- a/crawler.py +++ b/crawler.py @@ -188,6 +188,7 @@ def getMetaData(soup, noOfRecords): if(s != None): if(s.has_attr('title')): if(s['title'] == 'Verified'): + d['Verified'] = True pass #Third child of yt-lockup-content division From dc0c3be04b207ea7246ecc1396d84cbb17af996a Mon Sep 17 00:00:00 2001 From: Rohan Mayya Date: Sat, 16 Sep 2017 10:53:27 +0000 Subject: [PATCH 5/7] search bar fixed --- GUI.py | 4 +++- crawler.pyc | Bin 4254 -> 4271 bytes 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/GUI.py b/GUI.py index b155510..56b10c6 100755 --- a/GUI.py +++ b/GUI.py @@ -63,6 +63,7 @@ def onDouble(self, event): value = widget.get(selection[0]) self.entry.delete(0, END) self.entry.insert(END, value) + self.search() #Function to setup the basic layout of the Graphical User Interface def widgets(self): @@ -74,7 +75,8 @@ def widgets(self): Label(self, text="Song Downloader System", background="#CC0001", font= ("Comic Sans MS",16)).grid(row=0, column=0, padx=20) self.search_var = StringVar() - self.entry = Entry(self, textvariable=self.search_var, width=45) + self.entry = Entry(self, textvariable=self.search_var, width=45) + self.entry.grid(row=1, column=0, sticky=W, padx=20, pady=10) self.b1=Button(self, text='Search', command=self.search) self.b1.grid(row=1, column=1, sticky=W, padx=20, pady=10) diff --git a/crawler.pyc b/crawler.pyc index b50f833111afe786bf37c7a9a6b3267dc53547fb..253456eda91beb9fc9ad00d953e2d5c8f6d8dfc9 100644 GIT binary patch delta 243 zcmbQIxL%Qs`7D0<9T!p%^_#sK8n6h3Awe8!l^z)-`=kj27~BE%q>#WVR7b3P;Q zW-FE^Rz|+bdpQf)Sr`}?LW)W^>u?D&GDb|c<924`n%uzc%^IWxl$m^mJBabZWOW`d zkUECRr97#OS2y40kz~?T0rG>SK!hTYC}9N>Ir-(OMPPkFRzR)>CrDOpvMj$cqvm8s Z{(8o{lMnJ2Gnz~`6-Z&t;bi6H007}MI8Fcn delta 227 zcmZ3lI8Tv{`7D7wj52t;=n^B5RvSQ)Zd7*d27B(u0DUt!K?~zoCI|7?Gv1keiNBc9c(R*7 L3TrkeD<=m4u3kH9 From 4a045ca2b3b71d6eb5853ff05babd478c472be90 Mon Sep 17 00:00:00 2001 From: Rohan Mayya Date: Sat, 16 Sep 2017 10:55:41 +0000 Subject: [PATCH 6/7] issue 12, youtube redirect --- downloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downloader.py b/downloader.py index 775acba..3e727be 100644 --- a/downloader.py +++ b/downloader.py @@ -9,7 +9,7 @@ def convert_youtubeURL_to_download_URL(youtube_URL): https://www.ssyoutube.com/XXX contains a link which allows music videos to be downloaded. youtube_URL: the URL of the music video to be downloaded """ - index = youtube_URL.find('https') + index = youtube_URL.find('youtube') file_retrieve_URL = youtube_URL[0:index] + 'ss' + youtube_URL[index:] redirect_response = requests.get(file_retrieve_URL) print(redirect_response.url) From cf3ba1678c0d1d81625f9057ba72c3d6fc2c7c16 Mon Sep 17 00:00:00 2001 From: Rohan Mayya Date: Sat, 16 Sep 2017 11:01:18 +0000 Subject: [PATCH 7/7] getAllSongs method correct, billboard --- song_finder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/song_finder.py b/song_finder.py index f83985d..4576b9f 100755 --- a/song_finder.py +++ b/song_finder.py @@ -36,7 +36,7 @@ def searchStringLogic(cursor, search_string): def getAllSongs(cursor, artist, song): songs = [] - query = "SELECT song, year FROM lyrics WHERE artist LIKE '%s' AND song NOT LIKE '%s';" %(song, artist) + query = "SELECT song, year FROM lyrics WHERE artist LIKE '%s' AND song NOT LIKE '%s';" %(artist, song) cursor.execute(query) rows=cursor.fetchall() for row in rows: