chevron_left chevron_right
Login Register invert_colors photo_library

Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average

GiyPy - Dynamic Google Searcher filter_list
GiyPy - Dynamic Google Searcher #1
GiyPy is a dynamic Google searcher, it searches for YouTube videos, Images, and Google results from Google itself.

This is actually REALLY long, and I've explained all of these functions on other threads before. The only unexplained function is the google searcher, which will be explained in another thread, and hopefully by @TryhardHusky. >.>

import urllib,urllib.parse,urllib.request,json,random,re

class google():
    def search(query):
            x = random.randint(0,2)
            xdat = json.loads(urllib.request.urlopen(""+(urllib.parse.quote(query))).read().decode("utf-8"))
            return "\n%s\n%s" % (((xdat["responseData"]["results"][0])["title"]), (urllib.parse.unquote((xdat["responseData"]["results"][0])["url"])))
        except: return "Error"
    def youtube(query):
            xdat = str((urllib.request.urlopen(""+query.replace(' ','_')+"&racy=include&orderby=relevance&max-results=1")).read())
            if "<openSearch:totalResults>0</openSearch:totalResults>" in (xdat): return "No results."
                trash , yclean=(xdat).split("<media:player url='",1)
                yclean , trash=yclean.split("&amp;",1)
                trash2 , yclean2=(xdat).split("<media:title type='plain'>",1)
                yclean2 , trash2=yclean2.split("</media:title>",1)
                trash3 , yclean3=(xdat).split(yclean+"'/><author><name>",1)
                yclean3 , trash3=yclean3.split("</name>",1)
                return yclean2.capitalize()+"\nUploaded by "+yclean3.capitalize()+"\n"+yclean
        except: return "Error"
    def images(query):
            mx = []
            for m in (re.finditer('"unescapedUrl":"(.+?)","url":"', ((urllib.request.urlopen(""+("+".join(query)))).read().decode()))):
                m = str(
            return random.choice(mx)
        except: return "Error"

- YouTube:
- Google Images:
- Google Search:

@TryhardHusky - Programming
@Duubz - Programming

Additionally, if you would like to have a program that uses these functions, you can view my GitHub repository at


Users browsing this thread: 1 Guest(s)