kukiezi / messenger-pics-downloader Goto Github PK
View Code? Open in Web Editor NEWTool to download images from messenger conversation to Your computer
Tool to download images from messenger conversation to Your computer
Hi there,
As web scraping is messy, I am getting some errors using this code. (Once I find a workaround I will let you know so that you can consider adding it).
The problem you get when this application fails is that there is an open, headless browser eating RAM in the background. A suggested fix to this would be to have a killWebDriver
function, and put the main code into something like this:
try:
main()
except Exception:
killWebDriver()
raise
killWebDriver()
If you don't want to do this, let me know what the main function would be and I can submit a PR.
I was trying to follow along the instructions, and as I was executing python3 messenger-pics-downloader
, this pops up Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "messenger-pics-downloader/__main__.py", line 1, in <module> from downloader import downloadImages File "messenger-pics-downloader/downloader.py", line 1, in <module> import requests ModuleNotFoundError: No module named 'requests'
any workaround for this? thanks so much!
Welcome to Messenger_Pics_Downloader
To change program settings go to config.json
Do You want to load data from config? (y/n):y
DevTools listening on ws://127.0.0.1:58610/devtools/browser/52c4cd75-7d5e-4a43-955f-04e196709371
Logging in to Facebook.com...
[0203/134225.691:INFO:CONSOLE(16)] "
.d8888b. 888 888
d88P Y88b 888 888
Y88b. 888 888 This is a browser feature intended for
"Y888b. 888888 .d88b. 88888b. 888 developers. If someone told you to copy-paste
"Y88b. 888 d88""88b 888 "88b 888 something here to enable a Facebook feature
"888 888 888 888 888 888 Y8P or "hack" someone's account, it is a
Y88b d88P Y88b. Y88..88P 888 d88P scam and will give them access to your
"Y8888P" "Y888 "Y88P" 88888P" 888 Facebook account.
888
888
888
See https://www.facebook.com/selfxss for more information.
", source: https://static.xx.fbcdn.net/rsrc.php/v3iqES4/yG/l/en_US/lmRxeYlKUEE.js?_nc_x=Ij3Wp8lg5Kz (16)
Exception occured! Will download all images gathered until exception. Check webdriver_error.txt for more details.
Downloading images...
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.752.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\user\Desktop\challenges\messenger-pics-downloader\__main__.py", line 5, in <module>
startDownloader()
File "C:\Users\user\Desktop\challenges\messenger-pics-downloader\messenger_downloader.py", line 145, in startDownloader
itertools.repeat(data["folder_name"]), image_links))
UnboundLocalError: local variable 'image_links' referenced before assignment
I followed the instructions however whenever I try to run the program I get this error -->
line 144, in startDownloader pool.starmap(downloadImages, zip(itertools.repeat(current_dir),itertools.repeat(data["folder_name"]), image_links)) UnboundLocalError: local variable 'image_links' referenced before assignment
Running it with the Chrome driver gives me the following:
Welcome to Messenger_Pics_Downloader
To change program settings go to config.json
Do You want to load data from config? (y/n):y
Exception occured! Will download all images gathered until exception. Check webdriver_error.txt for more details.
Downloading images...
Traceback (most recent call last):
File "._main_.py", line 5, in
startDownloader()
File "C:\Users\Idriz\Documents\GitHub\messenger-pics-downloader\messenger_downloader.py", line 145, in startDownloader
itertools.repeat(data["folder_name"]), image_links))
UnboundLocalError: local variable 'image_links' referenced before assignmentWelcome to Messenger_Pics_Downloader
To change program settings go to config.json
Do You want to load data from config? (y/n):y
[0323/210958.765:ERROR:network_change_notifier_win.cc(141)] WSALookupServiceBegin failed with: 0
DevTools listening on ws://127.0.0.1:50808/devtools/browser/a1bd0b5d-57ac-476f-acbe-c2350546a589
[0323/211000.407:ERROR:network_change_notifier_win.cc(141)] WSALookupServiceBegin failed with: 0Logging` in to Facebook.com...
[0323/211007.772:INFO:CONSOLE(14)] "
This is a browser feature intended for
developers. If someone told you to copy-paste
something here to enable a Facebook feature
or "hack" someone's account, it is a
scam and will give them access to your
Facebook account.See https://www.facebook.com/selfxss for more information.
", source: https://www.facebook.com/rsrc.php/v3iqES4/yB/l/en_US/Q59O4osvQMx.js?_nc_x=Ij3Wp8lg5Kz (14)
Logged in!
Starting image source scrapping...
[0323/211012.511:INFO:CONSOLE(14)] "This is a browser feature intended for
developers. If someone told you to copy-paste
something here to enable a Facebook feature
or "hack" someone's account, it is a
scam and will give them access to your
Facebook account.See https://www.facebook.com/selfxss for more information.
", source: https://www.facebook.com/rsrc.php/v3iqES4/yB/l/en_US/Q59O4osvQMx.js?_nc_x=Ij3Wp8lg5Kz (14)
Exception occured! Will download all images gathered until exception. Check webdriver_error.txt for more details.
Downloading images...
Traceback (most recent call last):
File "._main_.py", line 5, in
startDownloader()
File "C:\Users\Idriz\Documents\GitHub\messenger-pics-downloader\messenger_downloader.py", line 145, in startDownloader
itertools.repeat(data["folder_name"]), image_links))
UnboundLocalError: local variable 'image_links' referenced before assignment
While running it with the gecko driver gives at least something but still,not successful:
PS C:\Users\Idriz\Downloads\messenger-pics-downloader> py ._main_.py
Welcome to Messenger_Pics_Downloader
To change program settings go to config.json
Do You want to load data from config? (y/n):y
Logging in to Facebook.com...
Logged in!
Starting image source scrapping...
skipping 1 picture
skipping 2 picture
skipping 3 picture
skipping 4 picture
skipping 5 picture
skipping 6 picture
...
skipping 196 picture
skipping 197 picture
skipping 198 picture
skipping 199 picture
Getting image source: 1
Getting image source: 2
Getting image source: 3
Getting image source: 4
Getting image source: 5
Getting image source: 6
Getting image source: 7
Getting image source: 8
Getting image source: 9
Getting image source: 10
Getting image source: 11
Meanwhile it only saves 1 picture,and only if I put it to save source to txt,otherwise no download since it doesn't stop and goes on
I'll paste the webdriver_errors below:
Chrome:webdriver_error.txt
Gecko:
webdriver_error.txt
Since I'm not quite understanding of Python,I couldn't do much I'm sorry therefore I post here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.