pynder icon indicating copy to clipboard operation
pynder copied to clipboard

AttributeError: module 'pynder' has no attribute 'Session'

Open ghost opened this issue 5 years ago • 3 comments

Hello, When I try to run ` import itertools import pynder

FBTOKEN = "" FBID = ""

session = pynder.Session(facebook_id=FBID, facebook_token=FBTOKEN) users = session.nearby_users() for user in itertools.islice(users, 5): print(user.name())`

I get the following error. Any idea what's wrong? "AttributeError: module 'pynder' has no attribute 'Session'" Thanks!

ghost avatar Apr 12 '19 15:04 ghost

Whatever method you used to grab that token, you should log out immediately. That should cancel the token. It's probably a good idea to keep that private.


You may have a local folder/file named pynder.py which is causing the error. Verify that your current working directory doesn't contain this. Perhaps the easiest way would be within an Ipython console and type ls pynder*.

When you install pynder, make sure you clone this repo. The version on pypi is old.

git clone https://github.com/charliewolf/pynder
python -m pip install --force-reinstall ./pynder

cjekel avatar Apr 12 '19 20:04 cjekel

I cannot get the FBTOKEN. The FBID I got from facebook, but the FBTOKEN, its very difficult to get and all other solutions wont work any more :-(

Any hints?

ischroedi avatar Apr 22 '19 18:04 ischroedi

The below works to generate FB access token:

import re
import robobrowser
import sys
import random
import requests
import time

MOBILE_USER_AGENT = "Tinder/7.5.3 (iPhone; iOS 10.3.2; Scale/2.00)"

FB_AUTH = 'https://www.facebook.com/v2.6/dialog/oauth?redirect_uri=fb464891386855067%3A%2F%2Fauthorize%2F&scope=user_birthday%2Cuser_photos%2Cuser_education_history%2Cemail%2Cuser_relationship_details%2Cuser_friends%2Cuser_work_history%2Cuser_likes&response_type=token%2Csigned_request&client_id=464891386855067&ret=login&fallback_redirect_uri=221e1158-f2e9-1452-1a05-8983f99f7d6e&ext=1556057433&hash=Aea6jWwMP_tDMQ9y'

def get_access_token(email, password):
    s = robobrowser.RoboBrowser(user_agent=MOBILE_USER_AGENT, parser="lxml")
    s.open(FB_AUTH)
    ## submit login form
    f = s.get_form()
    f["pass"] = password
    f["email"] = email
    s.submit_form(f)

    ## click the 'ok' button on the dialog informing you that you have already authenticated with the Tinder app
    f = s.get_form()
    try:
        s.submit_form(f, submit=f.submit_fields['__CONFIRM__'])
        #print(s.response.content.decode())
        access_token = re.search(
            r"access_token=([\w\d]+)", s.response.content.decode()).groups()[0]
    except requests.exceptions.InvalidSchema as browserAddress:
        #print(type(browserAddress))
        #print(str(browserAddress))
        access_token = re.search(
             r"access_token=([\w\d]+)", str(browserAddress)).groups()[0]
        return(access_token)


access_token = get_access_token(email, password)

acerock6 avatar Nov 29 '19 11:11 acerock6