cbdelavenne / fb-messenger-media-scraper

Helper script to scrape your Facebook Messenger account for images shared in your conversations quickly and efficiently.
MIT License
6 stars 1 forks source link

AttributeError: 'Group' object has no attribute 'url' #2

Closed stefanosstef closed 4 years ago

stefanosstef commented 4 years ago

After update && upgrade: Output for pip3 install -r requirements.txt:

Collecting aenum==2.2.1 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/50/01/cd83899880e45a5993d5634a1a1e9dabbcc5dcb6808a4d95a8fecafcebd2/aenum-2.2.1-py3-none-any.whl (40kB)
    100% |████████████████████████████████| 40kB 275kB/s
Collecting attrs==19.1.0 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/23/96/d828354fa2dbdf216eaa7b7de0db692f12c234f7ef888cc14980ef40d1d2/attrs-19.1.0-py2.py3-none-any.whl
Requirement already satisfied: beautifulsoup4==4.8.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3)) (4.8.0)
Collecting certifi==2019.6.16 (from -r requirements.txt (line 4))
  Using cached https://files.pythonhosted.org/packages/69/1b/b853c7a9d4f6a6d00749e94eb6f3a041e342a885b87340b79c1ef73e3a78/certifi-2019.6.16-py2.py3-none-any.whl
Requirement already satisfied: chardet==3.0.4 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 5)) (3.0.4)
Collecting fbchat==1.7.3 (from -r requirements.txt (line 6))
  Using cached https://files.pythonhosted.org/packages/7b/db/75d8125c4d75af09bcf15b204d5aeaddb4f58e455a3d78622f45406af2b5/fbchat-1.7.3-py2.py3-none-any.whl
Collecting idna==2.8 (from -r requirements.txt (line 7))
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Requirement already satisfied: requests==2.22.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 8)) (2.22.0)
Collecting soupsieve==1.9.3 (from -r requirements.txt (line 9))
  Using cached https://files.pythonhosted.org/packages/0b/44/0474f2207fdd601bb25787671c81076333d2c80e6f97e92790f8887cf682/soupsieve-1.9.3-py2.py3-none-any.whl
Collecting urllib3==1.25.3 (from -r requirements.txt (line 10))
  Using cached https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl
Installing collected packages: aenum, attrs, certifi, fbchat, idna, soupsieve, urllib3
  Found existing installation: attrs 19.3.0
    Uninstalling attrs-19.3.0:
      Successfully uninstalled attrs-19.3.0
  Found existing installation: certifi 2018.8.24
    Not uninstalling certifi at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'certifi'. No files were found to uninstall.
  Found existing installation: idna 2.6
    Not uninstalling idna at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'idna'. No files were found to uninstall.
  Found existing installation: soupsieve 1.9.5
    Not uninstalling soupsieve at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'soupsieve'. No files were found to uninstall.
  Found existing installation: urllib3 1.25.6
    Not uninstalling urllib3 at /usr/lib/python3/dist-packages, outside environment /usr
    Can't uninstall 'urllib3'. No files were found to uninstall.
Successfully installed aenum-2.2.1 attrs-19.1.0 certifi-2019.6.16 fbchat-1.7.3 idna-2.8 soupsieve-1.9.3 urllib3-1.25.3

Output from python3 ./fbm-scraper.py after successful log in:

Traceback (most recent call last):
  File "./fbm-scraper.py", line 98, in <module>
    if thread.url == friend_url:
AttributeError: 'Group' object has no attribute 'url'
stefanosstef commented 4 years ago

I get the same error on both windows and linux

cbdelavenne commented 4 years ago

Hey @stefanosstef

Are you specifying your friend url in the config file? I'll look into this. Either way, there's definitely room for improvement for error messages if anything!

stefanosstef commented 4 years ago

I did yes.Sorry for the late response, did you manage to replicate this?

cbdelavenne commented 4 years ago

I did yes.Sorry for the late response, did you manage to replicate this?

Not yet, haven't had time to work on improving this project. Feel free to propose any improvements via a Pull Request if you want to spend some time on it. Otherwise, I'll see when I can get to it.

p8ron commented 4 years ago

Any solution?

neexal commented 4 years ago

got the same error.

DrLous commented 4 years ago

Sorry for ugly patch, I don't use github :)

Arround Line 98:

    # Find correct thread for given user URL
    my_thread = None 
    friend_url = config.get('Friend', 'url')
    for thread in threads:
          try:
             print(thread.url)  #List all thread for correct url in config.ini :)
             if thread.url == friend_url:
                my_thread = thread
                break
          except AttributeError:  #ugly but work
             pass

    # Get Messages for my_thread
jakewilliami commented 4 years ago

@DrLous Works for me. I will create a pull request with your solution; thank you

cbdelavenne commented 4 years ago

@DrLous Thank you for the change suggested. And thanks to @jakewilliami for the PR. It has been merged!