zzzzz icon indicating copy to clipboard operation
zzzzz copied to clipboard

'Namespace' object has no attribute 'cookie'

Open felipedmesquita opened this issue 10 years ago • 2 comments

Probably an issue with SECRETS.txt. the file looks like this now: (with the numbers letters altered and the cookie redacted)

uid=100000232323239
cookie=datr=JuOSKadJDmdiU8_gn3djr4B; locale=en_US; c_user=[Redacted cookie]wd=882x749
client_id=88c9g39b

Terminal outputs:

Felipes-MacBook-Air:zzzzz-master felipe$ python fetcher.py Traceback (most recent call last): File "fetcher.py", line 8, in import graph File "/Users/felipe/Downloads/zzzzz-master/graph.py", line 6, in import flap File "/Users/felipe/Downloads/zzzzz-master/fbapi.py", line 4, in import fetcher File "/Users/felipe/Downloads/zzzzz-master/fetcher.py", line 25, in class Fetcher(): File "/Users/felipe/Downloads/zzzzz-master/fetcher.py", line 31, in Fetcher 'cookie': secrets.cookie, AttributeError: 'Namespace' object has no attribute 'cookie'

felipedmesquita avatar Feb 21 '16 01:02 felipedmesquita

Yep it's probably an issue with SECRETS.txt. Look at line 14:

with open("SECRETS.txt") as f:
    for line in f:
        vals = line.strip().split('=', 1)
        setattr(secrets, vals[0].lower(), vals[1])

It splits each line at '=' and sets the left part as the attribute name and the right part as the attribute value. If you just want to get it running you could replace secrets.cookie at line 31 with your actual value which is: datr=JuOSKadJDmdiU8_gn3djr4B; locale=en_US; c_user=[Redacted cookie]wd=882x749 client_id=88c9g39b

(with the numbers letters altered and the cookie redacted)

knock-in avatar Feb 21 '16 11:02 knock-in

The mistake is in your SECRETS.txt file. The cookie field must be something like: cookie='cookie values here'. Plus your SECRETS.txt looks really different from mine, make sure to copy it correctly from your browser.

pielco11 avatar Dec 30 '17 20:12 pielco11