Ejemplo n.º 1
0
 def link_verify(self, name, twiter, instag, facbok):
     user = instag.split("/")[3]
     insta = instagramSearchTool()
     insta.getInfo(user)
     if name == insta.name:
         if ():
             pass
         # return 1
     else:
         print("link.invalid: Instagram account is not your.")
Ejemplo n.º 2
0
def searchPersonne(codemonpays):

	nom = input(" Nom, Prénom: ")
	city = input(" Ville/Departement: ")
	print("\n"+wait+" Recherche...")

	try:

		headers = {
			'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
    	    'referrer': 'https://google.com',
        	'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
        	'Accept-Encoding': 'utf-8',
        	'Accept-Language': 'en-US,en;q=0.9',
        	'Pragma': 'no-cache'
        }

		if codemonpays == 'FR':
			# Page Jaune search
			url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPJ(requete)

		elif codemonpays == 'BE':
			# Page D'or search
			url = "https://www.pagesblanches.be/chercher/personne/{}/{}/"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPageDor(requete)

		elif codemonpays == 'CH':
			# Suisse search
			url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res"
			searchLocalCH(url.format(city, nom))

		elif codemonpays == 'LU':
			# Luxembourg search
			url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}"
			searchYellowLU(url.format(nom))

		else:
	        # Recherche FR
			url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPJ(requete)

			# Recherche BE
			url = "https://www.pagesblanches.be/chercher/personne/{}/{}/"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPageDor(requete)

			# Recherche CH
			url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res"
			searchLocalCH(url.format(city, nom))

			# Recherche LU
			url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}"
			searchYellowLU(url.format(nom))

# Copain d'avant search
		searchCopainsdavant(nom, city)

# LinkedIn search
		searchPersonneLinkedin(nom, city)

# Facebook search		
		fbtool = facebookSearchTool()
		accountsFb = fbtool.searchFacebook(nom)

		title = " Facebook "

		TABLE_DATA = [
			('Name', 'User', 'Location'),
		]

		count = 0

		for a in accountsFb:
			count += 1
			name = a[1]
			username = a[0]
			fbtool.getInfoProfile(username)
			loc = fbtool.address
			if not loc:
				loc = ""

			tuples = (name, username, loc)
			# listeInfos.append(tuples)
			TABLE_DATA.append(tuples)
		
		if count > 0:
			table_instance = SingleTable(TABLE_DATA, title)
			print(table_instance.table)
		
# Twitter Search		
		title = " Twitter "

		TABLE_DATA = [
			('Name', 'User', 'Date', 'Location'),
		]

		twitool = twitterSearchTool()
		accountTwitter = twitool.searchTwitter(nom)

		count = 0

		for a in accountTwitter:
			count += 1
			name = a[1]
			username = "******"+a[0]
			twitool.getInfoProfile(a[0])
			
			location = twitool.location
			date = twitool.birth
			bio = twitool.description
			url = twitool.url

			tuples = (name, username, date, location)
			TABLE_DATA.append(tuples)

		if count > 0:
			table_instance = SingleTable(TABLE_DATA, title)
			print(table_instance.table)
	# Instagram search

		title = " Instagram "

		instatls = instagramSearchTool()
		instatls.searchInsta(nom)

		accounts = instatls.accounts

		TABLE_DATA = [
			('Name', 'User'),
		]

		count = 0

		for account in accounts:
			url = "https://instagram.com/"+account
			i = instagramSearchTool()
			i.getInfo(url)
			name = i.name

			tuples = (name, account)
			TABLE_DATA.append(tuples)

			count +=1

		if count > 0:
			table = SingleTable(TABLE_DATA, title)
			print(table.table)

	except IOError:
		pass
Ejemplo n.º 3
0
def searchInstagram(self, instagram_info, user, text):
    global path
    instagram_info.destroy()

    # Progress bar widget
    progress = Progressbar(self,
                           orient=HORIZONTAL,
                           length=200,
                           mode='determinate')
    progress.place(x=600, y=200)
    # user = input(" Username: "******"https://instagram.com/" + user
    try:
        progress['value'] = 5
        self.update_idletasks()
        time.sleep(0.1)

        insta = instagramSearchTool()
        insta.getInfo(user)

        progress['value'] = 10
        self.update_idletasks()
        time.sleep(0.1)

        name = insta.name
        userId = insta.id
        images = insta.profi_pic_hd
        try:
            image = shortCutUrl(images)
            username = insta.username

            progress['value'] = 15
            self.update_idletasks()
            time.sleep(0.1)

            private = insta.private
            followers = insta.followers
            friend = insta.friends
            publication = insta.medias

            progress['value'] = 20
            self.update_idletasks()
            time.sleep(0.1)

            bio = insta.biography
            url = insta.url
            email = insta.email
            adresse = insta.adresse
            phone = insta.phone

            progress['value'] = 25
            self.update_idletasks()
            time.sleep(0.1)

            # Set up the image URL
            image_url = "{}".format(images)
            try:
                os.mkdir("{0}/{1}".format(os.getcwd(), user))
            except FileExistsError:
                pass
            image_filename = wget.download(image_url)
            os.system("mv {0} profile.png && mv profile.png {1}/".format(
                image_url.split('/')[-1].split('?')[0], user))
            load = Image.open("{0}/profile.png".format(user))
            render = ImageTk.PhotoImage(load)
            img = Label(self, image=render)
            img.image = render
            img.place(x=1030, y=10)
            img.bind("<Button-1>", lambda e: Url.Url.callback(image_url))

            progress['value'] = 30
            self.update_idletasks()
            time.sleep(0.1)

            text.insert(END, "\n[{}]\n".format(username))
            text.insert(END, " Name: {}\n".format(name))
            text.insert(END, " Pictures: {}\n".format(image))
            text.insert(END, " ID: {}\n".format(userId))
            text.insert(END, " Protected: {}\n".format(private))
            text.insert(
                END, " Subscribers: {}  |  Subscriptions: {}\n".format(
                    followers, friend))
            text.insert(END, " Publication: {}\n".format(publication))
            text.insert(END, " Bio: {}\n".format(bio))

            progress['value'] = 50
            self.update_idletasks()
            time.sleep(0.1)

            if url:
                text.insert(END, " Url: {}\n".format(url))
            if email:
                text.insert(END, " Email: {}\n".format(email))
            if phone:
                text.insert(END, " Phone: {}\n".format(phone))
            if adresse:
                text.insert(END, " Places: {}\n".format(adresse))

            if not private:

                while True:
                    choix = messagebox.askquestion(
                        "Download Image",
                        "Do you want to download the last 12 photos posted?")

                    if choix == "" or choix.upper() == "NO":

                        progress['value'] = 100
                        self.update_idletasks()
                        time.sleep(0.1)
                        progress.destroy()
                        break

                    elif choix.upper() == "YES":

                        progress['value'] = 70
                        self.update_idletasks()
                        time.sleep(0.1)

                        pat(progress, 70, insta, urlProfil, self, user)
                        break
            else:
                messagebox.showinfo(
                    "Private Account",
                    "We can't download images from {0}'s Profile.".format(
                        user))
                progress.destroy()
        except TypeError:
            progress.destroy()
            messagebox.showerror("NOT FOUND", user + " user not found")
    except requests.exceptions.ConnectionError:
        progress.destroy()
        messagebox.showerror("Connection Issue",
                             "Maybe Your Internet Is Too Slow.")
Ejemplo n.º 4
0
def profilerFunc(profile='', path=''):

    from datetime import date
    today = date.today()
    instagramID = None
    instagramBio = None
    instagramUsername = None
    instagramName = None
    instagramEmail = None
    instagramPhone = None
    instagramUrlFound = None
    instagramLocation = None
    InstagramUrlAccount = None
    today = None
    profileID = None
    profileName = None
    phones = None
    emails = None
    twitterLocation = None
    facebookLocation = None
    facebookWork = None
    facebookUsername = None
    twitterUsername = None
    facebookID = None
    facebookUrl = None
    twitterID = None
    twitterUrlAccount = None
    placeVisited = None
    twitterBio = None

    list_biographi = []
    list_placeVisited = []
    list_emails = []
    list_phones = []
    list_urls = []
    list_news = []

    if profile:
        profileName = profile['name']
        profileID = profile['id']
        file = profile['file']

        print("\n" + found + " Profile selected: %s (%s)\n" %
              (profileName, profileID))

        pr = Profiler()
        dataProfile = pr.readProfile(file, path=path)

        if dataProfile:
            for data in dataProfile:
                if data.upper() == 'URL':
                    try:
                        url_twitter = dataProfile[data]['Twitter']
                    except:
                        url_twitter = None

                    try:
                        url_instagram = dataProfile[data]['Instagram']
                    except:
                        url_instagram = None

                    try:
                        url_facebook = dataProfile[data]['Facebook']
                    except:
                        url_facebook = None

        name_txt = file.replace(".prfl", ".txt")
        path_txt = path + '\\' + name_txt

        if url_twitter:
            twitterInfoDic = {"Twitter": {}}
            twittool = twitterSearchTool()
            twittool.getInfoProfile(url_twitter)
            twitterID, twitterInfoDic['Twitter'][
                'id'] = twittool.id, twittool.id
            twitterName, twitterInfoDic['Twitter'][
                'name'] = twittool.name, twittool.name
            twitterUsername, twitterInfoDic['Twitter'][
                'username'] = twittool.username, twittool.username
            twitterLocation, twitterInfoDic['Twitter'][
                'location'] = twittool.location, twittool.location
            twitterUrlFound, twitterInfoDic['Twitter'][
                'urlFound'] = twittool.url, twittool.url
            twitterBio, twitterInfoDic['Twitter'][
                'description'] = twittool.description, twittool.description
            twitterUrlAccount, twitterInfoDic['Twitter'][
                'urlAccount'] = url_twitter, url_twitter
        if url_facebook:
            facebookInfoDic = {"Facebook": {}}
            fbtool = facebookSearchTool()
            fbtool.getInfoProfile(url_facebook)
            facebookID, facebookInfoDic['Facebook'][
                'id'] = fbtool.facebookId, fbtool.facebookId
            faecbookName, facebookInfoDic['Facebook'][
                'name'] = fbtool.name, fbtool.name
            facebookLocation, facebookInfoDic['Facebook'][
                'location'] = fbtool.address, fbtool.address
            facebookWork, facebookInfoDic['Facebook'][
                'job'] = fbtool.job, fbtool.job
            facebookUrl, facebookInfoDic['Facebook'][
                'urlAccount'] = url_facebook, url_facebook
            facebookUsername, facebookInfoDic['Facebook'][
                'username'] = fbtool.username, fbtool.username
            facebookAffiliation, facebookInfoDic['Facebook'][
                'affiliations'] = fbtool.affiliations, fbtool.affiliations
        if url_instagram:
            instagramInfoDic = {"Instagram": {}}
            instatool = instagramSearchTool()
            instatool.getInfo(url_instagram)
            instagramID, instagramInfoDic['Instagram'][
                'id'] = instatool.id, instatool.id
            instagramBio, instagramInfoDic['Instagram'][
                'description'] = instatool.biography, instatool.biography
            instagramUsername, instagramInfoDic['Instagram'][
                'username'] = instatool.username, instatool.username
            instagramName, instagramInfoDic['Instagram'][
                'name'] = instatool.name, instatool.name
            instagramEmail, instagramInfoDic['Instagram'][
                'email'] = instatool.email, instatool.email
            instagramPhone, instagramInfoDic['Instagram'][
                'phone'] = instatool.phone, instatool.phone
            instagramUrlFound, instagramInfoDic['Instagram'][
                'urlFound'] = url_instagram, url_instagram
            instagramLocation, instagramInfoDic['Instagram'][
                'location'] = instatool.adresse, instatool.adresse
            InstagramUrlAccount, instagramInfoDic['Instagram'][
                'urlAccount'] = instatool.urlAccount, instatool.urlAccount

        for data in dataProfile:
            if data.upper() == 'TWITTER':
                if dataProfile[data]['name'] != twitterName:
                    dataProfile[data]['name'] = twitterName
                    list_news.append(twitterName)
                if dataProfile[data]['location'] != twitterLocation:
                    dataProfile[data]['location'] = twitterLocation
                    list_news.append(twitterLocation)
                if dataProfile[data]['urlFound'] != twitterUrlFound:
                    dataProfile[data]['urlFound'] = twitterUrlFound
                    list_news.append(twitterUrlFound)
                if dataProfile[data]['description'] != twitterBio:
                    dataProfile[data]['description'] = twitterBio
                    list_news.append(twitterBio)

            elif data.upper() == "FACEBOOK":
                if dataProfile[data]['name'] != faecbookName:
                    dataProfile[data]['name'] = faecbookName
                    list_news.append(faecbookName)
                if dataProfile[data]['location'] != facebookLocation:
                    dataProfile[data]['location'] = facebookLocation
                    list_news.append(facebookLocation)
                if dataProfile[data]['job'] != facebookWork:
                    dataProfile[data]['job'] = facebookWork
                    list_news.append(facebookWork)
                if dataProfile[data]['affiliations'] != facebookAffiliation:
                    dataProfile[data]['affiliations'] = facebookAffiliation
                    list_news.append(facebookAffiliation)

            elif data.upper() == 'INSTAGRAM':
                if dataProfile[data]['name'] != instagramName:
                    dataProfile[data]['name'] = instagramName
                    list_news.append(instagramName)
                if dataProfile[data]['location'] != instagramLocation:
                    dataProfile[data]['location'] = instagramLocation
                    list_news.append(instagramLocation)
                if dataProfile[data]['urlFound'] != instagramUrlFound:
                    dataProfile[data]['urlFound'] = instagramUrlFound
                    list_news.append(instagramUrlFound)
                if dataProfile[data]['description'] != instagramBio:
                    dataProfile[data]['description'] = instagramBio
                    list_news.append(instagramBio)

        if url_twitter:
            dataProfile.update(twitterInfoDic)
        if url_facebook:
            dataProfile.update(facebookInfoDic)
        if url_instagram:
            dataProfile.update(instagramInfoDic)

        if url_twitter or url_facebook or url_instagram:
            pr.writeProfile(file, path, dataProfile)

            if instagramEmail:
                list_emails.append(instagramEmail)

            placeVisited = "; ".join(list_placeVisited)

            for bio in list_biographi:
                regex = RegexTool(bio)
                emails = regex.Email().email
                phones = regex.Telephone().telephone
                urls = regex.Url().url

                for email in emails:
                    list_emails.append(email)
                for phone in phone:
                    list_phone.append(phone)
                for url in urls:
                    list_urls.append(urls)

            if list_emails:
                emails = ", ".join(list_emails)
            else:
                emails = ''

            if list_phones:
                phones = ", ".join(list_phones)
            else:
                phones = ''

            if list_urls:
                urls = ", ".join(list_urls)
            else:
                urls = ''

            global_info = """
	Date: %s

	Profile ID : %s
	First name, Last name: %s

	Téléphone: %s
	Emails: %s
	Location: %s ; %s ; %s
	Profession: %s
	Nicknames: %s ; %s ; %s

	Facebook  (%s) - %s
	Twitter   (%s) - %s
	Instagram (%s) - %s

	Place visited: %s

	Descriptions: 
	%s	

	%s
			""" % (today, profileID, profileName, phones, emails, instagramLocation,
            twitterLocation, facebookLocation, facebookWork, facebookUsername,
            twitterUsername, instagramUsername, facebookID, facebookUrl,
            twitterID, twitterUrlAccount, instagramID, InstagramUrlAccount,
            placeVisited, twitterBio, instagramBio)

            lists = []
            w = watcher()
            if url_instagram:
                w.instagramWatcher(url_instagram)
                lists.append(w.medias)
            if url_twitter:
                w.twitterWatcher(url_twitter)
                lists.append(w.tweet)

            if lists:
                data = pr.timeSort(
                    lists, reverse=True
                )  # True: Ordre Decroissant, False: Ordre croissant (defaut : False)

                TABLE_DATA = [
                    ('Date', 'Domain', 'Publication', 'Location'),
                ]

                for d in data:
                    date = time.ctime(d)
                    domain = data[d]['domain']

                    if domain == "Twitter":
                        tweet = data[d]['tweet'].replace(
                            "https://twitter.com", '')
                        tuples = (date, domain, tweet, 'None')
                        TABLE_DATA.append(tuples)

                    else:
                        publication = data[d]['urlMedia']
                        publicationShort = shortCutUrl(publication)
                        typePublication = data[d]['type']
                        localisation = data[d]['location']

                        if localisation:
                            list_placeVisited.append(localisation)

                        tuples = (date, domain, publicationShort, localisation)
                        TABLE_DATA.append(tuples)

                tableLastPost = SingleTable(TABLE_DATA, " Last post ")

                print(tableLastPost.table)
            print("-------------")
            print("\n" + global_info)

            if len(list_news) > 0:
                newsItems = "; ".join(list_news)
                print("New Arrivals:\n" + newsItems)

            print("-------------")

            print(question +
                  " Do you want to export the recovered data to '%s' ? " %
                  (name_txt))

            while True:
                choix = input("\n [O/n]: ")

                if choix == '' or choix.upper() == 'O':
                    f = pr.exportText(name_txt, path, global_info)
                    if f:
                        print("\n" + found + " Data successfully exported !")
                        print(" %s" % (path_txt))
                    else:
                        print(
                            "\n" + warning +
                            " An error has occurred, the data could not be exported !"
                        )
                    break

                elif choix.upper() == 'N':
                    break

            print("\n" + question +
                  " Do you want to create a copy of '%s' ? " % (name_txt))

            while True:
                choix = input("\n [o/N]: ")

                if choix.upper() == 'O':
                    print("\n" + question +
                          " Or do you want to save the copy ?")
                    pathDefault = os.getcwd()
                    print(Fore.YELLOW + " Default path: " + pathDefault +
                          Fore.RESET)
                    path = input("\n Path: ")

                    if not path:
                        path = pathDefault
                        path += "\\"
                    if path.endswith(".txt"):
                        path = path_txt
                    else:
                        path = path + name_txt

                    with open(path, 'w', encoding="utf-8") as f:
                        f.write(global_info)
                        f.close()

                    print("\n" + found +
                          " '%s' has been successfully copied !" % (name_txt))
                    break

                elif choix == '' or choix.upper() == 'N':
                    break

    else:
        print("\n" + warning + " Profile not found")
Ejemplo n.º 5
0
def search_instagram(user):
    urlProfil = "https://instagram.com/" + user

    insta = instagramSearchTool()
    insta.getInfo(user)

    name = insta.name
    userId = insta.id
    images = insta.profi_pic_hd
    images = shortCutUrl(images)
    username = insta.username
    private = insta.private
    followers = insta.followers
    friend = insta.friends
    publication = insta.medias
    bio = insta.biography
    url = insta.url
    email = insta.email
    adresse = insta.adresse
    phone = insta.phone

    print("\n[%s]\n" % (username))
    print(found + " Name: %s" % (name))
    print(found + " Pictures: %s" % (images))
    print(found + " ID: %s" % (userId))
    print(found + " Protected: %s" % (private))
    print(found + " Abonnés: %s  |  Abonnements: %s" % (followers, friend))
    print(found + " Publication: %s" % (publication))
    print(found + " Bio: %s" % (bio))

    if url:
        print(found + " Url: %s" % (url))
    if email:
        print(found + " Email: %s" % (email))
    if phone:
        print(found + " Telephone: %s" % (phone))
    if adresse:
        print(found + " Lieux: %s" % (adresse))

    if not private:
        print("\n" + question +
              " Voulez vous télécharger les 12 dernières photos postées ?")

        while True:
            choix = input("\n [o/N]: ")

            if choix == "" or choix.upper() == "N":
                break

            elif choix.upper() == "O":
                print("\n" + question +
                      " Ou voulez-vous enregistrer les photos ?")
                pathDefault = os.getcwd()
                print(Fore.YELLOW + " Default path: " + pathDefault +
                      Fore.RESET)
                path = input("\n Path: ")
                print("\n" + wait + " Téléchargement des photos de '%s'\n" %
                      (user))

                if not path:
                    path = pathDefault

                pictureInfo = insta.get_picturesInfo(urlProfil)

                for i in pictureInfo:
                    media = pictureInfo[i]['display']
                    typeMedia = pictureInfo[i]['type_media']
                    date = pictureInfo[i]['date']
                    view = pictureInfo[i]['info']
                    loc = pictureInfo[i]['localisation']
                    filename = user + '_' + str(i) + ".jpg"

                    if not loc:
                        loc = ''

                    insta.downloadPictures(media, path, filename)
                    print("(%s) %s %s [%s] %s téléchargé." %
                          (str(i), typeMedia, date, view, loc))

                print("\n" + found + " Téléchargement fini.")
                break
Ejemplo n.º 6
0
def searchInstagram():
    user = input(" Username: "******"https://instagram.com/" + user

    insta = instagramSearchTool()
    insta.getInfo(user)

    name = insta.name
    userId = insta.id
    images = insta.profi_pic_hd
    images = shortCutUrl(images)
    username = insta.username
    private = insta.private
    followers = insta.followers
    friend = insta.friends
    publication = insta.medias
    bio = insta.biography
    url = insta.url
    email = insta.email
    adresse = insta.adresse
    phone = insta.phone

    print("\n[%s]\n" % (username))
    print(found + " Name: %s" % (name))
    print(found + " Pictures: %s" % (images))
    print(found + " ID: %s" % (userId))
    print(found + " Protected: %s" % (private))
    print(found + " Abonnés: %s  |  Abonnements: %s" % (followers, friend))
    print(found + " Publication: %s" % (publication))
    print(found + " Bio: %s" % (bio))

    if url:
        print(found + " Url: %s" % (url))
    if email:
        print(found + " Email: %s" % (email))
    if phone:
        print(found + " Telephone: %s" % (phone))
    if adresse:
        print(found + " Lieux: %s" % (adresse))

    if not private:
        print("\n" + question +
              " Voulez vous télécharger les 12 dernières photos postées ?")

        while True:
            choix = input("\n [o/N]: ")

            if choix == "" or choix.upper() == "N":
                break

            elif choix.upper() == "O":
                print("\n" + question +
                      " Ou voulez-vous enregistrer les photos ?")
                pathDefault = os.getcwd()
                print(Fore.YELLOW + " Default path: " + pathDefault +
                      Fore.RESET)
                path = input("\n Path: ")
                print("\n" + wait + " Téléchargement des photos de '%s'\n" %
                      (user))

                if not path:
                    path = pathDefault

                insta.downloadPictures(urlProfil, path)
                print("\n" + found + " Téléchargement fini.")
                break
Ejemplo n.º 7
0
def searchInstagram():
	user = input(" Username: "******"https://instagram.com/"+user

	insta = instagramSearchTool()
	insta.getInfo(user)

	name = insta.name
	userId = insta.id
	images = insta.profi_pic_hd
	images = shortCutUrl(images)
	username = insta.username
	private = insta.private
	followers = insta.followers
	friend = insta.friends
	publication = insta.medias
	bio = insta.biography
	url = insta.url
	email = insta.email
	adresse = insta.adresse
	phone = insta.phone


	print("\n[%s]\n" % (username))
	print(found+" Name: %s" % (name))
	print(found+" Pictures: %s" % (images))
	print(found+" ID: %s" % (userId))
	print(found+" Protected: %s" % (private))
	print(found+" Subscribers: %s  |  Subscriptions: %s" % (followers, friend))
	print(found+" Publication: %s" % (publication))
	print(found+" Bio: %s" % (bio))

	if url:
		print(found+" Url: %s" % (url))
	if email:
		print(found+" Email: %s" % (email))
	if phone:
		print(found+" Telephone: %s" % (phone))
	if adresse:
		print(found+" Places: %s" % (adresse))

	if not private:
		print("\n"+question+" Do you want to download the last 12 photos posted ?")

		while True:
			choix = input("\n [o/N]: ")

			if choix == "" or choix.upper() == "N":
				break
			
			elif choix.upper() == "O":
				print("\n"+question+" Or do you want to save the photos ?")
				pathDefault = os.getcwd()
				print(Fore.YELLOW+" Default path: "+pathDefault+Fore.RESET)
				path = input("\n Path: ")
				print("\n"+wait+" Download photos from '%s'\n" % (user))
			
				if not path:
					path = pathDefault
			
				pictureInfo = insta.get_picturesInfo(urlProfil)

				for i in pictureInfo:
					media = pictureInfo[i]['display']
					typeMedia = pictureInfo[i]['type_media']
					date = pictureInfo[i]['date']
					view = pictureInfo[i]['info']
					loc = pictureInfo[i]['localisation'] 
					filename = user+'_'+str(i)+".jpg"

					if not loc:
						loc = ''

					insta.downloadPictures(media, path, filename)
					print("(%s) %s %s [%s] %s downloaded." % (str(i), typeMedia, date, view, loc))

				print("\n"+found+" Download finished.")
				break
Ejemplo n.º 8
0
def searchPersonne(self ,text,person_lookup,nom,city,codemonpays):

	person_lookup.destroy()
	# nom = Entry()
	# nom.place(x=200,y=200)
	# nom = nom.get()
	# print(nom)
	# city = input(" Ville/Departement: ")
	# Progress bar widget
	progress = Progressbar(self, orient=HORIZONTAL, length=200, mode='determinate')
	progress.place(x=600, y=200)

	try:

		headers = {
			'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
			'referrer': 'https://google.com',
			'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
			'Accept-Encoding': 'utf-8',
			'Accept-Language': 'en-US,en;q=0.9',
			'Pragma': 'no-cache'
		}
		progress['value'] = 5
		self.update_idletasks()
		time.sleep(0.1)

		if codemonpays == 'FR':
			# Page Jaune search
			url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPJ(progress,self,text, requete)

		elif codemonpays == 'BE':
			# Page D'or search
			url = "https://www.pagesblanches.be/chercher/personne/{}/{}/"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPageDor(text,self,requete)

		elif codemonpays == 'CH':
			# Suisse search
			url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res"
			searchLocalCH(progress,self,text,url.format(city, nom))

		elif codemonpays == 'LU':
			# Luxembourg search
			url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}"
			searchYellowLU(url.format(nom))

		else:
			# Recherche FR
			url = "https://www.pagesjaunes.fr/pagesblanches/recherche?quoiqui={}&ou={}"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPJ(progress,self,text, requete)

			# Recherche BE
			url = "https://www.pagesblanches.be/chercher/personne/{}/{}/"
			requete = requests.get(url.format(nom, city), headers=headers)
			searchPageDor(text,self,requete)

			# Recherche CH
			url = "https://tel.local.ch/fr/q?area={}&city=&company=&ext=1&name={}&phone=&rid=455h&street=&typeref=res"
			searchLocalCH(progress,self,text,url.format(city, nom))

			# Recherche LU
			url = "https://www.yellow.lu/fr/pages-blanches/recherche?query={}"
			searchYellowLU(text,url.format(nom))
		progress['value'] =10
		self.update_idletasks()
		time.sleep(0.1)

		# Copain d'avant search
		searchCopainsdavant(text, nom, city)

		progress['value'] = 15
		self.update_idletasks()
		time.sleep(0.1)

		# LinkedIn search
		searchPersonneLinkedin(self,progress,text, nom, city)

		# Facebook search
		fbtool = facebookSearchTool()
		accountsFb = fbtool.searchFacebook(nom)

		title = " Facebook "

		TABLE_DATA = [
			('Name', 'User', 'Location'),
		]

		count = 0

		progress['value'] = 25
		self.update_idletasks()
		time.sleep(0.1)

		for a in accountsFb:
			count += 1
			name = a[1]
			username = a[0]
			fbtool.getInfoProfile(username)
			loc = fbtool.address
			if not loc:
				loc = ""

			tuples = (name, username, loc)
			# listeInfos.append(tuples)
			TABLE_DATA.append(tuples)

		progress['value'] = 35
		self.update_idletasks()
		time.sleep(0.1)

		if count > 0:
			table_instance = SingleTable(TABLE_DATA, title)
			text.insert(END,table_instance.table)
			# labl = Label(self, text=table_instance.table, bg="black", fg="green",
			# 			 font=("comicsansms", 15, "bold"), relief=FLAT)
			# labl.place(x=20, y=2)

		# Twitter Search
		title = " Twitter "

		progress['value'] = 50
		self.update_idletasks()
		time.sleep(0.1)

		TABLE_DATA = [
			('Name', 'User', 'Date', 'Location'),
		]

		twitool = twitterSearchTool()
		accountTwitter = twitool.searchTwitter(nom)

		count = 0

		for a in accountTwitter:
			count += 1
			name = a[1]
			username = "******" + a[0]
			twitool.getInfoProfile(a[0])

			location = twitool.location
			date = twitool.birth
			bio = twitool.description
			url = twitool.url

			tuples = (name, username, date, location)
			TABLE_DATA.append(tuples)

		if count > 0:
			table_instance = SingleTable(TABLE_DATA, title)
			text.insert(END,table_instance.table)

		# Instagram search
		title = " Instagram "

		instatls = instagramSearchTool()
		instatls.searchInsta(nom)

		accounts = instatls.accounts

		TABLE_DATA = [
			('Name', 'User'),
		]

		count = 0

		progress['value'] = 65
		self.update_idletasks()
		time.sleep(0.1)

		for account in accounts:
			url = "https://instagram.com/" + account
			i = instagramSearchTool()
			i.getInfo(url)
			name = i.name

			tuples = (name, account)
			TABLE_DATA.append(tuples)

			count += 1

		if count > 0:
			progress['value'] = 100
			self.update_idletasks()
			time.sleep(0.1)
			progress.destroy()
			table = SingleTable(TABLE_DATA, title)
			text.insert(END,table.table)

	except IOError:
		progress['value'] = 50
		self.update_idletasks()
		time.sleep(0.1)

		progress['value'] = 80
		self.update_idletasks()
		time.sleep(0.1)
		progress.destroy()
		pass