Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ghost opened this issue Apr 12, 2019 · 3 comments
Open

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

ghost opened this issue Apr 12, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 12, 2019

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!

@cjekel
Copy link

cjekel commented Apr 12, 2019

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

@ischroedi
Copy link

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?

@acerock6
Copy link

acerock6 commented Nov 29, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants