Google poster downloader: tweak search URI to subjectively improve results
authorPhilipp Zabel <philipp.zabel@gmail.com>
Fri, 20 Nov 2009 13:11:13 +0000 (14:11 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 23 Nov 2009 12:19:51 +0000 (13:19 +0100)
There are still a lot of false positives and sometimes just plain wrong
results where Google Search returns a lot of correct posters, only the
first one (which we take) is wrong.

src/poster/google-poster-downloader.vala

index 29f52ad..129fb98 100644 (file)
@@ -26,7 +26,7 @@ public class GoogleImageSearch : Soup.Message {
 
        public GoogleImageSearch (string search, bool _thumbnail = false) {
                Object (method: "GET");
-               uri = new URI ("http://images.google.com/images?imgsz=m&q=" + Uri.escape_string (search, "+", false));
+               uri = new URI ("http://images.google.com/images?imgsz=m&imgar=t&q=" + Uri.escape_string (search, "+", false));
                thumbnail = _thumbnail;
                got_chunk.connect (this.on_got_chunk);
        }
@@ -74,7 +74,7 @@ public class GooglePosterDownload : Object {
        private bool cancelled = false;
 
        public GooglePosterDownload (string title, string year, bool thumbnail, int _handle, GooglePosterDownloader _downloader) {
-               var search = title + " movie poster " + year;
+               var search = title + "+" + year + "+movie+poster";
 
                handle = _handle;
                downloader = _downloader;